Last update: December 5, 2009
The GNOME SlackBuild Build System
This page describes how to build the binary GSB distribution from the actual GSB source code. It is recommended that you read through (end even print) this entire document before starting the build process.
For other aspects of the GNOME SlackBuild Build system, please return to Main page.
Check out the source
The first step to building your GNOME Desktop with GSB is to check out our source code from our svn repository. Please make sure to do so in a directory on a disk partition that has quite a bit of free space. The GSB Build System itself doesn't not take up much disk space, however, the source tarballs are downloaded directory into the build tree. A full source build tree can take up to 1GB of disk space. We currently maintain several SVN branches to produce our GSB releases.
You can check out the GSB Build System using the following command:
Current Branch
This tree contains the latest and most up to date GSB sources. As such, at any time it may be broken (ie, will not build fully) or may cause your system to explode in a shower of wires and capacitors if you run it. This tree is usually only for the latest Slackware/Slamd64 current and may not work on other releases.
$ svn co http://svn.gnomeslackbuild.org/gsb/trunk gsb
Or browse in svn: http://svn.gnomeslackbuild.org/viewvc/trunk
This may take a long time depending on the speed of your internet connection. If you have difficulties building a package, before reporting any errors, please make sure your Build Tree is up-to-date. Changes to the trunk can happen daily, and the fix may already be applied to the build tree. To update your tree to the latest version, change into the gsb directory and run:
$ svn update
The build script
Before you begin building GSB, make sure to see our required set of tagfiles in tagfiles/ for an idea of needed packages for build machine. Further build requirements are found in the REQUIRED_PACKAGES found at the top of the buildgsb script.
There are a few packages which are required to build GSB, but not actually needed at runtime. The buildgsb script builds and installs all these required packages, but does not put them in the build tree.
NOTE: The jdk package is found in the extra/ directory in Slackware. You will need to install this package in order to build OpenOffice.
- It is also recommended that you have the latest patches for Slackware applied.
- Make sure to have a sane gsb.options file. You can use our gsb.options.sample to begin. Copy it over to gsb.options and then modify according to your system.
- Run:
$ ./buildgsb
It will download source files on the fly, md5sum check, and then build the package. All package information is kept in the .info files found in each package directory. If you want to upgrade versions, you will need to modify both the .info and .SlackBuild file for the package. If packages complain of missing dependencies, they may be in another set. For example, if a package requires 'setuptools', you will need to manually build a partial 'd' set before continuing. You can do so by:
$ ./buildgsb -set=d
At the moment, the new build script doesn't automatically resolve and build dependencies; we will be adding this in to future versions of the build script. However, manual monitoring isn't too inconvenient. :^)
More information about the buildgsb script can be found by:
$ ./buildgsb --help.
The flags --publish and --export-source are only really needed if you want to create a publicly available repository for use with slapt-get. If you use --publish, you will need to supply a custom GPG-KEY in order to sign your packages. Take a look at the buildgsb and functions.sh for details about the signing procedure.
Disk Space
Disk space requirements are the first priority. It may seem surprising at first, but a complete GSB Build may require up to 8GB of disk space. There is a lot of software that will be compiled during the build process and it is important to ensure that enough free disk space is available before starting the build scripts. The disk space usage is broken down as such:
GNOME SlackBuild Source Tree: ~261MB
This includes all the GNOME SlackBuild scripts, as well as all external svn sources.
GNOME SlackBuild Source Tarballs: ~1GB
This is approximate for a full source download. If you only wish to build a few single packages then if may be easier for you to download each source tarball individually.
Temporary building space: ~6GB
Some larger applications like Mozilla Firefox, Mono, and Boost C++ require enormous amounts of space to build. Despite the fact that the resulting binaries are often only about 30MB, while building they may need up to 3-6GB for object files and libraries.
Installed Software: ~2GB.
As the GSB Build system steadily progresses building packages, it will need to install them on the build system for the sake of satisfying dependencies. In other words, the system on which GSB is built will also have it installed. A full installation of GSB will required approximately 2GB
GNOME SlackBuild Packages: ~563MB
GNOME SlackBuild will produce standard tgz format Slackware packages, placing all the built packages into the default directory /tmp/gsb-packages. A full GSB Build will require space for about 360 individual packages.
Development and Build Tools
A full development system is also required to build GSB. You will need to ensure that the following standard Slackware packages are installed on your system:
autoconf, automake, bin86, binutils, doxygen, flex, gcc, gcc-g++, gettext-tools, guile, indent, kernel-headers, libtools, m4, make, perl, pkg-config, python, subversion
All of these packages are installed on a "full" Slackware install, but some users who installed a custom selection may not have these packages installed. They are available on any Slackware CD, or available from any Slackware mirror. For those users who are interested, we provide a set of tagfiles to be used during a Slackware installation which will install the same set of Slackware packages we use on our own build system. They are available in the trunk/lib/gsb/tagfiles/build-box directory.
Build Settings
When building GSB, there are several environment variables which can be used to tweak and customise the build process. GSB supports two methods of setting these environment variables, described below.
The first option is to use the bash builtin "export" to manually set the option and export it to all sub-processes. This can be done with a command like:
$ export VAR="VAL"
This can be repeated for as many environment options as you want to set. You must remember to set these options every time you begin a build process as they will not be saved accross multiple builds.
The second option is to create a gsb.options file in the build/ directory. The gsb.options file is read at the begining of every build process, and the options specified in this file will be saved accross multiple builds. Using the gsb.options file is especially useful for repeat builds or for developers who want to set specific options when testing.
The gsb.options file should contain exactly the same "export" commands which would be used manually on the command line (see above). The advantage of putting them into the gsb.options file is that the options will always be read, no matter whether you remember to manually export them on the command line.
Here are the common environment variables which can be set to effect, tweak or customise the build process:
ARCH
Setting the ARCH allows you to over-ride the default base architecture type for GSB. You can use this environment option to build GSB for, say, x86_64 or the powerpc architecture type. The architecture type set when building GSB determines the absolute minimum processor type required to run the produced binaries. In other words, if you set ARCH=i686 the resulting code will NOT work on an i586 or earlier CPU. These ARCH types are currently recognised by the GSB SlackBuild scripts: i386, i486, i586, i686, x86_64, powerpc.
The default is "i486".
TUNE
This option is very similar to the ARCH environment option except that the resulting binaries are scheduler-tuned to the given processor type. This means that the binaries will be tuned to run with better performance on the CPU type specified with TUNE, but will still work without problems on CPU types going back to the value specified for ARCH. TUNE can be set to any valid CPU type within the architecture type specified with ARCH. For example, if ARCH=i586, TUNE could be set to i686. For an ARCH type of x86_64, TUNE must be set to one of the 64 bit processor types, currently: k8, opteron, athlon64, athlon-fx.
The default is "i586", except for an ARCH type of x86_64 where it is "k8".
You may find more information on ARCH and TUNE settings in the gcc man pages.
DISTRO
Setting DISTRO to anything other than "slackware" allows GSB to be built on different (Slackware based) distributions. For example, this can be set to "slamd64" when building GSB on the 64 bit Slackware based distro Slamd64.
The default is "slackware", and should not be over-ridden unless you are specifically building for another distribution.
TMP
During the package builds, temporary data will need to be stored on disk. This option specifies the directory where that temporary data can be written. Make sure the default (or any directory you specify) has enough free space for the build process, plus the completed packages and logs.
The default is /tmp.
PKGDEST
Once a package has been built it will be stored in the directory specified with this option. The default for this option is affected by the value of the TMP environment option detailed above (referred to as $TMP below).
The default is $TMP/gsb-packages.
LOGSDIR
As the GSB build process proceeds, a log of the output from each package build is logged for later debugging. This environment option specifies the directory where these log files will be stored. This option is not used by individual package SlackBuilds but is used by the top-level SlackBuilds which control the build processes. The default for this option is affected by the value of the TMP environment option detailed above (referred to as $TMP below).
The default is $TMP/gsb-buildlogs.
Advanced Build Settings
The following options are less common but allow highly specific customisation of the build process. You should not set these options unless you know exactly what needs to be set for each. GSB comes with fairly optimised complier settings, but if you really want to squeeze every last cycle out of your CPU, you can adjust compiler and make settings. Be wary though! Sometimes hyper-optimising can break software that depends on careful or ISO-standard math routines, for example, liboil.
GSB_CONFIGURE_FLAGS
Any options specified in this environment variable are ADDED to the package specific options passed to the ./configure command in the SlackBuilds. If this option is set globally (ie, set with export or in gsb.options) it sets the additional options passed to ./configure for EVERY SlackBuild in GSB. Therefore, make sure that any setting given in this environment option is valid for EVERY ./configure used in GSB.
By default, when ARCH=x86_64, ./configure is automatically passed --libdir=/usr/lib64.
GSB_TUNE_FLAGS
This environment option allows you to set the specific tuning options gcc should use when compiling/linking the binaries in packages. There are many, many gcc options which can be set to optimise/tune the binaries - see the gcc man page for full details. Setting this option over-rides the default tuning options specified in the SlackBuild files - these options are NOT added to the default ones. Make sure you add any of the default options from the SlackBuilds back to this environment option if you choose to use it. Tuning is specific to each ARCH, with the defaults being:
- i386, i486
-O3 -march=$ARCH -mtune=$TUNE
- i586, i686
-O3 -march=$ARCH -mtune=$TUNE -pipe -fomit-frame-pointer -ffast-math
- x86_64, with default TUNE
-O3 -march=k8 -mtune=k8 -pipe -fomit-frame-pointer -ffast-math -fPIC
- x86_64, with custom TUNE
-O3 -march=$TUNE -mtune=$TUNE -pipe -fomit-frame-pointer -ffast-math -fPIC
- powerpc
-O2 -march=$ARCH
When Things Go Wrong
Don't panic. :^) We've worked hard to ensure that all the packages within the GSB Build Tree will build on Slackware. If you have difficulties building a package, before reporting any errors, please make sure your Build Tree is up-to-date. Changes to the trunk can happen daily, (and even hourly!), and the fix may already be applied to the build tree. Before reporting errors, please make sure to have updated your tree to the latest version. Change into the gsb directory and run:
$ svn update
If you discover yourself still having difficulty building a certain package or packages, let us know and we'll try our best to resolve any issues. There are several mailing lists used by the GNOME SlackBuild project. These are hosted by Google Groups, and in order to read or post to the mailing lists and groups, you must first subscribe. Give IRC a try first, but if no-one is around, then please do send an email detailing the problem you are having, with all the appropriate details, like OS and compiler versions, the exact error, and steps to reproduce it. You may also want to check the archives or FAQ to see if the problem is already known.
Try one of the following (in this order):
- Check the FAQs and other helpfull resources on the website:
http://gnomeslackbuild.org/support/
- Email steve (at) gnomeslackbuild.org
- Join the GSB User Discussion Mailing List:
http://gnomeslackbuild.org/lists/
Firstly, check the archive to see if anyone else has had a similar problem which has already been solved. You will not get any points for requesting help with a problem that has already been addressed.
The mailing list is the easiest and preferred method of contact for support type issues - it allows us to keep an archive of questions and answers. Note: You must be subscribed to the mailing list in order to post messages.
- Join the #gsb IRC channel on irc.freenode.net and ask questions. We may appear to be always online, but we are frequently away from the console and you may not receive an answer for a while. But stick around since we'll try to give a reply, eventually :)