Step by step building guide on Linux

From Apache OpenOffice Wiki
Jump to: navigation, search


This page is intended as a collection of simple step-by-step recipes to build Apache OpenOffice from source code on Linux. A more thorough explanation of what the individual steps do and why they are necessary can be found in the building guide.

This version limits itself to either relatively recent versions of operating systems, or systems in which the OpenOffice PMC are activity using. A historical version of the step-by-step instructions for different platforms can be found here.

Preparation of the development system

Releases are built using CentOS and Fedora virtual machines. However, any modern distribution should be able to build Apache OpenOffice.

This chapter lists some Linux distributions the developers have experience with. Select your distribution of choice and follow the corresponding chapter. When your system is ready, step to the next chapter.

CentOS 5 for AOO 4.1.x

CentOS 5 is our reference environment for build through the 4.1.x series. As it is a very old environment, it is not recommended to use it for your first build. But is important to document how to build on CentOS 5 since this is where the release through 4.1.x are built.

A 32-bit VM is used to build 32-bit releases. A 64-bit VM is used to build 64-bit releases.

Setup a VM

KVM given here as example:

  • for the 64-bit distribution:
 $ wget -O /tmp/CentOS-5-64.iso http://mirror.nsc.liu.se/centos-store/5.11/isos/x86_64/CentOS-5.11-x86_64-netinstall.iso
 $ fallocate -l 61440M /vms/centos5_64.img
 $ sudo virt-install --boot cdrom --name centos5_64 --memory 8192 -f /vms/centos5_64.img --cdrom /tmp/CentOS-5-64.iso
  • for the 32-bit distribution:
 $ wget -O /tmp/CentOS-5-32.iso http://mirror.nsc.liu.se/centos-store/5.11/isos/i386/CentOS-5.11-i386-netinstall.iso
 $ fallocate -l 61440M /vms/centos5_32.img
 $ sudo virt-install --boot cdrom --name centos5_32 --memory 8192 -f /vms/centos5_32.img --cdrom /tmp/CentOS-5-32.iso

Our community builds are actually done on a VMware Fusion VM. Build times are mostly sensitive to the number of CPUs and allocated RAM; our setup is a 8 core VM with 24GB of memory.

Setup repositories and packages

EPEL is needed for dpkg (to build DEBs):

 $ wget http://archives.fedoraproject.org/pub/archive/epel/5/i386/epel-release-5-4.noarch.rpm
 $ sudo rpm -ivh epel-release-5-4.noarch.rpm
 $ sudo yum update -y

Now you can install all dependencies:

 $ sudo yum install \
       gcc \
       expat-devel \
       openssl-devel \
       autoconf \
       gcc-c++ \
       cups-devel \
       pam-devel \
       java-1.6.0-openjdk-devel \
       rpm-build \
       dpkg \
       fakeroot \
       gperf \
       freetype-devel \
       libX11-devel \
       libXt-devel \
       fontconfig-devel \
       libXrandr-devel \
       bison \
       flex \
       GConf2-devel \
       gnome-vfs2-devel \
       gtk2-devel \
       gstreamer-devel \
       gstreamer-plugins-base-devel \
       mesa-libGLU-devel \
       git \
       ccache

Configure ccache:

 $ ccache -M 2G

This leaves out Ant and Perl.

Download Ant

Ant 1.7.1 is now available in the CentOS repositories:

 $ sudo yum install ant17 ant17-apache-regexp

However, this will still cause configure to fail, so a manual download is needed. Ant will live in ~/ant and we need to download it manually.

$ cd
$ wget http://mirrors.nxnethosting.com/apache//ant/binaries/apache-ant-1.9.15-bin.tar.bz2
$ tar xvf apache-ant-1.9.15-bin.tar.bz2
$ ln -s apache-ant-1.9.15 ant

Install OpenSSL

The OpenSSL version included with CentOs does not support the TLS versions required for today's https connections.

As root:

# cd /usr/local/src
# wget https://www.openssl.org/source/openssl-1.0.2a.tar.gz
# tar xzf openssl-1.0.2a.tar.gz
# cd openssl-1.0.2a
# ./config -fpic shared; make
# make install
# echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
# ldconfig

Install Perl modules

We can no longer use the system Perl and standard packages on CentOS 5, which are too old, so we will need to build newer versions.

Be root, then:

 # cd /usr/local/src
 # wget http://www.cpan.org/src/5.0/perl-5.14.4.tar.gz
 # tar xvf perl-5.14.4.tar.gz
 # cd perl-5.14.4
 # export OPENSSL_PREFIX=/usr/local/ssl
 # ./configure.gnu ; make
 # make install
 # /usr/local/bin/perl -MCPAN -e shell
      [ reply "yes" to all questions to carry out cpan's autoconfiguration ]
  cpan[1]> force install Archive::Zip
  cpan[2]> install XML::Parser LWP::UserAgent Digest::SHA Digest::MD5 LWP::Protocol::https
  cpan[3]> exit
 #

Make sure that /usr/local/bin/perl is in your $PATH and is used before any other versions.

The next step will be obtaining the source code.

CentOS 7 and Fedora 19 for AOO 4.2.x and later

Although CentOS 5 was our reference environment for build through the 4.1.x series, as it is a very old environment, it is not a viable system to use for building AOO 4.2.x and later, mainly due to some dependencies no longer being available for CentOS5 (such as gstreamer-1.x). Not to say that you can't do so, but we have switched to CentOS 7 for our reference build of 64-bit releases. Other than that, the actual setups and builds for both OSs are strikingly similar.

32-bit releases are built on Fedora 19 VMs. Refer to this paragraph for more information

Setup a VM

We have had good results installing CentOS 7 x86_64 under both VirtualBox and VMware. Our community builds are actually done on a VMware Fusion VM. Build times are mostly sensitive to the number of CPUs and allocated RAM; our setup is a 8 core VM with 24GB of memory. We recommend CentOS 7.5

Setup repositories and packages

EPEL is needed for dpkg (to build DEBs) and for ccache (to speed up repeated builds, optional but recommended):

 $ sudo yum install epel-release
 $ sudo yum update -y

Now you can install all dependencies:

 $ sudo yum install \
       gcc \
       expat-devel \
       openssl-devel \
       autoconf \
       gcc-c++ \
       cups-devel \
       pam-devel \
       java-1.7.0-openjdk-devel \
       rpm-build \
       dpkg \
       fakeroot \
       gperf \
       freetype-devel \
       libX11-devel \
       libXt-devel \
       fontconfig-devel \
       libXrandr-devel \
       bison \
       flex \
       GConf2-devel \
       gnome-vfs2-devel \
       gtk2-devel \
       gstreamer-devel \
       gstreamer-plugins-base-devel \
       gstreamer1-devel \
       gstreamer1-plugins-base-devel \
       mesa-libGLU-devel \
       wget \
       subversion \
       ccache \
       glib2-devel \
       dbus-glib-devel \
       perl \
       ORBit2-devel

Configure ccache to use at least 2 GBytes:

 $ ccache -M 2G

This leaves out Ant and Perl.

Download Ant

The version of Ant installed via yum can cause configure to fail, so a manual download is needed. Ant will live in ~/ant and we need to download it manually.

$ cd
$ wget http://mirrors.nxnethosting.com/apache//ant/binaries/apache-ant-1.9.15-bin.tar.bz2
$ tar xvf apache-ant-1.9.15-bin.tar.bz2
$ ln -s apache-ant-1.9.15 ant

Install Perl modules

We can use the system Perl and standard packages on CentOS 6, see https://bz.apache.org/ooo/show_bug.cgi?id=127120

 $ sudo yum install \
       cpan \
       perl-libwww-perl \
       perl-Archive-Zip \
       perl-Digest-SHA \
       perl-XML-Parser \
       perl-Crypt-SSLeay \
       perl-Env \
       perl-IPC-Cmd \
       perl-LWP-Protocol-https
 $ sudo cpan File::Path

Build and Packaging tools

Download, configure, build and install dmake and epm

$ wget https://github.com/jimjag/dmake/archive/v4.13.1/dmake-4.13.1.tar.gz
$ # extract the archive, then
$ cd dmake-4.13.1
$ ./configure --prefix=/usr/local; make install


$ wget https://github.com/jimjag/epm/archive/v5.0.0/epm-5.0.0.tar.gz
$ # extract the archive, then
$ cd epm-5.0.0
$ ./configure --prefix=/usr/local ; make install

Note: if you get Error: ERROR: More than one new package in directory at the end of the build, you may have to use an older EPM. In that case, just add --with-epm-url=http://sourceforge.net/projects/oooextras.mirror/files/epm-3.7.tar.gz to the options you pass to ./configure.

The next step will be obtaining the source code.

32 bit hints

Fedora19

Fedora19 is the Fedora release on which RHEL7 (and thus CentOS7) is based. The 32bit version of Fedora19 is much more stable as a build platform for AOO for 32bit Linux platforms, and is compatible with CentOS7.

The community builds of AOO 4.2.x and later are built on Fedora19.

CentOS7

Alternatively, you can also use CentOS 7.

There is not a EPEL release for CentOS 7 32bit, so you'll need to download, build and install dpkg and GNUtar directly. You may also need fakeroot (or pseudo):

$ wget ftp://ftp.de.debian.org//debian/pool/main/d/dpkg/dpkg_1.19.3.tar.xz
$ wget http://ftp.gnu.org/gnu/tar/tar-1.30.tar.gz

Ubuntu 16.04

Editing.png This page is in a DRAFT stage.

The process to build Apache OpenOffice is currently undergoing experimentation. As steps are firmed up they will be added here.

  • Updated Install requirements. OpenJDK 6 or 7 is not available for Ubuntu 16.04:
 sudo apt-get install openjdk-8-jdk fakeroot

Draft: With Version 4.2 we start to update the build enviroment to Ubuntu 18.04 and Debian 9. You can follow AOOBauen

Ubuntu 18.04

Editing.png This page is in a DRAFT stage.

The process to build Apache OpenOffice is currently undergoing experimentation. As steps are firmed up they will be added here.

Ensure that the required package repositories are activated:

 $ sudo add-apt-repository universe
 $ sudo apt update

Install build dependencies:

 $ sudo apt-get install g++ gcc bison flex libarchive-zip-perl libcups2-dev libpam0g-dev \
       gperf libfreetype6-dev libxaw7-dev libfontconfig1-dev libxrandr-dev patch \
       libgconf2-dev libgnomevfs2-dev ant libgtk2.0-dev junit junit4 libidl-dev liborbit2-dev \
       openjdk-8-jdk liblablgl-ocaml-dev git

OpenSUSE Leap

Editing.png This page is in a DRAFT stage.

Install build dependencies:

$ sudo zypper in gcc libexpat-devel libopenssl-devel autoconf gcc-c++ cups-devel pam-devel \
      java-1_8_0-openjdk-devel rpm-build gperf freetype-devel libX11-devel libXt-devel \
      fontconfig-devel libXrandr-devel bison flex gconf2-devel gnome-vfs2-devel gtk2-devel \
      gstreamer-devel gstreamer-plugins-base-devel Mesa-devel git wget glib2-devel \
      dbus-1-glib-devel perl orbit2-devel gdk-pixbuf-xlib-devel glu-devel ant \
      libXinerama-devel libnsl-devel

The AOO41X branch does not compile as-is. Two commits must be cherry-picked from trunk:

$ git cherry-pick -x 722adfc9d670a35708718ff1651ed0e282febbd7
$ git cherry-pick -x b63eebb52dbe154d19c050aa3bfc61207daf1ef4

Obtain the source code

This chapter lists the commands for cloning the Apache OpenOffice Git repository. For information about the possible ways of obtaining the source code, refer to the Building Guide.

Create folder for source (this is a suggested location, replace <yourusername> with your user name)

 $ sudo mkdir /source
 $ sudo chown <yourusername> /source
 $ cd /source
 $ git clone https://gitbox.apache.org/repos/asf/openoffice.git
 $ cd openoffice/
 $ git checkout <branch>

Please replace <branch> with the branch you want to compile e.g. AOO419 or AOO42X

Configure

The scripts at https://svn.apache.org/viewvc/openoffice/devtools/build-scripts/ are used to prepare the release builds.

Personal tools