Linux Build Dependencies

From The Document Foundation Wiki
Jump to: navigation, search

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.

Im-jabber.svg

Note:
It is usually the case that branches that are newer than what your distro has packaged (especially master) have additional requirements, which the autogen.sh step will helpfully point out to you; usually these requirements are either optional and have a corresponding --disable-foo or --without-foo argument, or the requirement can be satisfied with an option to use a bundled copy via --without-system-foo argument (which should be the default already). If neither is the case then you need to install some development package on your system: look at what configure is complaining about specifically and use apt-cache search or yum search to find relevant packages, usually with -dev or -devel in the name.

Debian / Ubuntu

1. Install some prerequisites that get missed:

sudo apt-get install git gstreamer1.0-libav libkrb5-dev nasm

2. To run build-dep your repository source should contain source-code repository source. Make sure you have a deb-src line in /etc/apt/sources.list for the main respository. For example:

deb-src http://http.debian.net/debian/ jessie main  (in debian)
deb-src http://archive.ubuntu.com/ubuntu/ xenial main  (in ubuntu)

You can add the software sources to remove # under deb line or just copy the equivalent deb line and add -src to it. Or, simply add source code repository in software source manager.

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 Jessie.

openSUSE

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:

sudo zypper in java-1_6_0-openjdk-devel                                           # if you prefer pure open source solution
sudo zypper in java-1_6_0-sun-devel                                               # if you prefer Oracle Java

Fedora/RedHat

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

Arch Linux

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.

sudo pacman -S --needed "curl>=7.20.0" "hunspell>=1.2.8" "python>=3.6" "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' 'glu' 'sane' \
                        'zip' 'unzip' 'unixodbc' 'apache-ant' 'gperf' 'kdelibs' 'gtk3' 'cppunit' 'beanshell' \
                        'clucene' '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'

If you don't plan to be working on Java, you can remove hsqldb-java, apache-ant, junit, java-environment, beanshell from this list as LibreOffice mostly runs without it.

Slackware

./autogen.sh --without-java --disable-postgresql-sdbc --disable-gstreamer