Having decent tools is necessary for an operating system to be useful, and one of the basics for desktop use is an office suite -
LibreOffice being the primary candidate.
Unfortunately, there aren't prebuilt binaries for any of the Solaris or illumos distros. So I've been trying to build LibreOffice from source for a while. Finally, I have a working build on
Tribblix.
This is what I did. Hopefully it will be useful to other distros. This is just a straight dump of my notes.
First, you'll need java (the jdk), and the perl Archive::Zip module. You'll need boost, and harfbuzz with the icu extensions. Plus curl, hunspell, cairo, poppler, neon.
Then you'll need to build (look on
this page for links to some of this stuff):
- cppunit-1.13.2
- librevenge-0.0.2
- libwpd-0.10.0
- libwpg-0.3.0
- libmspub-0.1.2
- libwps-0.3.1
- mdds_0.11.2
- libixion-0.7.0
- liborcus-0.7.0
- libvisio-0.1.1
If you don't tell it otherwise, LibreOffice will download these and try to build them itself. And generally these have problems building cleanly, which it's fairly easy to fix while building them in isolation, but would be well nigh impossible when they're buried deep inside the LibreOffice build system
For librevenge, pass
--disable-werror to
configure.
For libmspub, replace the call to
pow() in
src/lib/MSPUBMetaData.cpp with
std::pow().
For libmspub, remove zlib from the installed pc file (Tribblix, and some of the other illumos other distros, don't supply a pkgconfig file for zlib).
For liborcus, run the following against all the Makefiles that the configure step generates:
gsed -i 's:-DMDDS_HASH_CONTAINER_BOOST:-pthreads -DMDDS_HASH_CONTAINER_BOOST:'
For mdds, make sure you have a PATH that has the gnu install ahead of the system install program when running make install.
For ixion, it's a bit more involved. You need some way of getting
-pthreads past configure *and* make. For configure, I used:
env boost_cv_pthread_flag=-pthreads CFLAGS="-O -pthreads" CPPFLAGS="-pthreads" CXXFLAGS="-pthreads" configure ...
and for make:
gmake MDDS_CFLAGS=-pthreads
For orcus, it looks to pkgconfig to find zlib, so you'll need to prevent that:
env ZLIB_CFLAGS="-I/usr/include" ZLIB_LIBS="-lz" configure ...
For libvisio, replace the call to
pow() in
src/lib/VSDMetaData.cpp with
std::pow().
For libvisio, remove zlib and libxml-2.0 from the installed pc file.
If you want to run a parallel make, don't use gmake 3.81. Version 4.1 is fine.
With all those installed you can move on to LibreOffice.
Unpack the main tarball.
chmod a+x bin/unpack-sources
mkdir -p external/tarballs
and then symlink or copy the other tarballs (help, translations, dictionaries) into external/tarballs (otherwise, it'll try downloading them again).
Download and run
this script to patch the builtin version of glew.
Edit the following files:
- svx/Executable_gengal.mk
- sw/Executable_tiledrendering.mk
- vcl/Executable_ui-previewer.mk
- desktop/Library_sofficeapp.mk
- vcl/Library_vcl.mk
And replace "LINUX" with "SOLARIS". That part of the makefiles is needed on all unix-like systems, not just Linux.
In the file
sc/source/core/tool/interpr1.cxx
replace the call to
pow() on line 3160 with
std::pow()
In the file
sal/qa/inc/valueequal.hxx
replace the call to
pow() on line 87 with
std::pow()
In the file
include/vcl/window.hxx
You'll need to
#undef TRANSPARENT before it's used (otherwise, it picks up a rogue definition from the system).
And you'll need to create a compilation symlink:
mkdir -p instdir/program
ln -s libGLEW.so.1.10 instdir/program/libGLEW.so
This is the configure command I used:
env PATH=/usr/gnu/bin:$PATH \
./configure --prefix=/usr/versions/libreoffice-44 \
--with-system-hunspell \
--with-system-curl \
--with-system-libpng \
--with-system-clucene=no \
--with-system-libxml \
--with-system-jpeg=no \
--with-system-cairo \
--with-system-harfbuzz \
--with-gnu-cp=/usr/gnu/bin/cp \
--with-gnu-patch=/usr/gnu/bin/patch \
--disable-gconf \
--without-doxygen \
--with-system-openssl \
--with-system-nss \
--disable-python \
--with-system-expat \
--with-system-zlib \
--with-system-poppler \
--disable-postgresql-sdbc \
--with-system-icu \
--with-system-neon \
--disable-odk \
--disable-firebird-sdbc \
--without-junit \
--disable-gio \
--with-jdk-home=/usr/jdk/latest \
--disable-gltf \
--with-system-libwps \
--with-system-libwpg \
--with-system-libwpd \
--with-system-libmspub \
--with-system-librevenge \
--with-system-orcus \
--with-system-mdds \
--with-system-libvisio \
--with-help \
--with-vendor="Tribblix" \
--enable-release-build=yes \
--with-parallelism=8
and then to make:
env LD_LIBRARY_PATH=/usr/lib/mps:`pwd`/instdir/ure/lib:`pwd`/instdir/sdk/lib:`pwd`/instdir/program \
PATH=/usr/gnu/bin:$PATH \
/usr/gnu/bin/make -k build
(Using 'make build' is supposed to avoid the checks, many of which fail. You'll definitely need to run 'make -k' with a parallel build, because otherwise some of the test failures will stop the build before all the other parallel parts of the build have finished.)
Then create symlinks for all the .so files in /usr/lib/mps in instdir/program, and instdir/program/soffice should start.