This is an old revision of the document!
Building Xfce
To compile a complete Xfce desktop from source requires some information about the dependency chain and the various configure options available in each module. This page will describe this in detail, so you can compile your own Xfce desktop; both system wide as well as in your $HOME directory.
Version
First you need to decide which version of Xfce you want to compile. Version numbers are mostly build like this: 1.2.3 ⇒ major.minor.micro. If the minor version is an even number, it is a stable release, odd number are development snapshots. The micro number increases each release. Also keep the major.minor version the same for the core components (some packages don't follow those numbers) else you will most likely get dependency version problems during compiling.
The latest releases available can be found on the download page. You can also build from the source repositories if you have enough experience, more about that below.
Source
If you've decided which version you want to compile, there are a couple of ways to download the source code. You can choose to build official released packages or clone the source repositories. Choosing the released packages is recommended here; the source repositories could be broken and are not suitable for production environments, but on the other hand always contains the latest features, bug fixes and translations.
If your not sure what to choose: easiest is to start with the latest stable fat-tarball of a collection release.
Released packages
Xfce packages have two types of releases. Click the links to open the the download locations.
- Collection releases of the core modules
From time to time a new collection release if Xfce is made. A collection release consists of a number of individual tarballs and a fat-tarball that contains all the individual tarballs.
The collection releases always contain the correct versions to build the other packages in the release. If you want the latest version of each package, you can start with a collection release and then look for individual bug fix releases, explained in the item below. - Individual releases
Each package in Xfce is allowed to make development and stable releases at any time, see the release model documentation for more information.
From the code repository
For the latest code you need to make local copies of the GIT repositories, this is the place where developers submit their code. If you decide to use GIT, try to use the same branch for all the packages to avoid dependency version problems.
You first need to make clones of each GIT repository, like the command below, where $category
is for example xfce
and $module
xfce4-panel
. If you click on a module in the online repository list the clone uri is shown at the bottom of the page.
git clone git://git.xfce.org/$category/$module
After the repository is cloned you need to choose which branch you want to compile. By default the master
branch is selected, but there are also branches for stable releases like xfce-4.8
. The stable branches contain the latest bug fixes without any major new feature, the master branch is the development version for the next release of Xfce. Both should not be used in a production environment.
To switch to another branch (git branch -a
lists all available branches) run the following command inside the cloned directory to switch to, for example, the xfce-4.8
branch:
git checkout --track origin/xfce-4.8
After this you can update your local copy of the repository with git pull and switch to another branch with git checkout $branchname
. Read the GIT manuals for more information about using GIT.
Dependencies
Build requirements
Before you can start compiling, you need a couple of packages that are required to compile Xfce. Use your distributions package manager to install those packages. Additional packages are required too for some modules, but we'll get to that later.
- Gtk+ and Glib headers, in some distributions called the -devel packages
- Xfce 4.10 requires Gtk+ 2.20 and Glib 2.24
- Xfce 4.8 requires Gtk+ 2.14 and Glib 2.20
- Xfce 4.6 requires Gtk+ 2.10 and Glib 2.12
- pkgconfig
- Coffee
Xfce's dependency chain
The Xfce packages need to be built in a specific order. If you don't follow this, compile options might not be available or the configure stage will abort because of missing dependencies.
Package specific dependencies
Some core packages in Xfce have additional or optional dependencies, all are listed in the table below for the latest stable version. We only show the top-dependency (so xfce4-panel also requires gtk+, but libxfce4ui already depends on that).
Dependency(-ies) | Optional Dependency(-ies) | |
---|---|---|
xfce4-dev-tools | autoconf, automake, intltool, pkgconfig | |
libxfce4util | glib 3) | |
xfconf | libxfce4util, dbus-glib | |
libxfce4ui | libxfce4util, gtk+, xfconf | libstartup-notification, libgladeui |
garcon | gio, libxfce4util 4) | |
libxfcegui4 5) | libxfce4util, gtk+, libglade | libstartup-notification, libgladeui, xfconf |
exo | libxfce4util, gtk+, perl-uri, libxfce4ui 6) | |
xfce4-panel | libxfce4ui, exo, garcon, libwnck | libstartup-notification |
thunar | libxfce4ui, exo, libpng, gtk+, glib | libexif, dbus-glib, gconf, libnotify, libstartup-notification, freetype, libjpeg, libxfce4panel, xfconf |
xfce4-settings | libxfce4ui, exo, xfconf, dbus-glib, libXi, libXrandr | libXcursor, libnotify |
xfce4-session | libxfce4ui, perl-xml-parser, libwnck, dbus-glib | gnome-keyring, gconf 7) |
xfwm4 | libxfce4util, libxfce4ui, libxfconf, dbus-glib, libwnck | libstartup-notification |
xfdesktop | libxfce4ui, xfconf, libwnck, exo 8) | thunarx, garcon, libnotify |
xfce4-appfinder | libxfce4ui, garcon, gio 9) | |
xfce-utils 10) | libxfce4ui | dbus-glib |
gtk-xfce-engine-2 | gtk+ | |
tumbler | dbus-glib, gio, gmodule, gdk-pixbuf | freetype-config (fonts), jpeg (jpeg thumbnails from exif), libffmpegthumbnailer (video), gstreamer-0.10 (video), poppler-glib (pdf), libgsf (odf), libopenraw-gnome (various raw images) |
Building
Installation location and variables
Now it is finally time to start compiling the Xfce desktop. Last remaining thing is to choose an installation location. Possible examples are /usr
, /usr/local
and /opt/xfce4
for a system-wide installation or $HOME/local
if you want to install in your home directory (whatever you choose, never put spaces in the name). We will refer to this location as ${PREFIX} in the code examples below!
You need to make sure the PKG_CONFIG_PATH
variable include the path to the *.pc files installed by the Xfce libraries:
export PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig:$PKG_CONFIG_PATH"
You can also set some optimization flags for the compiler. This may speed up Xfce, but can also make debugging impossible on some systems. Even worse, this can also cause gcc to generate broken code, so be careful with this. The line below should be safe for most system.
export CFLAGS="-O2 -pipe"
Compiling and installing
Next step is compiling the various packages following the dependency chain above. If you have downloaded the tarballs, you need to unpack them before going on. Inside each package directory you should run the following command:
./configure --prefix=${PREFIX} && make && make install
To build from GIT you need to install the xfce4-dev-tools package first, all other packages should be installed with this command:
./autogen.sh --prefix=${PREFIX} && make && make install
Specific configure options for each package can be shown with ./configure --help
. Note that most packages benefit speed if you pass the configure option --disable-debug
, however if you want to provide backtraces or test new code, no $CFLAGS
, no binary stripping and --enable-debug=full
are recommended. Please note that --disable-debug
is not available for xfce4-dev-tools.
./configure
script while building from GIT remember to pass the flag --enable-maintainer-mode
.
If you install the package in a public prefix, for example /usr
or /usr/local
, you need to run make install
in sudo. This way you will be asked for the system administrator password and have write permissions in those locations.
sudo make install
Help
Hopefully everything went fine after reading this guide. If you still have problems or questions you can ask on the Xfce users mailing list, the forum or ask distribution related questions on their forums and mailing lists.
Have fun building Xfce!