Building SVN versions with CMake
Why would I Have or Want to 'Build' Scribus?
Or, for that matter, what the hell is 'Building'?
When you are going to build or compile Scribus, what you have downloaded is a large collection of plain-text files (ending in '.c' or '.cpp' to denote either the C or C++ programming language respectively). The reason there are so many is that this actually makes the process of developing software easier, and allows for use of small parts repeatedly by different functions of the overall program. These plain-text files need to be converted to binary files (ending in ',o' for object files) so that your computer can use them, and the program works efficiently.
The first step is to configure your downloaded directory of files. This requires a check of your computer to make sure the compiling programs and all the other required outside resources are present and sufficiently up-to-date. Just as Scribus itself consists of these small program files, it also will use those of outside programs, like CUPS, lcms, and so on, so it needs to have on hand those plain text files to connect to these outside resources. After checking for the necessary resources, a script is being written to tell the compiler how to go about building Scribus. The process will fail if you are missing something, and cmake will give you error messages.
The Scribus Team requires the use of CMake for this configuring process. It is quick, easy to use, and easy for the developers to write for – even CMake needs instructions. You can also pass to CMake several special parameters for your particular Computer setup, for example, where you want Scribus to be installed.
For this help, and other advice, continue reading the following sections.
You must have CMake version ≥ 2.4.3 for best results. Older versions will fail.
You might aswell read http://wiki.scribus.net/canvas/Official:Compile_with_CMake
Introduction: don't let it scare you off
Building Scribus yourself is not as hard as it sounds. In the rest of this page you'll find an answer to (almost) every question, you could have about this subject. It is worth reading, but you hopefully won't have to bother with most of the problems outlined here.
So, you may be interested in just knowing how it works in the best case.
Using Linux, it just boils down to, in case you want to compile the development version (1.5, very unstable) :
- you may change ~/src/ to wherever you want to put your source into.
- you may change /usr/local/scribus_svn/ to wherever you want to put the Scribus binaries.
Now, if you want to understand what that commands mean, you will have to read through the rest of this page...
The easy way for Debian users
First thing first: Download latest snapshot with Subversion
Subversion is the versioning control system used for Scribus. Check this link for instructions for using Subversion.
All subversion URLs for Scribus anonsvn are based at:
There's also http://scribus.net/svn/Scribus/ , which gets you to the same content, but svn://scribus.net/ is usually faster. HTTP access might be useful to those behind paranoid firewalls or proxies, though.
If you used to check out -r <Version>, check out <SVN Path> instead:
|Version133x||/branches/Version133x/Scribus||**old outdated stable version**|
So, if I wanted to use svn:// to check out 1.4.x.svn, I'd run:
svn co svn://scribus.net/branches/Version14x/Scribus scribus14x
Updating your working copy is much the same as cvs - just cd into your working copy and run "svn up" .
Some links to learn more about downloading Scribus and about SVN:
- There is an online reference for SVN at this site.
- Once you have subversion installed, you can get some help for SVN at the command line by entering svn help
- See the installing section on docs.scribus.net for more info on the Official Documentation site.
- Craig Ringer explained how to use SVN with Scribus on the list.
Thanks to Anduin.net [], anonymous SVN access is updated daily.
More info on downloading scribus:
- You can also get the source code from the Download page
If you are compiling for the first time, don't be scared of the command line. Just copy the lines relevant to the version of Scribus you want to use, one by one on the command line.
- Newbies should take care, that only 'make install' part has to be done as a root. Rest of the part, like downloading and compiling can be done easily as a normal users.
You can install as a user, however, if you are installing into a directory you have write permission for. See the -DCMAKE_INSTALL_PREFIX command below.
- And if you already have a version of Scribus on your system, don't forget to use the option WANT_VERSIONING=1. You can specify this option as -DWANT_VERSIONING=1.
Getting All the Things You Need
This is probably something of a worst-case scenario, but likely representative for a situation for a newbie having no built-in capability to compile software.
An installation of Fedora 8 was done on a computer having no DVD drive, so therefore a CD had to be used, in this case the Fedora-8-Live-KDE CD. Installing Fedora 8 in this manner is simple, since everything on the CD gets installed, but you have no capability to compile software – none whatsoever.
The basic beginning packages needed are these, obtained with
yum install... :
- subversion – if you're going to compile, you might as well get the latest Scribus updates
So if you follow the instructions above for downloading using
svn, then use Cmake, you have many dependencies to deal with, so get these before you even try Cmake the first time:
- qt4 and qt4-devel (not for 1.5 svn : it now uses - and requires - qt5)
- ghostscript – this should already be there
- libxml2 and libxml2-devel – you should already have libxml2
- python and python-devel
- freetype and freetype-devel
- tk and tkinter
- hunspell and hunspell-devel (as of 1.4.2)
- cairo and cairo-devel – you should already have cairo
For Fedora at least, the names are as used with yum, for example:
yum install qt-devel lcms-devel libjpeg-devel libtiff-devel
and so on. On other distros the exact names may vary. Here is a link describing the particulars for Ubuntu 7.10 (Gutsy Gibbon):
On Fedora, if you install various development packages, you have most of what you need. Exceptions seem to be cups-devel, lcms-devel, tk and tkinter, and python-imaging-devel (maybe cairo-devel). Incidentally, in Fedora 9 and later, Qt4 is loaded by default, and is labeled only qt and qt-devel.
apt-get build-dep scribus-ng) you will need the following packages to build the trunk (status September 2011):
Packages for Ubuntu
sudo apt-get build-dep scribus-ng
Right now (March 2011) the build dependencies for Scribus 1.4.0 on Debian/Ubuntu are:
Building Scribus 1.5.0svn and later with Qt5
Starting with rev. 18438 (2 September 2012), building version 1.5.0svn requires Qt5 (for previous revision, it was optional). To build Scribus 1.5.0svn with Qt5, you need all Qt libraries listed above, but this time in their Qt5 incarnation.
If you have Qt4 and Qt5 installed, you need to specify Qt5 with additional CMake options.
As of 21 of September 2013, the best way to get QT5 seems to be to use the installer found on http://qt-project.org/downloads. It suggests as installation directory /home/user/Qt and I suggest you keep to that. The cmake option is -DQT_PREFIX="/home/user/Qt/5.1.1/gcc/". It built OK on SUSE-12.3, Ubuntu-12.04 (Pepperment) and Ubuntu-13.04.
In case you need a list, required qt5 libs are :
qt5-qtbase.x86_64 0:5.1.1-1.fc19 qt5-qtbase-devel.x86_64 0:5.1.1-1.fc19 qt5-qtbase-ibase.x86_64 0:5.1.1-1.fc19 qt5-qtbase-mysql.x86_64 0:5.1.1-1.fc19 qt5-qtbase-odbc.x86_64 0:5.1.1-1.fc19 qt5-qtbase-postgresql.x86_64 0:5.1.1-1.fc19 qt5-qtbase-static.x86_64 0:5.1.1-1.fc19 qt5-qtbase-tds.x86_64 0:5.1.1-1.fc19 qt5-qtbase-x11.x86_64 0:5.1.1-1.fc19 qt5-qttools.x86_64 0:5.1.1-3.fc19 qt5-qttools-devel.x86_64 0:5.1.1-3.fc19 qt5-qtwebkit.x86_64 0:5.1.1-1.fc19 qt5-qtwebkit-devel.x86_64 0:5.1.1-1.fc19 qt5-qtdeclarative.x86_64 0:5.1.1-1.fc19 qt5-qtdeclarative-devel.x86_64 0:5.1.1-1.fc19 qt5-qtjsbackend.x86_64 0:5.1.1-1.fc19
On Ubuntu 13.04
- use the command line :
sudo apt-get install qt5-default qttools5-dev-tools libqt5location5 libqt5webkit5-dev libqt5webkit5 qt5-qmake libqt5xml5 libqt5gui5 libqt5core5 qttools5-dev qttools5
- then, specifically relating to qt5, install : libqt5declarative5-dev qtlocation5-dev qtsensors5-dev
- install too the usual libs not related to qt5 : zlib1g-dev libpng12-dev libjpeg-dev libtiff5-dev libpython-all-dev libfreetype6-dev libcairo2-dev libcups2-dev libxml++2.6-dev liblcms2-dev
Allmost the same : just no qttools5 and no libqt5declarative5-dev but qtdeclarative5-dev instead
sudo apt-get install qt5-default qttools5-dev-tools libqt5location5 libqt5webkit5-dev libqt5webkit5 qt5-qmake libqt5xml5 libqt5gui5 libqt5core5 qttools5-dev sudo apt-get install qtdeclarative5-dev qtlocation5-dev qtsensors5-dev sudo zlib1g-dev libpng12-dev libjpeg-dev libtiff5-dev libpython-all-dev libfreetype6-dev libcairo2-dev libcups2-dev libxml++2.6-dev liblcms2-dev
OpenSuse 13.1 RC1 or newer
Install the OS Install these packages via Yast2:
... and that's it.
Proceed with Scribus compilation process.
Additional dependencies for some graphics formats
This may be available with your Linux distribution (definitely for Fedora 17). You can also download and compile yourself.
For Fedora, typing
sudo yum install OpenSceneGraph OpenSceneGraph-devel
For OpenSUSE, go to http://software.opensuse.org/package/OpenSceneGraph and use the 1-click install procedure.
MS Publisher and WPG Importers
To start the build
/path/to/cmake . -DCMAKE_INSTALL_PREFIX:PATH=/path/to/install/to/scribuscmake/
/usr/local/bin/cmake . -DCMAKE_INSTALL_PREFIX:PATH=/opt/scribus15svn
- -DWANT_VERSIONING=1: Sets the build to use the VERSION setting as a suffix for the install directories and the binary. Eg, the binary could be
scribus-1.3.5svn. This should mean that you can install multiple versions with the same prefix with no clashes.
- -DWANT_CAIRO=1: Makes CMake search for cairo and build with cairo instead of LibArt_LGPL. cairo is the primary supported option for 1.3.5+.
- -DWANT_QTARTHUR=1: In 1.3.5, uses the QT4 ARTHUR rendering library. This is an alternative to CAIRO.
For example: to make a cairo debug build, then something like this:
To use qt_arthur instead:
Make the following directory:
So then, instead of doing:
eg /usr/local/bin/cmake . -DCMAKE_INSTALL_PREFIX:PATH=/opt/scribus15svn
you would then change to the builddir directory and run:
eg /usr/local/bin/cmake ../Scribus -DCMAKE_INSTALL_PREFIX:PATH=/opt/scribus15svn
More CMake Options
Continuing on to the build stage
Once this has successfully completed, simply run
make && make install.
There is a long todo list for this build system including, but not limited to:
- Checking it works across distributions
- Checking it works across various flavours of UNIX
- Checking it works on 64 bit distros
- Add Win32 and Mac OSX support
Specific library locations
Whenever your distribution releases their package for a library Scribus depends on, it may still not be the very latest stable or unstable version from the writers of the library. In some cases, the Scribus developers have had to rely on the very latest code to further some parts of Scribus. In this case it is necessary to build your own version of such a library.
One example of this is the cairo graphics library. Right now, 1.3.5svn has the capability to use the very very latest code from the just released cairo 1.4.
To specify a new cairo install path, other than your system's default add this to the cmake command line:
Instructions for specific distributions or versions
Making a tarball for distribution
make dist. The new way is to run
make package_source or
/path/to/cpack -G TBZ2 --config CPackSourceConfig.cmake to give you a bundle of the source. With cmake 2.4.1 there is only support for a gzip
tar.gz however a bzip2
tar.bz2 is possible with later versions of cmake.
Notes For Packagers
>_______mkdir -p $(BUILD_DIR)
>_______$(MAKE) -C $(BUILD_DIR) install DESTDIR=$(INSTALL_DIR)
where $(BUILD_DIR) is ./build and $(INSTALL_DIR) is ./install
Using $(PREFIX) is the key to avoiding hardcoded absolute path problem.
- Enable more pkg-config usage
- Prefixes for more packages
- Create a new Homebrew formula for MacOSX and eventually add to this page