LibreOffice compiled in OE
April 24, 2017 —
BarryK
My play with OpenEmbedded/Yocto is continuing, with success. For a very long time, I have dreamed of compiling OpenOffice, then LibreOffice, from source. It has been a couple of years since I last tried, but the few times that I had a go, just never got there. Too big and complex, too many failures. This was attempted on various flavours of Puppy and Quirky.
Now, having another go at being able to build a Quirky (or pup) from packages that I have compiled entirely from source, rather than relying on the effort of some other distro, I thought the cherry on the cake would be if I could actually get it to compile LibreOffice.
This blog post is to report success. Well, almost. There was a little fudge that I had to do to get Libreoffice to compile, then the "do_install" function failed. However, it is all there, and I can create a binary package manually.
I am communicating with Andreas, the maintainer of the LibreOffice recipe in OpenEmbedded, so hopefully the "fudge" can get fixed. For now, it would be good to document how I got this far. Remember, I am an almost absolute beginner with OE/Yocto, so there is room for improvement. However, documenting my steps might help others. So, here we go...
The host system
The host operating system has to be setup to be OE-friendly. There are online instructions for the major OS's, but I am running Quirky Linux 8.1.6, x86_64. This is a full installation, not one of those frugal thingies that you can do with Puppy Linux.
Quirky, being built with Ubuntu 16.04 Xenial Xerus DEBs, is pretty close to OK, just needs some tweaks, as documented here:
Running Quirky 8.1.6 x86_64
'devx' PET must be installed.
Needs 'setterm' utility, this is in the 'util-linux' DEB, download and extract
this utility, to /usr/bin:
http://packages.ubuntu.com/xenial/util-linux
check (ok in quirky):
must have "messagebus" and "shutdown" groups in /etc/group
(had to add this to quirky):
must have "crontab" group.
bitbake requires python 3.4.0 or later.
have installed "python3" from the PPM.
this symlink is needed:
# ln -s python3.5 /usr/bin/python3
<
Downloading OE
Previously, I had followed the getting-started page for Yocto, and checked out the "morty" release.
However, I ran into issues when trying to incorporate the "meta-office" layer (which has LibreOffice recipe).
So, I decided to do things at a bit differently. I downloaded from the OpenEmbedded git repository, like this:
create these folders, then cd into:
# cd /mnt/sda1/projects/oe/downloads-oe
# git clone git://git.openembedded.org/meta-openembedded meta-openembedded --depth 1
# git clone git://git.openembedded.org/openembedded-core openembedded-core --depth 1
# git clone git://github.com/schnitzeltony/meta-office.git meta-office --depth 1
# git clone git://git.openembedded.org/bitbake bitbake --depth 1
# cd ..
# mkdir oe-project
# cp -a downloads/openembedded-core/* oe-project/
# cp -a downloads/openembedded-core/.templateconf oe-project/
# cp -a -f --remove-destination downloads/meta-openembedded/* oe-project/
# cp -a downloads/meta-office oe-project/
# cp -a downloads/bitbake oe-project/
<
The "--depth 1" means that no history is being downloaded, so I am working with the very latest only, of master branch.
Folder "oe-project" is now ready for action!
There is just one little hack needed, before can get going. Quirky, like Puppy, we run as the root user. We could probably set this up for a non-root user, but leaving things as they are, a couple of lines need to be commented out:
edit meta/classes/sanity.bbclass, comment-out:
if 0 == os.getuid():
raise_sanity_error("Do not use Bitbake as root.", d)
Like this (keep the indentation):
# if 0 == os.getuid():
# raise_sanity_error("Do not use Bitbake as root.", d)
<
The only downside to doing this, at completion of the build a whole lot of warning messages will be spitted out on the terminal, containing the text "is owned by uid 0, which is the same as the user running bitbake". These are warnings only, not errors.
The next step is to setup the build environment. That will be the next blog post.
Tags: oe