How to compile LibreOffice in EasyOS
Yesterday I posted about dependencies of LibreOffice compiled in OpenEmbedded:
https://bkhome.org/news/202104/dependencies-for-libreoffice-compiled-in-oe.html
last night, compiled LO in latest running EasyOS. LO automatically
downloads any extra source packages that it needs. This is what it
downloaded:
0168229624cfac409e766913506961a8-ucpp-1.3.2.tar.gz
48d647fbd8ef8889e5a7f422c1bfda94-clucene-core-2.3.3.4.tar.gz
5ade6ae2a99bc1e9e57031ca88d36dad-hyphen-2.8.8.tar.gz
box2d-2.3.1.tar.gz
dtoa-20180411.tgz
f543e6e2d7275557a839a164941c0a86e5f2c3f2a0042bfc434c88c6dde9e140-opens___.ttf
Firebird-3.0.0.32483-0.tar.bz2
libepubgen-0.1.1.tar.xz
libnumbertext-1.0.7.tar.xz
liborcus-0.16.1.tar.bz2
libqxp-0.0.2.tar.xz
libstaroffice-0.0.7.tar.xz
libzmf-0.0.2.tar.xz
mariadb-connector-c-3.1.8-src.tar.gz
pdfium-4306.tar.bz2
QR-Code-generator-1.4.0.tar.gz
skia-m88-59bafeeaa7de9eb753e3778c414e01dcf013dcd8.tar.xz
...don't know why it downloaded 'hyphen', as have that as a system library.
I had manually downloaded this beforehand:
libreoffice-translations-7.1.2.2.tar.xz
Woof-CE has "petbuilds", scripts for compiling source packages and
creating PETs. I would like to introduce this into woofQ, so thinking
about automating the build of LO. This is how I did it, not yet a
complete PET-build, needs more fleshing out, but this is a start, just
notes documenting that I did:
# mkdir -p tarballsNote, when ran it, menu fonts are a bit small. Will need to find how to preset that a bit bigger.
# tar -xf libreoffice-7.1.2.2.tar.xz --no-overwrite-dir
# cd libreoffice-7.1.2.2
# ln -s ../../tarballs external/tarballs
copy the translation tarball into external/tarballs
# export LO_PREFIX=/usr
fixes (from linuxfromscratch):
# sed -e "/gzip -f/d" -e "s|.1.gz|.1|g" -i bin/distro-install-desktop-integration
# sed -e "/distro-install-file-lists/d" -i Makefile.in
easyos 2.6.3 has these compiled in oe:
hyphen libabw libcdr libcmis libe-book libetonyek libexttextcat libfreehand libgltf
liblangtag libmspub libmwaw libodfgen libpagemaker librevenge libvisio libwpd libwpg
libwps lpsolve mdds-1.2 mdds-1.5 mythes rasqal redland vigra
# ./configure --without-fonts --without-krb5 --build=x86_64-pc-linux-gnu --prefix=/usr \
--exec_prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/libexec \
--datadir=/usr/share --sysconfdir=/etc --sharedstatedir=/com --localstatedir=/var \
--libdir=/usr/lib --includedir=/usr/include --oldincludedir=/usr/include \
--infodir=/usr/share/info --mandir=/usr/share/man --without-doxygen \
--enable-release-build --with-parallelism=4 --without-java --disable-coinmp \
--with-tls=nss --without-galleries --disable-gstreamer-1-0 --disable-avahi \
--disable-odk --disable-postgresql-sdbc --with-system-libs --without-system-clucene \
--without-system-xmlsec --without-system-libepubgen --without-system-libqxp \
--without-system-libzmf --without-system-libstaroffice --without-system-odbc \
--without-system-orcus --without-system-libnumbertext --without-system-mariadb \
--without-system-firebird --without-system-qrcodegen --without-system-altlinuxhyph \
--with-lang="en-GB fr de nn nb" --with-locales="en fr de nn nb" --with-theme=colibre \
--disable-scripting-javascript --disable-scripting-beanshell --disable-lotuswordpro \
--disable-ccache --enable-cups --disable-vlc --disable-qt5 --disable-sdremote \
--disable-dbus --enable-python=no --disable-debug --disable-evolution2 \
--enable-pdfimport --enable-lpsolve --disable-report-builder --enable-firebird-sdbc \
--with-system-neon --without-system-box2d
edit Makefile:
# sed -i -e 's%^check-if-root:%check-if-root:\n\ncheck-if-rootXXX:%' Makefile
# make build-nocheck
At failure, just did this together, and it then continued to completion:
# mkdir icon-themes/export
# touch workdir/CustomTarget/postprocess/images/colibre_links.txt.tmp
# touch workdir/CustomTarget/postprocess/images/export_links.txt.tmp
# make build-nocheck
this does not work...
# make distro-pack-install
however, folder 'instdir' has everything we need, for target /usr/lib/libreoffice
for target /usr/share, look in folder 'sysui'
need to strip binaries in 'program' folder, used --strip-unneeded
usr/lib/libreoffice/share/config/images_colibre.zip looks ok, deleted images_export.zip
Automate the install:
D="../libreoffice-7.1.2.2-dunfell64"
[ -d $D ] && rm -rf ./${D}
mkdir $D
mkdir -p ${D}/usr/lib
cp -a instdir ${D}/usr/lib/libreoffice
rm -rf ${D}/usr/lib/libreoffice/sdk
rm -f ${D}/usr/lib/libreoffice/share/config/images_export.zip
mkdir -p ${D}/usr/share
cp -a sysui/desktop/appstream-appdata ${D}/usr/share/appdata
mkdir -p ${D}/usr/share/icons/hicolor
cp -a sysui/desktop/icons/hicolor/48x48 ${D}/usr/share/icons/hicolor/
cp -a sysui/desktop/menus ${D}/usr/share/applications
mkdir -p ${D}/usr/share/fonts/TTF
ln -s ../../../lib/libreoffice/share/fonts/truetype/opens___.ttf ${D}/usr/share/fonts/TTF/opens___.ttf
N="../libreoffice_NLS-7.1.2.2-dunfell64"
[ -d $N ] && rm -rf ./${N}
mkdir -p ${N}/usr/lib/libreoffice/program/resource
mkdir ${N}/usr/lib/libreoffice/share
mv -f ${D}/usr/lib/libreoffice/program/resource/* ${N}/usr/lib/libreoffice/program/resource/
mv -f ${N}/usr/lib/libreoffice/program/resource/en* ${D}/usr/lib/libreoffice/program/resource/
mv -f ${N}/usr/lib/libreoffice/program/resource/common ${D}/usr/lib/libreoffice/program/resource/
ln -snf ../../../../share/fonts/truetype/opens___.ttf ${D}/usr/lib/libreoffice/program/resource/common/fonts/opens___.ttf
mkdir ${N}/usr/lib/libreoffice/share/autocorr
mkdir ${N}/usr/lib/libreoffice/share/autotext
mkdir -p ${N}/usr/lib/libreoffice/share/registry/res
mv -f ${D}/usr/lib/libreoffice/share/autocorr/* ${N}/usr/lib/libreoffice/share/autocorr/
mv -f ${N}/usr/lib/libreoffice/share/autocorr/*_en* ${D}/usr/lib/libreoffice/share/autocorr/
mv -f ${D}/usr/lib/libreoffice/share/autotext/* ${N}/usr/lib/libreoffice/share/autotext/
mv -f ${N}/usr/lib/libreoffice/share/autotext/en* ${D}/usr/lib/libreoffice/share/autotext/
mv -f ${D}/usr/lib/libreoffice/share/registry/res/* ${N}/usr/lib/libreoffice/share/registry/res/
mv -f ${N}/usr/lib/libreoffice/share/registry/res/*_en* ${D}/usr/lib/libreoffice/share/registry/res/
sync
strip --strip-unneeded ${D}/usr/lib/libreoffice/program/*.so
strip --strip-unneeded ${D}/usr/lib/libreoffice/program/*.so.*
for A in gengal.bin oosplash opencltest regmerge regview soffice.bin ui-previewer uno.bin unopkg.bin uri-encode xpdfimport
do
strip --strip-unneeded ${D}/usr/lib/libreoffice/program/${A}
done
Compile fails at building the themes. This is not new, have had this always, when compile on EasyOS or Puppy. Never figured out why, just did that hack, but then "make DESTDIR=... distro-pack-install" fails. Actually, back in Pyro-series, did another hack that fixed the install, but this time just did a manual install, as shown above, which works fine.
The 'configure' options are for latest EasyOS Dunfell, and will have to be changed for a different pup. It has "--with-system-all", so tries to find all libraries in the host system. Configure will stop with error on first not found, then you have to append "--without-system-<pkg>". This testing of system library availability could be done automatically.
Takes awhile to compile. The PET is big, 105MB, gzipped. So many import/export filters that I would rather not have, but there doesn't seem to be any way to disable them when configuring.
Tags: easy