JHBuild allows you to build and run Gnome platform and applications building the required modules in a sandbox environment, isolating the installation; so there is no need to build and run Gnome inside a virtual machine.
To build Gnome is strongly recommended to be using a distribution which has latest Gnome version. Latest Fedora is known to be well supported.
- g++ (gcc-c++)
sudo apt-get install apt-file docbook-xsl build-essential git-core gettext sudo apt-file update
sudo dnf groupinstall "Development Tools" sudo dnf install gnome-common python-dbus
然后，给代码创建文件夹。鉴于JHBuild将使用~/ jhbuild/ checkout（~意味着你的主目录）的所有Gnome 软件栈的代码，我们将使用该文件夹JHBuild的代码以及：
mkdir --parents ~/jhbuild/checkout
cd ~/jhbuild/checkout git clone git://git.gnome.org/jhbuild
cd jhbuild ./autogen.sh --simple-install make make install
echo 'PATH=~/.local/bin:$PATH' >> ~/.bashrc; . ~/.bashrc
如果您想进一步定制，你可以创建一个名为jhbuilrc,放在~/.config的配置文件。对于它的文档请参阅 https://developer.gnome.org/jhbuild/stable/config-reference.html 更多有关Jhbuild命令的详细信息，请参阅https://developer.gnome.org/jhbuild/stable/command-reference.html
jhbuild sysdeps --install jhbuild build adwaita-icon-theme dconf glib-networking gvfs
Then build and compile the application you want and its Gnome latest dependencies.
jhbuild build gnome-weather
JHBuild will go through the module and its dependencies one at a time, downloading the development code, configuring, compiling and installing it for you. It will create ~/jhbuild/checkout/ and ~/jhbuild/install directories in your home directory. This will take a little long time, so it's time for a coffee break If something goes wrong, see the next chapter at when things go wrong.
When it's done, you will be able to modify or see the source code of the applications. The code will be in ~/jhbuild/checkout, where you can search for the application name.
If you want to stop building and continue later where you were, just kill the process pushing <ctrl> + <c> twice to stop it, and take note in which module you stopped it. To start where you were, just do:
jhbuild build gnome-weather --start-at=moduleWhereYouStopped
Things typically will not build the first time you're using JHBuild. Don't worry though, this is normal and usually is fairly easy to fix. When JHBuild hits a problem it gives you a set of options that you can use which will let you try the build again.
- If there's a problem configuring because of a missing dependency, something like "Config error: No package 'foo-2.0' found", search for which package provides the required library with:
apt-file search "foo-2.0.pc"Fedora
yum install 'pkgconfig(foo-2.0.pc)'
- If your package manager shows that the required package is already up to date (and it's not) or if it's unable to locate the package then you'll have to download the source code for the required package and compile it yourself.
- If there is an error in Make, choose  Enter shell, run git clean -xfd, then press ctrl + d (to exit the shell), then finally select  to rebuild.
- If your installation was interrupted (due to Ctrl + C or unstable network, say) and choosing  isn't working it's possible that the installation tree got damaged; choose  Go to phase "wipe directory and start over".
Otherwise, ask for help. Here you have a few ways for it.
Running software installed through JHBuild
To run a module that you have installed through JHBuild, you just use the run command. However, you need to kill all current instances of the app:
killall -9 gnome-weather jhbuild run gnome-weather
In case you are trying to develop Gnome Shell, it is kind of special, and it needs an argument to replace you current running instance:
jhbuild run gnome-shell --replace
Updating your module
You can update the module installed through JHBuild to include any changes to the development code since it was last built. It's not usually necessary to rebuild all of the module's dependencies. JHBuild has the buildone command for this.
jhbuild buildone gnome-weather
Which it will build without building any dependencies of the module. If at some point, you find that you need to re-build your module with all of the dependencies (e.g. there are problems re-building your module with just the buildone command and that problem is not due to a change you have made) then you could try:
jhbuild build -afc gnome-weather jhbuild run gnome-weather
And it will update the module and all dependencies to the latest code.
The '-a' option means, 're-run autogen.sh'
The '-f' option means, 'build modules even if they haven't changed'
The '-c' option means 'run make clean before building'
Building a module that you have modified
Once you've built a module, if you modify the source code for that module, you can build and test your changes executing:
jhbuild buildone -n gnome-weather jhbuild run gnome-weather
The -n option prevents downloading updates - this will avoid conflicts with local changes you have made.
那么直接进入 Newcomers/SolvingTasks 让我们开始代码旅程。