Difference between revisions of "Ubuntu Build Instructions"

From Apache OpenOffice Wiki
Jump to: navigation, search
(addendum for hardy)
 
(44 intermediate revisions by 12 users not shown)
Line 1: Line 1:
This tutorial will assume a stock [http://www.ubuntu.com/download Ubuntu] 5.10 (Breezy) system as a starting point.
+
{{Note|Please add only Ubuntu-specifics here! Use the information on the [[Development/OpenOffice.org Building Guide/Building on Linux|Building Guide]] and only fall back to this document if you need help with Ubuntu-specifics (like package names).}}
(See below for Hardy instructions.)
+
  
===Obtaining ooo-build===
+
__TOC__
One may obtain the stable 2.0.2 version of <code>ooo-build</code> via CVS with the following commands:
+
== Preparing to build Apache OpenOffice on Ubuntu ==
 +
 
 +
To get and build Apache OpenOffice you need some packages. You can get them with:
 
<pre>
 
<pre>
export CVSROOT=':pserver:anonymous@anoncvs.gnome.org:/cvs/gnome'
+
sudo apt-get install subversion g++ gcc bison flex libarchive-zip-perl libcups2-dev libpam0g-dev \
cvs login
+
gperf libfreetype6-dev libxaw7-dev libfontconfig1-dev libxrandr-dev patch \
cvs -z3 checkout -P ooo-build
+
libgconf2-dev libgnomevfs2-dev ant libgtk2.0-dev junit junit4 libidl-dev liborbit2-dev</pre>
cvs update -Pd -r ooo-build-2-0-2
+
</pre>
+
You should then enter the <code>ooo-build</code> directory and run <code>./autogen.sh --with-distro=Ubuntu</code>. Most likely you'll also want to add the <code>--disable-kde</code> flag (unless you're using [http://www.kubuntu.org/ Kubuntu]).
+
  
===Additional Required Packages===
+
If you want to use the system provided libraries instead of building them for yourself you should get their development packages by running:
Packages may be obtained as follows:
+
  
  sudo apt-get install ''package_name [additional_package(s)]''
+
<pre>
 +
sudo apt-get install python-dev ccache libgraphite-dev \
 +
libwpd-dev libxslt-dev libhunspell-dev libaltlinuxhyph-dev
 +
</pre>
  
Alternatively, you may use the Synaptic Package Manager to install missing packages.
+
The java package depends on your Ubuntu version:
  
To obtain the source, you need:
+
For Ubuntu 9.10 ("Karmic Koala") and 10.04 ("Lucid Lynx") you must activate the "ubuntu lucid partner" archive in the software sources and run
*cvs
+
 
+
To complete <code>autogen.sh</code>, you need:
+
*automake1.9
+
*build-essential
+
*libpam0g-dev
+
*libpng12-dev
+
*flex
+
*bison
+
*libgtk2.0-dev
+
 
+
For <code>make</code> to finish its configuration stage, you need:
+
*tcsh
+
*libcupsys2-dev
+
*java-gcj-compat-dev
+
*libarchive-zip-perl
+
*libjpeg62-dev
+
*libxml2-dev
+
*python-dev
+
*libdb4.3-dev
+
*libdb4.3-java-dev
+
*libcurl3-dev (on 7.10/gutsy: libcurl4-gnutls-dev)
+
*unixodbc-dev
+
*libldap2-dev
+
*mozilla-dev
+
*libnss-dev
+
*libsane-dev
+
*libxaw-headers
+
*libaudio-dev
+
*libsndfile1-dev
+
*libneon24-dev
+
*libgnomevfs2-dev
+
*kdebase-dev (KDE only?)
+
*libstartup-notification0-dev
+
*ant
+
*libdbus-glib-1-dev (Ubuntu version is not high enough! 0.36.2 < 0.60)
+
*firefox-dev (if --with-firefox used)
+
*libxul-dev (if --with-firefox used)
+
*libgstreamer0.10-dev
+
*libgstreamer-plugins-base0.10-dev
+
*gperf
+
*libxslt1-dev
+
 
+
Far into the ''main build commencing'' section, you'll realize you need these:
+
 
+
*libbonobo2-dev
+
*libxaw7-dev
+
 
+
===Necessary ./configure Flags===
+
*'''--disable-gtk''' &mdash; This has to be disabled, otherwise <code>make</code> will get hung up on the dbus-glib-1 version 0.60 requirement. The highest version of that package available for Ubuntu is 0.36.2.
+
 
+
===Failed patches===
+
[[Talk:Ubuntu_Build_Instructions#Failed_Patches|Some of the patches]] listed in <code>ooo-build/patches/src680/apply</code> may not apply successfully.  You can try to comment them out in the <code>apply</code> file, but this is an experimental solution...
+
 
+
===Tips===
+
A shell script like the one below will alert your attention upon completion of the quite lengthy build process.  Run it after <code>./download</code> completes in place of <code>make</code>.
+
 
<pre>
 
<pre>
#!/bin/bash
+
sudo apt-get install sun-java6-jdk
echo "Starting 'make' wrapper..."
+
cd ~/ooo-build
+
/usr/bin/time --quiet -f %E make
+
echo "Compilation finished."
+
mplayer -really-quiet ~/Music/My_Music_File.mp3
+
 
</pre>
 
</pre>
  
For the purpose of this tutorial, save the file as <code>make_wrapper.sh</code>. To make it executable, type <code>chmod 744 make_wrapper.sh</code>.
+
For Ubuntu 11.04 and up please run
 
+
===Development Environment Preparation Script===
+
'''Note:''' User interaction is required first to enter a password for apt-get, and again much later to hit Enter when prompted for a CVS password.
+
 
<pre>
 
<pre>
#!/bin/bash
+
sudo apt-get install openjdk-6-jdk
echo "Starting Ubuntu ooo-build preparations..."
+
 
+
sudo apt-get -y install cvs automake1.9 build-essential libpam0g-dev libpng12-dev flex bison libgtk2.0-dev \
+
tcsh libcupsys2-dev java-gcj-compat-dev libarchive-zip-perl libjpeg62-dev libxml2-dev python-dev libdb4.3-dev \
+
libdb4.3-java-dev libcurl3-dev unixodbc-dev libldap2-dev mozilla-dev libnss-dev libsane-dev libxaw-headers \
+
libaudio-dev libsndfile1-dev libneon24-dev libgnomevfs2-dev libstartup-notification0-dev ant
+
 
+
export CVSROOT=':pserver:anonymous@anoncvs.gnome.org:/cvs/gnome'
+
cvs login
+
cvs -z3 co -P ooo-build
+
cvs up -Pd -r ooo-build-2-0-2
+
 
+
echo "Preparations complete."
+
 
+
cd ~/ooo-build
+
./autogen.sh --with-distro=Ubuntu --disable-kde
+
./download
+
 
+
#Now comment out failing patch:
+
cp patches/src680/apply patches/src680/apply~
+
sed 's/^ubuntu-dictionary\.diff/#&/' <patches/src680/apply~ >patches/src680/apply
+
rm patches/src680/apply~
+
 
+
make
+
#Or if you want an audible alert,
+
#~/make_wrapper.sh
+
 
</pre>
 
</pre>
  
 
+
To make sure that all packages are installed you could just simply run command:
==Hardy==
+
For Hardy, the list of recommended packages is different.  Here's the command that
+
got one first-timer through the many configure errors:
+
 
<pre>
 
<pre>
aptitude install \
+
sudo apt-get build-dep openoffice.org
ant ant-optional automake1.9 bison build-essential cvs \
+
dmake flex gcj gperf java-gcj-compat-dev kdebase-dev \
+
libagg-dev libaltlinuxhyph-dev libarchive-zip-perl \
+
libaudio-dev libboost-dev libcupsys2-dev \
+
libcurl4-openssl-dev libdb4.6-dev libdb4.6-java libgcj7-dev \
+
libgnomevfs2-dev libgstreamer-plugins-base0.10-dev \
+
libgstreamer0.10-dev libgtk2.0-dev libhunspell-dev \
+
libjpeg62-dev libldap2-dev libmono-dev libneon26-dev \
+
libnss3-dev libpam0g-dev libpam-dev libpng12-dev \
+
libportaudio-dev libpq-dev libsablot0-dev \
+
libsane-dev libsndfile1-dev libsoap-lite-perl \
+
libstartup-notification0-dev libstlport5.1-dev libwpd8-dev \
+
libxaw-headers libxml2-dev libxul-dev mingw32 mozilla-dev \
+
myspell-tools python-dev tcsh unixodbc-dev
+
 
</pre>
 
</pre>
  
 +
== Testing the Prerequisites ==
  
The commandline to configure is also a bit different, e.g.
+
First download the source code:
 
<pre>
 
<pre>
./configure --with-distro=UbuntuHardy --with-system-mozilla=xulrunner
+
svn co https://svn.apache.org/repos/asf/openoffice/trunk aoo
 
</pre>
 
</pre>
The --with-system-mozilla=xulrunner option seems to fix the configure error
+
 
 +
Then the configure step will help you to find out if all is there:
 
<pre>
 
<pre>
checking for libxul-xpcom ... Package libxul-xpcom was not found in the pkg-config search path.
+
cd aoo/main
 +
autoconf
 +
./configure --disable-mozilla --with-junit="/usr/share/java/junit4.jar"
 
</pre>
 
</pre>
This may be related to https://bugs.launchpad.net/ubuntu/hardy/+source/openoffice.org-l10n/+bug/194551
 
  
==See also==
+
For other options regarding mozilla code please see [[Documentation/Building_Guide/Building_on_Linux#create_prebuilt_mozilla|here]].
*[[Building]]
+
 
*[[Debug Build Problems]]
+
== Building Apache OpenOffice ==
*[http://www.go-oo.org OpenOffice.org Hackers Pages]
+
  
 +
Now that the Ubuntu specific prerequisites are met please follow the general '''[[Documentation/Building_Guide_AOO|Building Guide]]''' to continue.
 +
You might find the page [[Debug Build Problems]] interesting too.
  
 
[[Category: Distribution-Specific Build Instructions]]
 
[[Category: Distribution-Specific Build Instructions]]

Latest revision as of 20:00, 1 July 2018

Documentation note.png Please add only Ubuntu-specifics here! Use the information on the Building Guide and only fall back to this document if you need help with Ubuntu-specifics (like package names).

Preparing to build Apache OpenOffice on Ubuntu

To get and build Apache OpenOffice you need some packages. You can get them with:

sudo apt-get install subversion 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

If you want to use the system provided libraries instead of building them for yourself you should get their development packages by running:

sudo apt-get install python-dev ccache libgraphite-dev \
libwpd-dev libxslt-dev libhunspell-dev libaltlinuxhyph-dev

The java package depends on your Ubuntu version:

For Ubuntu 9.10 ("Karmic Koala") and 10.04 ("Lucid Lynx") you must activate the "ubuntu lucid partner" archive in the software sources and run

sudo apt-get install sun-java6-jdk

For Ubuntu 11.04 and up please run

sudo apt-get install openjdk-6-jdk

To make sure that all packages are installed you could just simply run command:

sudo apt-get build-dep openoffice.org

Testing the Prerequisites

First download the source code:

svn co https://svn.apache.org/repos/asf/openoffice/trunk aoo

Then the configure step will help you to find out if all is there:

cd aoo/main
autoconf
./configure --disable-mozilla --with-junit="/usr/share/java/junit4.jar"

For other options regarding mozilla code please see here.

Building Apache OpenOffice

Now that the Ubuntu specific prerequisites are met please follow the general Building Guide to continue. You might find the page Debug Build Problems interesting too.

Personal tools