user-avatar
Today is Tuesday
December 3, 2024

Tag: gnome

December 12, 2013

Using jhbuild to compile and run gnome applications

by viggy — Categories: debian, FOSS, FSMK, linux, software — Tags: , , , Leave a comment

I have been trying to compile and run gnome-chess from source. The first way, I tried was by downloading the source tarball and then running configure, make and make install. This worked fine after I fixed the dev libraries dependencies. This is one of the first point that you need to remember if you are compiling anything by source on any GNU/Linux distribution.

Point 1: If the compilation fails due to bad dependencies, it is generally because the dev library of that package is not installed.
If on debian, use apt-cache search to check which pacakges are available to download and apt-cache policy to check which package version you currently have installed.

This worked just fine and I was able to run gnome-chess with the latest code. Now when I modified few lines of code and tried to build it again, I started getting errors and that too in files which I hadnt even modified.

After looking a lot around for answers, I decided to use jhbuild and try compiling the source using it. I had hoped that it will help resolve all dependencies issues and hence I will be able to run the modified code.

I do not understand jhbuild yet completely, however I started following the manual in the gnome website.
Downloaded the jhbuild source from git repo.
build is using autogen.sh, make and make install.
Copied the sample jhbuildrc to my ~/.config directory.
Ran jhbuild sanitycheck and fixed the issues that were shown.
Then ran jhbuild build. This again gave me close to 60-70 missing packges.
Went through each one of them and again installed all the dev libraries.
Then when I ran jhbuild build, it started the process of downloading the source and building each of the gnome packages. In all 175 of them.
Finally I was loosing patience as some of the packages were as big as 300MB say for GTK+. It didnt make sense that just to build gnome-chess, I needed to build complete gnome from source.

This is when I met Mario(maweki) on #gnome-chess on IRC. Frustrated, I had sent a mail to games-list@gnome.org few minutes ago and he pinged me on IRC to help me.
He explained to me patiently what I exactly need to do.

Point 2:
So if you need to just compile and build gnome-chess,
Add the following in your jhbuildrc file which should in ~/.config directory.
ignore_suggests = True
This will reduce what needs to be build as much as possible

You can use the following command of jhbuild.

jhbuild build gnome-chess
Note: I had not given any module name in my previous command and hence it was downloading everything required for gnome.
This for me downloaded only 21 packages.
In some cases you may have to first build gnome-standard-themes package first. This is when the application doesnt use graphics but css-rules.

You can run jhbuild it using
jhbuild build gnome-standard-themes

However this might not always be necessary for all applications. So you can skip it safely also.

Point 3:
If you make changes to the source file and want to build the application again, use the following command
jhbuild buildone -n 'application-name'

buildone just builds the single application
-n switch is for networkless building and this will ensure that the source from your local directory is picked rather than checking out from the repo.

Point 4:
If you want to run the application from the newly build source, use the following command,

jhbuild run 'application-name'
By this, you should be able to see the changes, if any you made in the source directory.

Most of the pointers above were what Mario suggested me. I hope this would help you to get started with atleast downloading, compiling and running gnome-applications from source.