Linux Build Dependencies
The commands below should prepare a regular system into one able to build LibreOffice, it is by far the easiest way to use the existing package to bootstrap your build dependencies.
Debian / Ubuntu
1. Install some prerequisites that get missed:
sudo apt-get install git gstreamer1.0-libav libkrb5-dev nasm graphviz ccache
2. To run
build-dep, your repository list should include the source-code repository. Make sure you have a deb-src line in /etc/apt/sources.list for the main respository.
You can add the software sources by uncommenting the line (removing the starting
#) under the
deb line, or just copy the equivalent
deb line and add
-src to it. Or simply add source code repository in software source manager (in Ubuntu: Software Updater).
The lines for source repositories should look something like these:
deb-src http://http.debian.net/debian/ stretch main (in Debian 9)
deb-src http://archive.ubuntu.com/ubuntu/ xenial main (in Ubuntu 16.04)
3. Next make sure the repositories are working properly (no errors)
sudo apt-get update
Some mirrors do not copy the sources. In that case you will need to switch to a mirror that does. This would cause the
"Unable to find the source package for libreoffice" error in the next step.
4. Then install all the build dependencies according to apt with:
sudo apt-get build-dep libreoffice
The above was tested on Ubuntu 14.04+ and Debian Stretch.
If you look into building recent versions of LibreOffice, we advise you to add the LibreOffice factory repository, for reasonably up-to-date dependencies:
sudo zypper ar http://download.opensuse.org/repositories/LibreOffice:/Factory/==YOUR_VERSION_HERE==/LibreOffice:Factory.repo
For openSUSE 13.2 for example:
sudo zypper ar http://download.opensuse.org/repositories/LibreOffice:/Factory/openSUSE_13.2/LibreOffice:Factory.repo
If you want to work with a git checkout, naturally then you'd want git, too:
sudo zypper in git
Now install all build dependencies:
sudo zypper si -d libreoffice # for openSUSE >= 12.1 and maintenance update to LO >= 3.4 sudo zypper si -d libreoffice-bootstrap # for openSUSE == 11.4
IMPORTANT: Please, make sure that you have a reasonable Java SDK. Unfortunately, gcj is installed by default but it does not work reasonably. Please, do: </source>
sudo zypper in java-1_8_0-openjdk-devel
sudo dnf builddep libreoffice # for Fedora >= 15 sudo yum-builddep openoffice.org # for RHEL-6, Fedora < 15; & derivatives sudo dnf install gcc-c++ ant java-devel junit flex bison \ # This one command should suffice for gtk2-devel freetype-devel gstreamer-devel autoconf gperf libXaw-devel \ # Fedora-23, Fedora-24 minimal install. GConf2-devel gnome-vfs2-devel cups-devel gstreamer1-plugins-base-devel \ doxygen perl-Digest-MD5 libxslt-devel python3-devel patch zip gtk3-devel \ dbus-glib-devel tar git bzip2 findutils
Unless you absolutely want to use gnome-vfs, configure libreoffice with an extra --enable-gio - that's how the native fedora packages are built. If instead you go with the default, you need
sudo yum install gnome-vfs2-devel
Setup the basic build system:
sudo pacman -S base-devel
Make sure that you have installed at least the fonts that are required for the user interface:
sudo pacman -S ttf-dejavu artwiz-fonts
If 'gcc-libs-multilib' is installed, you will have to remove the 'gcc-libs' dependency.
Install dependencies using pacman
These make dependencies are copied from the official PKGBUILD of Arch Build System (with some modifications as it includes stuff that is not needed).
sudo pacman -S --needed "curl>=7.20.0" "hunspell>=1.2.8" "python>=3.7" "libwpd>=0.9.2" 'libwps' "neon>=0.28.6" \ 'pango' 'nspr' 'libjpeg' 'libxrandr' 'libgl' 'dbus-glib' 'libxslt' 'redland' 'hyphen' 'lpsolve' \ 'gcc-libs' 'sh' 'graphite' 'icu' 'lcms2' "poppler>=0.24.0" 'libvisio' 'libetonyek' \ 'libodfgen' 'libcdr' 'libmspub' 'harfbuzz-icu' 'nss' 'clucene' 'hicolor-icon-theme' \ 'desktop-file-utils' 'shared-mime-info' 'gtk2' 'gst-plugins-base-libs' 'sane' \ 'zip' 'unzip' 'unixodbc' 'gperf' 'kdelibs' 'gtk3' 'qt5-base' 'plasma-framework' \ 'cppunit' 'beanshell' 'junit' 'libmythes' 'libwpg' 'java-environment' 'postgresql-libs' 'libgl' \ 'bluez-libs' 'gdb' 'doxygen' 'libatomic_ops' 'mdds' 'libepoxy' 'apr' 'serf' \ 'ttf-liberation' 'glm' 'libxinerama' 'libpagemaker' 'libabw' 'libmwaw' 'libe-book' \ 'coin-or-mp' 'liblangtag' 'liborcus' 'libexttextcat' 'libcmis' 'gobject-introspection' \ 'libtommath' 'libzmf' 'nasm' 'gpgme' 'xmlsec' 'libmariadbclient'
If you don't plan to be working on Java, you can remove hsqldb-java, junit, java-environment, beanshell from this list as LibreOffice mostly runs without it.
./autogen.sh --without-java --disable-postgresql-sdbc --disable-gstreamer