site  contact  subhomenews

Part 2, LibreOffice compiled in OE

April 23, 2017 — BarryK
I am documenting how I compiled LibreOffice in OpenEmbedded. Part 1 is the previous blog post:
http://bkhome.org/news/201704/libreoffice-compiled-in-oe.html

One thing about that previous post. I changed the number of parallel processes to one. That is because I have an overheating problem with my laptop, but you might want leave those out, and it will default to using all CPU cores.

Setup OE environment
As explained in the previous post, folder "oe-project" has been created. There needs to be a bit of preliminary work before the actual build can take place...
# cd oe-project

# source ./oe-init-build-env buildQ

...working dir is now in buildQ

buildQ/conf/bblayers.conf, add the layers that we want:
BBLAYERS ?= "
/mnt/sda1/projects/oe/oe-project/meta
/mnt/sda1/projects/oe/oe-project/meta-oe
/mnt/sda1/projects/oe/oe-project/meta-python
/mnt/sda1/projects/oe/oe-project/meta-office
"

confirm layer is picked up:
# bitbake-layers show-layers

keep the downloaded src pkgs outside:
# ln -s ../../downloads downloads

edit buildQ/conf/local.conf:
----------------------------
change these lines:
MACHINE ??= "qemux86-64"
PACKAGE_CLASSES ?= "package_deb"

append:
BB_NUMBER_THREADS = "1"
PARALLEL_MAKE = "-j 1"
BB_NUMBER_PARSE_THREADS = "1"

# in yocto, got an error when building initramfs, default maxsize is too small.
# INITRAMFS_MAXSIZE is set in meta/conf/bitbake.conf (= 131072 kb, 128MB).
# override here, 160MB:
INITRAMFS_MAXSIZE = "163840"

# yocto/poky/meta/conf/bitbake.conf has this line:
# DISTRO_FEATURES_BACKFILL = "pulseaudio sysvinit bluez5 gobject-introspection-data"
# ...this could be edited, or insert this into build/conf/local.conf:
#DISTRO_FEATURES_BACKFILL_CONSIDERED = "pulseaudio"

# want to add libreoffice. have already installed meta-office layer
DISTRO_FEATURES_append = " opengl"
IMAGE_INSTALL_append = " libreoffice"
<

I personally would prefer not to have 'pulseaudio'. Unfortunately, it is required to be there in some recipes in OE. Then there is the problem of the latest Firefox requiring it.
So, I have left 'pulseaudio' in the build for now.

Fix LibreOffice recipes
I am posting fixes to the recipes here, after failures occurred, so hopefully if someone follows my instructions, the build will just sail through.

The Libreoffice recipes specify two dependencies, 'clucene' and 'postgresql', however, these packages failed to build. So, I removed them from the LibreOffice recipes.
These are the two recipe files:

/mnt/sda1/projects/oe/oe-project/meta-office/recipes-libreoffice/libreoffice/libreoffice.bb,
libreoffice-native.bb

In libreoffice.bb I took out these two lines:
clucene-core
--with-system-clucene

In libreoffice-native.bb I took out:
clucene-core-native
--with-system-clucene

To get rid of postgresql, edit libreoffice.bb
remove postgresql line from here, in libreoffice.bb:
PACKAGECONFIG ??= "
gtk
mariadb
postgresql
"
insert this configure option:
--disable-postgresql-sdbc
and comment-out this line:
PACKAGECONFIG[postgresql] = "--enable-postgresql-sdbc --with-system-postgresql, --disable-postgresql-sdbc, postgresql"
<

Not there yet. Unpacking of libreoffice-native failed, reported that 'unzip' does not exist. Then, configuring, failed, reported something about 'neon' package not being in the repository.
To fix both of these:
have added these deps to libreoffice-native.bb:

unzip-native
neon-native
insert this configure option:
--with-system-neon

added dep to libreoffice.bb:
unzip
<

Start the build
Having already run that "source ./oe-init-build-env buildQ" command, "pwd" will show that you are now in the "buildQ" folder, and everything is setup ready to build. Do this:

# bitbake core-image-sato-sdk

If you get a failure somewhere, it may not be a show-stopper, and you can keep going with:

# bitbake --continue core-image-sato-sdk

Be prepared to wait a very long time!

Comments

I have posted a bug report here:

https://github.com/schnitzeltony/meta-office/issues

This is a failure with packaging the 'glm' package.

I did have one other failure, will report that later.

The reason is that I can then have MACHINE = "generics86-64" in local.conf, which is a more useful distro build than the "qemux86-64" that is available in OE.

Download Yocto
# git clone git://git.yoctoproject.org/meta-yocto meta-yocto --depth 1

Install Yocto
# cp -a downloads-oe/meta-yocto/* oe-project/
...note, leaves behind .templateconf, which is different from same name in target -- does that matter?
...yes, copy .templateconf
...note, also edit buildQ/conf/templateconf.cfg: change "meta/conf" to "meta-poky/conf"

Edit bblayers.conf
BBLAYERS ?= " 
/mnt/sda1/projects/oe/oe-project/meta
/mnt/sda1/projects/yocto/poky/meta-poky
/mnt/sda1/projects/yocto/poky/meta-yocto-bsp
/mnt/sda1/projects/oe/oe-project/meta-oe
/mnt/sda1/projects/oe/oe-project/meta-python
/mnt/sda1/projects/oe/oe-project/meta-networking
/mnt/sda1/projects/oe/oe-project/meta-webserver
/mnt/sda1/projects/oe/oe-project/meta-gnome
/mnt/sda1/projects/oe/oe-project/meta-multimedia
/mnt/sda1/projects/oe/oe-project/meta-browser
/mnt/sda1/projects/oe/oe-project/meta-office
"
<

Edit local.conf
MACHINE ??= "genericx86-64"

DISTRO_FEATURES_append = " opengl"
IMAGE_INSTALL_append = " streamripper pinpoint dhcpcd pure-ftpd pptp-linux rp-pppoe mtr hiawatha openbox gedit evince abiword gparted epiphany gphoto2 gimp firefox libreoffice"
LICENSE_FLAGS_WHITELIST += "commercial"
<

Edit libreoffice recipes
See here:
https://github.com/schnitzeltony/meta-office/issues/4
Also, remove 'postgresql' dependency from the recipes, as it fails to compile.

Build
# bitbake image-core-sato-sdk


I did a "du -m" on that tmp folder, and was alarmed. It came to 121GB!!!

So, you need a partition with heaps of space.

# git clone git://github.com/OSSystems/meta-browser.git meta-browser --depth 1

These files are required, but are missing:
meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.8.bbappend
meta/recipes-kernel/linux/linux-yocto_4.8.bb


I copied these files out of the 'morty' checkout, when I had downloaded yocto awhile back, following the yocto getting-started page:
http://www.yoctoproject.org/docs/2.2.1/yocto-project-qs/yocto-project-qs.html

Tags: oe