site  contact  subhomenews

How to compile LibreOffice in EasyOS

April 12, 2021 — BarryK

Yesterday I posted about dependencies of LibreOffice compiled in OpenEmbedded:

last night, compiled LO in latest running EasyOS. LO automatically downloads any extra source packages that it needs. This is what it downloaded:


...don't know why it downloaded 'hyphen', as have that as a system library.

I had manually downloaded this beforehand:


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 tarballs
# tar -xf libreoffice- --no-overwrite-dir
# cd libreoffice-
# 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

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/ looks ok, deleted

Automate the install:

[ -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/

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

[ -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/

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
strip --strip-unneeded ${D}/usr/lib/libreoffice/program/${A}
Note, when ran it, menu fonts are a bit small. Will need to find how to preset that a bit bigger.

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