posted on: 2013-03-31 19:45:39
Gnome 3.8 came out and somebody said it would be easy to build using jhbuild.

>Oh the days of going down the dependency rabbit hole. You need package x-y which depends on package y-z which depends on ... Then came the package managers and that went away. You just apt-get, yum or emerge what ever and your package is finished.

Sometimes though you want the cutting edge junk, such as Gnome 3.8. In the following post I am trying to compile some notes to help overcome many of the problems I faced while building Gnome.

One thing that is very important, is how massive of a system Gnome is. It is essentially a whole desktop environment. On top of that I am running Gnome 3.6, so it is a bit intimidating to build a library and desktop environment that conflicts with the one I use for day to day use.

To build Gnome 3.8 I used the program jhbuild and followed the tutorial found at JHBuildIntroduction.

It is easy enough to get jhbuild and install it. One of the greatest aspects of it is probably that it helps setup your environment for running Gnome components. I have completely installed Gnome 3.8 in another directory parallel to working version of Gnome. This is not a good way to get an installed version of Gnome 3.8, more of a way to get to a building/testing environment.

From here on out are my notes are about building Gnome 3.8.

Make sure to get the sanity check to work first.

jhbuild sanitycheck

I missed the DocBook xsl file:

Could not find DocBook XSL Stylesheets in XML catalog

This is not a trivial issue, but it is easy to solve. To get this one you need to install the package docbook-xsl. Do it early. I did not do it early.

I also had to install apt-file then I was able to run;

jhbuild sysdeps --install

which went through and installed necessary -dev files for many packages.

One of the problems, probably caused by using an old LTS Ubuntu, there are old packages in the repos that have to be replaced, for exampl libnl. Some times the error is incorrect. libtasn1 was said to be not found, but actually it was just outdated. Downloaded a new version, compiled and installed.

A strange problem is the smb-client. Ubuntu only has the smb-client-raw.pc. I downloaded the samba source package and compiled and installed that to /usr/local. For some strange reason I had to manually move the package config files over. Possibly a configuration option I left out.

There are packages that seemingly have forgotten their package config files. Such as icu. I downloaded the source built and installed a new version of this one so that I could get the package config files.

So that was all necessary to get the sanity check to work. Then comes building and compiling the actual software.

jhbuild build

After that everything starts to work: git clones, autotool configs, make compiles, and on to the next module. The first error involves is going to be missing programs. They might not actually be missing so

a good tool to check if something is missing or just miss represented is the jhbuild run tool. For example:

jhbuild run pkg-config --print-provides libtasn1

This will show which version of libtasn1 is being found by the package config jhbuild is using. Most likely you will have missing package config directories that you need to and to your PKG_CONFIG_PATH.

For some reason when I used a .jhbuildrc file the pkg_config_path was not being updated as I would expect. When I switched to using ~/.config/jhbuildrc then I could use the technique described here: JHBuildIssues which uses directory as it should. For example one directory I add is:

addpath('PKG_CONFIG_PATH','/usr/lib/x86_64-linux-gnu/pkgconfig')

Turns out some very common pkg-config locations are missed. One example was the icon themes needs, icon-naming-utils. I didn't want to interrupt a jhbuild cycle, so I would update the package config paths from the shell. Go to the shell, add directories to the environment variable.

export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/share/pkgconfig

Then I ran the autogen that was attempted by jhbuild.

./autogen.sh --prefix /opt/gnome --libdir '/opt/gnome/lib64'  --disable-static --disable-gtk-doc

I ran this from the shell because if I exited the shell and tried to rerun configuration phase. It would forget the environment variables. So once I succeeded to get the package configured I would return to the jhbuild prompt by exiting the shell, then I would select continue with errors, hopefully make would succeed. Incidentally the best way to do this is to get your pkg_config_path setup right before you start. Then you can get very nice builds that run without you watching. I made a small script for setting the environments since jhbuildrc does not always work.

When (if) you get to webkit you'll need a new compiler. The config script claims that clang 3.0 works, but after installing clang 3.0 I still cannot compile so I built a new version of GCC because 4.6 isn't good enough!?

GCC's config script finds almost everything you need. You will still need to install an extra package, described here

ubuntu forum to find a missing header. It took me 2 hours to compile gcc 4.7. Perhaps if you are a config guru you could eliminate some options. When I downloaded GCC it was less the 100megs, after compiling the directory became 5.6 gigs. The install is less than a gig though.

Do not worry, this is not enough to finish. Systemd could not be found so I had to disable it to compile colord and gtk+colord. Here is what I set in my ~/.config/jhbuildrc file:

module_autogenargs['colord'] = '--enable-systemd-login=no' 

PackageKit also needs systemd removed.

module_autogenargs['PackageKit'] = '--enable-systemd=no'

The next error is a bit cryptic, and took me quite awhile to solve. There is an error during configuration.

./configure: line 16338: syntax error near unexpected token `0.40.0'
./configure: line 16338: `IT_PROG_INTLTOOL(0.40.0)'

The line IT_PROG_INTLTOOL should not be in the config file. It should actually be replaced. When I searched around the most common problem I found associated with this was not having the libtool package installed. I did and I still had the problem. Many other packages were being build used almost this exact macro.

So I solved this issue by reading the full output and noticing a 'consideration'

libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.

I did that, and I got a directory not found error. So I added the line to include a '..' since it goes into another directory before working.

  ACLOCAL_AMFLAGS = -I ../m4 ${ACLOCAL_FLAGS}

This led to another error, a conflict that was solved by removing a line from the configure.ac

AC_CONFIG_MACRO_DIR([m4])

Now. Lets review this problem for a second. In the JhBuildIssues page they claim that you can solve this problem (not explicitly this problem ) by adding a line to your jhbuildrc file.

addpath('ACLOCAL_FLAGS', '/usr/share/aclocal')

That did not work for me, what did work is to add.

addpath('ACLOCAL_PATH', '/usr/share/aclocal')

Also if you are midway through a jhbuild you can go to the shell and add the path.

Now that it builds and compiles here are some of the directory sizes I'm left with.

7.4G My checkout directory (git clones with compiles)

6.2G Addition source directories that I had to compile

1.4G /opt/gnome where Gnome 3.8 was installed

~1G some other installs to /usr/local. Probably.

It also took me about 3 days to get this all figured out. I've built it all again, it really builds nicely now with the tinderbox option it makes a great directory with all of the successes and failures (damn you totem). I've gotten it to start from a session manager barely. There are some issues. I think if I were to ask the question why. Does it help for me to pester people through mailing lists, irc channels and bug reports? Should I have my computer compiling and downloading software for hours on end?

Of course this isn't worth it to just try the latest version of gnome. It is so easy now to install software onto a USB drive or another partition. I could have easily installed Fedora 19 or maybe Ubuntu 13.04 with a PPA and had a shiny new version of gnome.

One thing that comes out of this is that I can now build and compile these programs which can be a challenge on their own. So I went in to the gnome bugs and submitted a patch for an easy Gedit bug. Hopefully it goes through.

Comments

Psionic
2013-06-22 00:45:12
how do you fix smbclient.pc and libtasn1.pc? addpath('PKG_CONFIG_PATH', '/usr/local/samba/lib/pkgconfig') addpath('PKG_CONFIG_PATH', '/usr/lib/i386-linux-gnu/pkgconfig') i add these to ~/.config/jhbuildrc but still can't find them.
mbs
2013-06-22 15:54:15
Do the directories contain their respective .pc files? I would suggestion using the shell and then check to see if pkgconfig finds them. If not try exporting the paths to the PKG_CONFIG_PATH environment from the jhbuild shell. Then see if pkgconfig finds them. Note that I had to build samba and libtasn to get the .pc files to begin with since I couldn't find them before.
Psionic
2013-06-23 04:41:29
Thanks, i think if use "jhbuild shell", it will find the .pc files. I also build samba 4.0.6 to get smbclient.pc. But i think there is libtasn1.pc in /usr/lib/i386-linux-gnu/pkgconfig.
Psionic
2013-06-23 06:01:49
Yes, i download libtasn1 3.3 and build it and install in /usr/local and add to PKG_CONFIG_PATH with /usr/local/lib/pkgconfig. it can find libtasn1.pc now.
Bruno
2013-07-07 19:33:11
No problems with cairo?
Name: