Building SVN versions with CMake: Difference between revisions

From Scribus Wiki
Jump to navigation Jump to search
 
(238 intermediate revisions by 20 users not shown)
Line 1: Line 1:
[[Category:Scribus_development]]
{{Cleanup}}
[[Category:Installation]] [[Category:Development]]


After many years of using the autotools build system, the developers of Scribus have selected [http://www.cmake.org CMake] as a replacement system. It provides a much more flexible setup with a lot less complexity. It also provides compatibility with build tools on Linux and variants of Unix, Windows and Mac OSX.
This page tries to describe how to build Scribus from source.
The instructions mainly refer to building Scribus on Linux. Building on Mac OS and on Windows is not easy; you can find some explanations for Mac OS [[Installing from SVN on Mac OS X|here]], and for Windows [[Building SVN versions on Windows|here]].  


'''You must have CMake version ≥ 2.4.3 for best results. Older versions will fail.'''
=TL;DR (Too Long; Didn't Read)=
<big>You know what you are doing already and just want to compile Scribus via SVN, skip the introduction and go to [[{{PAGENAME}}#Version 1.5.x|Installing 1.5svn]]</big>


==Introduction: don't let it scare you off==
=Why would I Need or Want to 'Build' Scribus?=
<big>
# '''For Necessity:''' You are using the current stable version, but certain bugs are a problem, and you know they have been fixed since the last release.
# '''For Science:''' You have heard about some new features in the development version, and you'd like to try them out.
# '''For the World:''' You're considering helping out the Scribus project and want to see how it's put together to get some idea about how you can help.
</big>
==='Or, for that matter, what is this 'Building' you speak of?===
<div class="toccolours mw-collapsible mw-collapsed" style="width:800px;">
<big>Expand this content if you need a little bit more background on what Building source code means. ---></big>
<div class="mw-collapsible-content">
<big>When you are going to build or compile Scribus, what you have downloaded (if you have downloaded the source code) 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.


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.
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.


So, you may be interested in just knowing how it works in the best case.
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 &ndash; 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.


Using Linux, it just boils down to:
Next, the actual 'build' process is done with a program called '''make'''. To start the process you simply enter <tt>make</tt> in a command line. That's it. You do not need to have ''root'' privileges to compile, and it is generally recommended that do not compile as root (one reason for this is that, by creating a number of files under root's name, you then interfere with subsequent updating from SVN). Compiling takes up a good part of your computer's resources, especially your processor(s), so you will find its performance rather sluggish while compiling is going on. Consequently, many find that compiling is best done by starting '''make''' and then walking away from the PC to let it do its work.
 
Finally, you need to install, done with the command <tt>make install</tt>. If you are going to install in the default location, you will need to have ''root'' privileges. On most Linux distros this can easily be done with the <tt>su</tt> command (after which you need root's password), or with '''sudo''', entered as <tt>sudo make install</tt>. You can run '''cmake''' with a command that can install Scribus in a directory for which you have write privileges, and therefore do not need to be '' root''.
 
For this help, and other advice, continue reading the following sections.</big>
</div>
</div>
 
== Fear is the mind Killer... ==
[[Image:Fear-is-the-mind-killer-Dune.png|500px|thumb|right|"Do not fear building Scribus from source" ~Paul Muad'dib Atreides]]
'''There is nothing to fear here, building Scribus yourself is not as hard as it sounds'''. You will not break your computer.
 
This page can teach a beginner many things at once: starting with beginning to comprehend the internals of Scribus to appreciating the Command Line shell and how to invoke commands through it. Learn how to install software libraries (components that Scribus utilizes) and go so far as to modify source code through applying patches. This exposure will help increase your skill set to work on most all platforms and widen your knowledge of software creation and maintenance.
 
=1st: Download latest snapshot with Subversion=
Subversion is the versioning control system used for Scribus. This allows multiple developers to hack on Scribus source code simultaneously. Check the [[Subversion]] page for further details on how to use this tool. Make sure you have svn installed. You don't need to learn all subversion commands and options: "svn co" and "svn up" might suffice, see below for examples.
 
You should create a directory in which the Scribus source code will be downloaded. Then change to that directory, and once you are there, you can download the source code with a simple command. You have to choose which branch you will download, as shown in the table below:
 
{| cellspacing="10" cellpadding="6"
! Status !! Version !! !! SVN Path !! Command to download from SVN
|-
|'''Development''' || '''1.5.x''' ||        || /trunk/Scribus || <tt><b>svn co svn://scribus.net/trunk/Scribus scribus15</b></tt>
|-
|'''Development Snapshot''' || '''1.5.0''' ||        || /trunk/Scribus revision 20099 || <tt><b>svn co -r 20099 svn://scribus.net/trunk/Scribus scribus150</b></tt>
|-
|'''Stable''' || '''1.4.x''' ||        ||/branches/Version14x/Scribus || <tt><b>svn co svn://scribus.net/branches/Version14x/Scribus scribus14x</b></tt>
|-
|Outdated  || <strike>v.1.3.3x</strike> ||        ||<strike>/branches/Version133x/Scribus</strike> || <strike><tt><b>svn co svn://scribus.net/branches/Version13x/Scribus scribus13x</b></tt></strike>
|}
<small>'''Important Notes:'''
* All subversion URLs for Scribus anonsvn are based at: '''svn://scribus.net/'''
* Updating your working copy is much the same as cvs - just cd into your working copy and run <tt><b>"svn up"</b></tt>.
* 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.
* If you used to check out -r <Version>, check out <SVN Path> instead
</small>
 
------
 
'''Thanks to [http://anduin.net Anduin.net], anonymous SVN access is updated daily.'''
 
===Example===
<div class="toccolours mw-collapsible mw-collapsed" style="width:800px;">
Here is an example of the commands for downloading the source code:
<div class="mw-collapsible-content">
 
<small>(This example is for Linux; on other platforms you should use the corresponding commands)</small>
 
Let's suppose that you want to download the Scribus 1.5.0. source code in a directory called "scribussource" under your home directory. Here are the commands:
 
  mkdir ~/scribussource
  cd ~/scribussource
  svn co svn://scribus.net/trunk/Scribus
 
When subversion finishes downloading, you will find the source code in ~/scribussource/Scribus
 
If you have the source code and you want to update it to the latest version:
 
  cd ~/scribussource/Scribus
  svn up
</div></div>
 
=2nd: Install methods: Package Manager, Source, Out-of-Source Build=
 
==Essential tools==
Before going further, we must understand that in order for anything to get built, tools need to exist. In modern OS's especially Linux many of these are build tools arrive already bundled. If they aren't for some reason you will need to '''install them manually''' (see [[{{PAGENAME}}#Package Manager|package manager]])
* gcc
* gcc-c++
* cmake (version &ge; 2.8.9)
 
* subversion &ndash; if you're going to compile, you might as well get the latest Scribus updates
 
<big>There are several option for installation.
* [[{{PAGENAME}}#Package Managers| Package Manager]]: (difficulty: easy) Does a lot of the heavy lifiting by installing all the components you specify
* [[{{PAGENAME}}#Build from Source| Build from Source]]: (difficulty: intermediate to advanced) Build it the old fashion way
* [[{{PAGENAME}}#Out-of-Source-Builds| Out-of-Source-Builds]]: (difficulty: intermediate) Needs explanation
</big>
 
==Package Managers==
Note: many Linux distros have their own Package Managers i.e. Debian has '''apt''',  Fedora and Centos have '''yum''', more recently superceded by '''dnf''', Redhat uses '''rpm''' etc... On Mac OS X there are several choices, most popular are '''Macports''' and '''Homebrew'''. In general, by utilizing the installed package manager we can streamline the installations through easy one liners which will automate the install. We do this by invoking the following pattern: 
 
<tt> <b>(package-manager)  install (software-or-library-package-name)</b></tt>
 
'''Debian'''; &nbsp;&nbsp;&nbsp;'''<code>apt-get install cmake</code>''' <br />
'''Fedora''': &nbsp;&nbsp;&nbsp;'''<code>dnf install cmake</code>'''        <br />
'''MacOSX''':&nbsp;'''<code>brew install cmake</code>'''
 
==Specific Dependencies==
<!-- 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. -->
Dependencies are considered to be 3rd party software libraries or other altogether unique software projects that are have components that are needed to build a specific project from. When we want to build Scribus we need to make sure that we have all the dependencies fulfilled or else it will complain to us about missing components or obsolete ones. The following section assumes you need to manually install dependencies. Here are the list of package names that will be needed to be installed before attempting to build Scribus. Each major version of Scribus will require different dependencies.
 
===Version 1.7.x===
 
=====Ubuntu=====
 
<div class="toccolours mw-collapsible mw-collapsed" style="width:800px;">
Ubuntu v23.04 ---->
<div class="mw-collapsible-content">
* Run '''apt-get build-dep scribus''' . You may need to enable the sources repository first.
* Initially install:
'''sudo apt-get install libqt6core5compat6-dev libqt6svg6-dev linguist-qt6 qt6-base-dev qt6-base-dev-tools qt6-base-private-dev qt6-gtk-platformtheme qt6-image-formats-plugins qt6-l10n-tools qt6-svg-dev qt6-tools-dev qt6-tools-dev-tools qt6-translations-l10n'''
* Install the usual libs '''not''' related to qt5 :
'''sudo apt-get install zlib1g-dev libpng12-dev libjpeg-dev libtiff5-dev libpython-all-dev \'''
                      '''libfreetype6-dev libcairo2-dev libcups2-dev libxml++2.6-dev liblcms2-dev'''
</div></div>
 
<div class="toccolours mw-collapsible mw-collapsed" style="width:800px;">
Ubuntu v24.04 ---->
<div class="mw-collapsible-content">
* Run '''apt-get build-dep scribus''' . You may need to enable the sources repository first.
* Initially install:
'''sudo apt-get install libqt6core5compat6-dev libqt6svg6-dev linguist-qt6 qt6-base-dev qt6-base-dev-tools qt6-base-private-dev qt6-gtk-platformtheme qt6-image-formats-plugins qt6-l10n-tools qt6-svg-dev qt6-tools-dev qt6-tools-dev-tools qt6-translations-l10n'''
* Install the usual libs '''not''' related to qt5 :
'''sudo apt-get install zlib1g-dev libpng-dev libjpeg-dev libtiff5-dev libpython3-all-dev \'''
                      '''libfreetype6-dev libcairo2-dev libcups2-dev libxml++2.6-dev liblcms2-dev'''
</div></div>
 
===Version 1.5.x===
Here is a list of dependencies for Scribus 1.5.x:
 
  Qt (version >= 5.2; see below for details)
  Cairo
  Pixman
  Boost
  Cups (not required on Windows)
  Fontconfig (not required on Windows)
  Freetype
  Libhunspell (if missing, spellchecker won't work)
  Libjpeg
  Libtiff
  Libxml2
  LittleCMS (version >= 2.1)
  Pkgconfig (Linux)
  PoDoFo
  Poppler, Poppler-data, and Poppler-cpp
  Python 2.7
  Python-Pillow
  Tk and Tkinter (required by some scripts shipped with Scribus)
 
 
'''sudo apt-get install qtbase5-dev qttools5-dev qttools5-dev-tools qt5-image-formats-plugins libpoppler-dev libpoppler-cpp-dev libpoppler-private-dev libhunspell-dev libicu-dev libharfbuzz-dev'''
 
For Scribus 1.5.3+
  Harfbuzz
  ICU (UC module)
  Qt 5.5+
 
For Scribus 1.5.5+
  Qt 5.7+
  C++11
 
On Linux, for each item you have to install both the main package and the development package (for example: cairo and cairo-devel, pixman and pixman-devel, and so on). Some packages should be already installed (for example, Cairo or CUPS).
 
====Getting and installing Qt5====
Starting with rev. 19790 (4 February 2015), Qt 5.2 or later is required.
 
If Qt5 is not present on your system, you have to install or build it.
 
You can download Qt5 from http://qt-project.org/downloads. Binary installers are available for Windows, Mac&nbsp;OS X and Linux. For Linux, if your distribution provides the latest Qt5, you can install it from its repositories (details for some distributions are listed below).
 
Also available is the source code, in case you want to build Qt5 yourself, or if an installer is not available for your operating system.
 
If you're using the Qt installer on Linux, make sure to make the file <code>qt-opensource-linux-x**-5.*.*.run</code> executable. You can do this via your chosen UI or the command line. The latter requires the following commands:
 
<code>chmode +x /path/to/qt-opensource-linux-x**-5.*.*.run</code>
 
To start the installation process, use the <code>cd</code> command to move into the installer's directory.
 
Next, run the following command:
 
<code>./qt-opensource-linux-x**-5.*.*.run</code>
 
If run without root privileges, the installer will suggest /home/username/Qt5.* as the installation directory. That's fine if you only want to test Scribus 1.5.x. If you also want to test the latest versions of other programmes using Qt5, you should install Qt5 with root privileges.
If you have Qt4 and Qt5 installed, and/or cmake does not find Qt5, you need to specify its location with the [[CMake_Build_Options#Qt5-Specific|build option]] -DQT_PREFIX="path-to-Qt5" (for example: -DQT_PREFIX="/home/user/Qt/5.1.1/gcc/")
 
In case you need a list, the required qt5 libs are : 
  Qt5Core
  Qt5Widgets
  Qt5Gui
  Qt5Xml
  Qt5WebKit
  Qt5WebKitWidgets
  Qt5Network
  Qt5OpenGL
  Qt5LinguistTools
  Qt5Quick
  Qt5PrintSupport
 
In case you got problems, Pygmee suggests too : "it build here after i've build sigil where it make a bit changes in QT5 config".
 
=====Debian=====
<div class="toccolours mw-collapsible mw-collapsed" style="width:800px;">
On Debian Testing, on top of the packages pulled in by apt-get build-dep you need. ---->
<div class="mw-collapsible-content">
'''sudo apt install libqt5webkit5-dev qtquick1-5-dev qtdeclarative5-dev \'''
                      '''qttools5-dev-tools qttools5-dev liblcms2-dev'''
'''sudo apt install libpoppler-private-dev'''  (3)
Note 1: They are all available in the official Debian repositories.
Note 2: This list should also apply for the latest Ubuntu release.
Note 3: Needed since Ubuntu-16.04 and its derivatives like Linux Mint.
</div></div>
 
=====Fedora 19 and later=====
<div class="toccolours mw-collapsible mw-collapsed" style="width:800px;">
Fedora 19 and later have Qt5 packages available from their repositories. The requirements seem to be  ---->
<div class="mw-collapsible-content">
'''yum install qt5-qtbase qt5-qtbase-devel qt5-qtdeclarative qt5-qtdeclarative-devel qt5-qttools \'''
            '''qt5-qttools-devel qt5-qtwebkit qt5-qtwebkit-devel qt5-qtbase-static'''
 
The above list will bring in '''qt5-qtbase-gui''' and possibly some other packages as dependencies. You might need also to install '''glibc-headers'''.
</div></div>
=====Notes on Fedora 28 &amp; 29=====
<div class="toccolours mw-collapsible mw-collapsed" style="width:800px;">
This will probably also work for Fedora 24 to 27 ---->
<div class="mw-collapsible-content">
Fedora now uses '''dnf''' instead of '''yum''' for package management. Using the following command will supply all the needed requirements for Scribus 1.5.x (note that some are optional features, such as OpenSceneGraph).
 
'''sudo dnf -y install boost-devel cairo-devel cups-devel fontconfig-devel freetype-devel GraphicsMagick-c++-devel GraphicsMagick-devel harfbuzz-devel hunspell-devel kernel-devel lcms2-devel libfreehand-devel libicu-devel libjpeg-turbo-devel libmspub-devel libpagemaker-devel libpng-devel libqxp-devel librevenge-devel libstdc++-devel libtiff-devel libvisio-devel libwpd-devel libxml2-devel libzmf-devel OpenSceneGraph-devel podofo-devel poppler-devel poppler-data poppler-data-devel poppler-cpp poppler-cpp-devel python-devel python-qt5-devel qt5-qtbase-devel qt5-qtdeclarative-devel qt5-qttools-devel qt5-qtwebkit-devel'''
 
Even though all of these are just the -devel packages, dnf will pull in all necessary additional requirements. Note that '''poppler-cpp''' and '''poppler-cpp-devel''' seem to be new requirements.
</div></div>
 
=====Notes on Fedora 38=====
<div class="toccolours mw-collapsible mw-collapsed" style="width:800px;">
This is focused on building Scribus 1.7.x SVN.
<div class="mw-collapsible-content">
Fedora now uses '''dnf''' instead of '''yum''' for package management. Using the following command will supply all the needed requirements for Scribus 1.7.x (note that some are optional features, such as OpenSceneGraph).
 
'''sudo dnf -y install boost-devel cairo-devel cups-devel fontconfig-devel freetype-devel GraphicsMagick-c++-devel GraphicsMagick-devel harfbuzz-devel hunspell-devel kernel-devel lcms2-devel libfreehand-devel libicu-devel libjpeg-turbo-devel libmspub-devel libpagemaker-devel libpng-devel libqxp-devel librevenge-devel libstdc++-devel libtiff-devel libvisio-devel libwpd-devel libxml2-devel libzmf-devel OpenSceneGraph-devel podofo-devel poppler-devel poppler-data poppler-data-devel poppler-cpp poppler-cpp-devel python-devel qt6-qtbase-devel qt6-qtdeclarative-devel qt6-qttools-devel python3-pyqt6-devel qt6-qtsvg-devel qt6-qt5compat-devel qt6-qtbase-private-devel'''


<pre>
mkdir ~/src/
mkdir ~/src/scribus_svn
sudo mkdir /usr/local/scribus_svn
cd ~/src/scribus_svn
svn co svn://scribus.info/Scribus/trunk/Scribus
cd ./Scribus
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/scribus_svn
make
sudo "make install"
</pre>


* 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...
</div></div>


== The easy way for Debian users ==
=====Ubuntu=====


If you're using Debian (or Ubuntu) you need to manually compile the SVN version, only if you want to be really really up to date.
'''Firstly, if you are running Ubuntu with version < 15.10, upgrade. As of Scribus 1.5.2, Qt 5.3 and cairo 1.14 are required.'''


Otherwise, you can rely on the .deb for scribus-ng in our own repositories or, if you don't find the packages for your platform (ppc, 64 bit) you can let apt-get compile from source using the latest sources in the repositories (most of the time those will be older than the SVN ones, but you probably don't really care).
<div class="toccolours mw-collapsible mw-collapsed" style="width:800px;">
Ubuntu v13.04 ---->
<div class="mw-collapsible-content">
* Initially install:
'''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:
'''sudo apt-get install libqt5declarative5-dev qtlocation5-dev qtsensors5-dev'''
* Install the usual libs '''not''' related to qt5 :
'''sudo apt-get install zlib1g-dev libpng12-dev libjpeg-dev libtiff5-dev libpython-all-dev \'''
                      '''libfreetype6-dev libcairo2-dev libcups2-dev libxml++2.6-dev liblcms2-dev'''
</div></div>


You first have to add the source line for deb-src in synaptic, then you should become root (<kbd>sudo -i</kbd>) and:
<div class="toccolours mw-collapsible mw-collapsed" style="width:800px;">
Ubuntu v13.10 ---->
<div class="mw-collapsible-content">
Almost the same as 13.04 except '''no qttools5''' and '''no libqt5declarative5-dev''' instead '''use qtdeclarative5-dev'''


<pre>
'''sudo apt-get install qt5-default qttools5-dev-tools libqt5location5 libqt5webkit5-dev libqt5webkit5 \'''
apt-get source scribus-ng;
                      '''qt5-qmake libqt5xml5 libqt5gui5 libqt5core5 qttools5-dev'''
cd scribus-ng-1.3.5.dfsg~svn20090208;
'''sudo apt-get install qtdeclarative5-dev qtlocation5-dev qtsensors5-dev'''
apt-get build-dep scribus-ng;
'''sudo apt-get install zlib1g-dev libpng12-dev libjpeg-dev libtiff5-dev libpython-all-dev \'''
debuild -us -uc; dpkg -i
                      '''libfreetype6-dev libcairo2-dev libcups2-dev libxml++2.6-dev liblcms2-dev'''
../scribus-ng_1.3.5.dfsg~svn20090208-3_i386.deb
</pre>


For more information on using Scribus with debian, please have a look at the [http://www.scribus.net/?q=debian Debian page our offical site]
# Note 1: There are bugs with qt5 version 5.0.2. Install qt5 version 5.2 with the installer found on https://qt-project.org/downloads.
# Note 2: (JLuc, 25 May 2014): I followed this procedure step by step and everything when right out of the box.
# Note 3 (unknown author) : In addition, I had to install: libgl1-mesa-dev and dependencies.
</div></div>


==First thing first: Download latest snapshot with Subversion==
<div class="toccolours mw-collapsible mw-collapsed" style="width:800px;">
Ubuntu v14.04 ---->
<div class="mw-collapsible-content">
This is how i compiles scribus 1.5 on a quite freshly installed Ubuntu 14.04  :
# Install scribus 1.5 out of the scribus friend's PPA (https://launchpad.net/~scribus/+archive/ubuntu/ppa). There are too many keyboard management bugs with this version, but it maybe installs some usefull libraries. Then uninstall it.
# Install cmake, g++ and subversion in case there are not there allready ("sudo apt-get install cmake" and "sudo apt-get install subversion")
# Install (using synaptics or sudo apt-get) the following libraries and their dependancies : libdrm-dev, libgl1-mesa-dev, libxml2-dev, libzip-dev, libfreetype6-dev, liblcms2-dev, libpodofo-dev, libcairo2-dev, libmagick++dev (maybe useless), libgraphicsmagick++1-dev, libcups2-dev, libpython2.7-dev, libpoppler-qt5-dev (maybe useless), libpoppler-cpp-dev, libpoppler-private-dev, libhunspell-dev
# Compile using maksvn script (https://github.com/JLuc/makscribus/blob/master/maksvn).
That's it !
</div></div>


Subversion is the versioning control system used for Scribus. Check [[Subversion | this link]] for instructions for using Subversion.
<div class="toccolours mw-collapsible mw-collapsed" style="width:800px;">
Ubuntu v16.04 ---->
<div class="mw-collapsible-content">
To compile scribus 1.5 on ubuntu 16.04, you need to follow:
# make sure that you installed QT as mention above.
# executed the the following commands to install required libraries:
'''<code> sudo apt-get update -qq;</code>''' <br />
'''<code> sudo apt-get install --force-yes cmake libboost-python-dev libcups2-dev libhunspell-dev libhyphen-dev liblcms2-dev libpodofo-dev libtiff-dev libxml2-dev python-all-dev zlib1g-dev libgraphicsmagick++1-dev libopenscenegraph-dev libpoppler-dev libpoppler-private-dev libcairo2-dev libwpg-dev libmspub-dev libcdr-dev libvisio-dev libharfbuzz-dev libharfbuzz-icu0 coreutils binutils python-tk</code>'''


All subversion URLs for Scribus anonsvn are based at:
</div></div>


'''svn://scribus.info/Scribus/'''
=====OpenSuse=====
'''Firstly, if you are running OpenSUSE with version < 13.2, upgrade. As of Scribus 1.5.2, Qt 5.3 and cairo 1.14 are required.'''
<div class="toccolours mw-collapsible mw-collapsed" style="width:800px;">
13.2 or newer ---->
<div class="mw-collapsible-content">
* Install the OS
* install Qt5 - sudo zypper in -t devel_qt5
* Install these packages via Yast2 or 'zypper in' from the command line:
python-devel
cairo-devel
hunspell-devel
cmake
subversion
cups-devel
libtiff-devel
liblcms2-devel
cups-devel
boost-devel
libjpeg8-devel
libtiff-devel
libpodofo-devel
libpoppler-devel
librevenge-devel
libcdr-devel
libmspub-devel
libvisio-devel
libfreehand-devel
* Proceed with Scribus compilation process.
</div></div>


There's also '''http://scribus.info/svn/Scribus/''' , which gets you to the same content, but '''svn://scribus.info/Scribus/''' is usually faster. HTTP access might be useful to those behind paranoid firewalls or proxies, though.
=====Windows=====
Please refer to [[Building_SVN_versions_on_Windows]]


If you used to check out -r <Version>, check out <SVN Path> instead:
=====Mac OSX=====
{| cellspacing="10" cellpadding="6"
<div class="toccolours mw-collapsible mw-collapsed" style="width:800px;">
! Version !! !! SVN Path !! Status
MacPorts (recommended by Scribus core-devs) ---->
|-
<div class="mw-collapsible-content">
|Version150 ||          ||/trunk/Scribus || **really unstable/development version**
Needs details
|-
</div></div>
|Version135 ||        ||/branches/Version135/Scribus || **unstable/development version**
|-
|Version133x ||        ||/branches/Version133x/Scribus || **stable version**
|}


So, if I wanted to use svn:// to check out 1.3.3.xsvn, I'd run:


<tt><b>svn co svn://scribus.info/Scribus/branches/Version133x/Scribus scribus133x</b></tt>
<div class="toccolours mw-collapsible mw-collapsed" style="width:800px;">
Homebrew Package Manager (Scribus community supported effort) ---->
<div class="mw-collapsible-content">
FYI, please don't post homebrew bugs on the bugtracker. Instead read the top notice on [[Scribus_and_Homebrew]].
'''1. brew tap scribusproject/scribus'''
'''2. brew install --HEAD scribus --verbose'''
'''3. brew linkapps --local scribus'''
'''4. Invoke with: ~/Applications/Scribus.app/Contents/MacOS/Scribus'''
</div></div>


Updating your working copy is much the same as cvs - just cd into your
===Additional dependencies for some graphics formats===
working copy and run "svn up" .
In 1.5.0+, there are a number of vector and bitmap graphics formats which can now be imported into Scribus. Some of these have particular additional dependencies.


====GraphicsMagick (Optional)====
You do not need GraphicsMagick to run cmake or compile 1.5.0svn, but some added import filters will be available if you have it (and cmake will detect it automatically). What Scribus needs are the following packages: graphicsmagick, graphicsmagick-devel, graphicsmagick-c++, and graphicsmagick-c++-devel.


Some links to learn more about downloading Scribus and about SVN:
====OpenSceneGraph (Optional)====
* There is an online reference for SVN at [http://svnbook.red-bean.com/nightly/en/index.html this site.]
This may be available with your Linux distribution (definitely for Fedora 17 and later). You can also [http://www.openscenegraph.org/projects/osg/wiki/Downloads download and compile] yourself.
* Once you have subversion installed, you can get some help for SVN at the command line by entering <tt>svn help</tt>
* See the installing section on [http://docs.scribus.net docs.scribus.net] for more info on the Official Documentation site.
* Craig Ringer [http://nashi.altmuehlnet.de/pipermail/scribus/2007-May/024130.html  explained how to use SVN with Scribus] on the list.


Thanks to Anduin.net [[http://anduin.net/]], anonymous SVN access is updated daily.
<div class="toccolours mw-collapsible mw-collapsed" style="width:800px;">
'''Fedora'''
<div class="mw-collapsible-content">
'''sudo yum install OpenSceneGraph OpenSceneGraph-devel'''


'''More info on downloading scribus:'''
should be enough, and will get you the additional requirements of Inventor, OpenThreads, and OpenThreads-devel.
*Standard download [http://docs.scribus.net/index.php?lang=en&page=download]
</div></div>
*CVS download [http://docs.scribus.net/index.php?lang=en&page=install1]
<div class="toccolours mw-collapsible mw-collapsed" style="width:800px;">
'''OpenSUSE'''
<div class="mw-collapsible-content">
go to http://software.opensuse.org/package/OpenSceneGraph and use the 1-click install procedure.
</div></div>
====MS Publisher and WPG Importers====


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.  
To build Scribus with support for MS Publisher and WPG files, you need [http://cgit.freedesktop.org/libreoffice/libmspub/ libmspub], as well as [http://libwpg.sourceforge.net/ libwpg] and [http://libwpd.sourceforge.net/ libwpd]. Note that the minimum version for PUB import is libmspub 0.0.6, and also that you want the development packages (libwpd-devel, libwpg-devel, libmspub-devel, for example in Fedora).


'''Watch out:'''
Update (June 2014): Scribus is now able to import MS Publisher, MS Visio and CorelDraw documents via librevenge. See [[Librevenge|this page]] for details.
*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.<br>You ''can'' install as a user, however, if you are installing into a directory you have write permission for. See the <tt>-DCMAKE_INSTALL_PREFIX</tt> command below.
* And if u 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.  


Good luck!
===Scribus 1.4.x===
===Getting All the Things You Need===
One method for obtaining and then building Scribus is to download the compressed tar file, for example from [https://sourceforge.net/projects/scribus/files/scribus/1.4.6/ https://sourceforge.net/projects/scribus/files/scribus/1.4.6/].
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 &ndash; none whatsoever.
Let's imagine you choose the one compressed with 7-zip, which is scribus-1.4.6.7z. Click the link to download, then on the command line go to the directory where it was saved (perhaps Downloads/). To extract this, type
<pre>
7z x scribus-1.4.6.7z
</pre>
which will create the directory '''scribus-1.4.6''', and inside this will be all the ingredients you need, aside from the dependencies mentioned below. As of this writing, qt4 is probably the basic Qt on your system.


The basic beginning packages needed are these, obtained with <code>yum install</code>... :
qt
* gcc
qt-devel
* gcc-c++
qtwebkit-devel
* cmake
poppler-devel              (on debian you might need poppler-private-dev too : see http://bugs.scribus.net/view.php?id=11162)
* subversion &ndash; if you're going to compile, you might as well get the latest Scribus updates
podofo-devel
ghostscript                  (this should already be bundled)
pkgconfig
lcms2-devel
libjpeg-devel
libtiff-devel
cups-devel
libxml2 and libxml2-devel (libxml2 should already be bundled)
python
python-devel
fontconfig-devel
openssl-devel              (?)
freetype
freetype-devel
python-pillow-devel  (formerly python-imaging-devel)
tk
tkinter
hunspell
hunspell-devel              (as of 1.4.2)
cairo                            (cairo should already be bundled)
cairo-devel
boost-devel


So if you follow the instructions above for downloading using <code>svn</code>, then use Cmake, you have ''many'' dependencies to deal with, so get these before you even try Cmake the first time:
<div class="toccolours mw-collapsible mw-collapsed" style="width:800px;">
* ghostscript &ndash; this should already be there
<big>For convenience, here is the above list listed all on the same line ----> </big>
* qt-devel
<div class="mw-collapsible-content">
* pkgconfig
apt-get install qt4 qt4-devel qtwebkit-devel poppler-devel podofo-devel ghostscript pkgconfig lcms2-devel libjpeg-devel libtiff-devel cups-devel libxml2 libxml2-devel python python-devel fontconfig-devel openssl-devel freetype freetype-devel python-pillow-devel tk tkinter hunspell hunspell-devel cairo cairo-devel boost-devel
* lcms-devel
</div></div>
* libjpeg-devel
* libtiff-devel
* libart_lgpl-devel
* cups-devel
* libxml2 and libxml2-devel &ndash; you should already have libxml2
* python and python-devel
* fontconfig-devel
* openssl-devel
* freetype and freetype-devel
* python-imaging-devel
* tk and tkinter


If you're going to be more adventuresome and compile 1.3.5svn, then you will need these:
Once you have all of these, along with '''cmake''', then cd inside the scribus1.4.6 directory and type
* cairo and cairo-devel &ndash; you should already have cairo
<pre>
* qt4 and qt4-devel
cmake ./
</pre>
for a basic setup so that Scribus 1.4.6 will be installed to the standard location. Scribus is still not built yet, so do this:
<pre>
make
</pre>
To install in this system location you need root privileges with '''sudo''' or '''su'''. Choose one of these, '''sudo''' will ask for your password (presuming you have administrative privileges), and '''su''' will ask for root's password.
<pre>
sudo make install


For Fedora at least, the names are as used with yum, for example:
su
make install
</pre>


<code>yum install qt-devel lcms-devel libjpeg-devel libtiff-devel</code>
In addition to the above each Linux distrubution has it's own quirks to be aware of. The subsections below work to address them:
====Fedora====
An advantage of building your own Scribus 1.4.6 in Fedora is that, in contrast to the Scribus you may find on the repository, your own built Scribus will have the online manual, which is lacking in Fedora's RPM package. Fedora now uses '''dnf''' for package management. This command should cover all that you need (for 1.4.6 &ndash; see above for the dnf command for 1.5.x):


and so on. On other distros the exact names may vary. [http://www.boyden.us/scribus.html Here is a link] describing the particulars for Ubuntu 7.10 (Gutsy Gibbon):
'''sudo dnf  qt  qt-devel qtwebkit-devel poppler-devel podofo-devel ghostscript-devel pkgconfig lcms2-devel libjpeg-devel libtiff-devel cups-devel libxml2 libxml2-devel python python-devel fontconfig-devel openssl-devel freetype freetype-devel python-pillow-devel tk tkinter hunspell  hunspell-devel cairo cairo-devel boost-devel'''


On <strong>Fedora</strong>, 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.
Something to note is that if you already have all the dependencies for 1.5.x, all you need to add is '''qt-devel'''.


====GraphicsMagick====
====Packages for Ubuntu====
You do not need GraphicsMagick to run cmake or compile 1.5.0svn, but some added capabilities will be present if you have it. What Scribus needs are the following (Fedora nomenclature): GraphicsMagick, GraphicsMagick-devel, GraphicsMagick-c++, and GraphicsMagick-c++-devel. These last two are tricky, since the message from cmake will tell you that GraphicsMagick++ is missing, but this is the name of the lib file, not the package.
{{Warning|Please update this section}}
To install all the required libraries and packages for Debian or Ubuntu type the following in a terminal:
sudo apt-get build-dep scribus-ng


Yum can help you with these kinds of things to avoid having to browse a repository.  
In March 2011 the build dependencies for Scribus 1.4.0 on Debian/Ubuntu were:
debhelper (>= 7), cmake (>= 2.4.3), gcc (>=3.3.5), libqt4-dev (>= 4.6), libcairo2-dev, zlib1g-dev,
liblcms1-dev (>= 1.13), libtiff4-dev, libcups2-dev,libxml2-dev (>= 2.6.16), gettext, python-all-dev,
libboost-python-dev, libaspell-dev, libpodofo-dev (>= 0.8.4), quilt


<tt>yum list GraphicMagick*</tt> will show a list of available packages
[http://www.boyden.us/scribus.html Here is a link] describing the particulars for Ubuntu 7.10 (Gutsy Gibbon).


<tt>yum install GraphicsMagick*</tt> will install all of them.
==== The easy way for Debian users ====
{{Warning|Please update this section}}
On <strong>Debian</strong>, if you install the develeopment packages as described above(<code>apt-get build-dep scribus-ng</code>) you will need the following packages to build the trunk (status September 2011):
* libqtwebkit-dev
* poppler-private-dev may be needed, see  {{b|11162}}
<strike>If you're using Debian (or Ubuntu) you need to manually compile the SVN version, only if you want to be really really up to date.


==Why Do I Have to 'Build' Scribus?==
Otherwise, you can rely on the .deb for scribus-ng in our own repositories or, if you don't find the packages for your platform (ppc for instance) you can let apt-get compile from source using the latest sources in the repositories (most of the time those will be older than the SVN ones, but you probably don't really care).
'''For that matter, what 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++ 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 PC can use them, and the program works efficiently.
You first have to add the source line for deb-src in synaptic, then you should become root (<kbd>sudo -i</kbd>) and:


The first step is to configure your downloaded directory of files. This requires a check of your PC 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 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.
<pre>
apt-get source scribus-ng;
cd scribus-ng-1.3.5.dfsg~svn20090208;
apt-get build-dep scribus-ng;
debuild -us -uc; dpkg -i
../scribus-ng_1.3.5.dfsg~svn20090208-3_i386.deb
</pre>
</strike>
For more information on using Scribus with debian, please have a look at the [http://www.scribus.net/?q=debian Debian page our offical site]
</div></div>


The Scribus Team now encourages 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 PC setup, where you want Scribus to be installed, for example.
== Build from Source ==
<span style="background-color: #FFFF00"><big>Moved from top of the page..being integrated [[User:Kunda|Kunda]] ([[User talk:Kunda|talk]]) 15:07, 29 June 2014 (CEST)</big><br />
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. </span>


Next, the actual 'build' process is done with a program called '''make'''. To start the process you simply enter <tt>make</tt> in a command line. That's it. You do not need to have ''root'' privileges to compile, and it is generally recommended that do not compile as root (one reason for this is that, by creating a number of files under root's name, you then interfere with subsequent updating from SVN). Compiling takes up a good part of your computer's resources, especially your processor(s), so you will find its performance rather sluggish while compiling is going on. Consequently, many find that compiling is best done by starting '''make''' and then walking away from the PC to let it do its work.
<span style="background-color: #FFFF00">'''Watch out:'''
<span style="background-color: #FFFF00">* 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.<br>You ''can'' install as a user, however, if you are installing into a directory you have write permission for. See the <tt>-DCMAKE_INSTALL_PREFIX</tt> command below.
<span style="background-color: #FFFF00">* 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.
</span>
------
Take as an example this following set of commands which are geared towards the Linux environment. Here we see a case in which there is a downloading of the Scribus development version (1.5, not yet stable), building it and then installing it. Note that this assumes that the environment has been prepared previously with all the dependencies installed.  


Finally, you need to install, done with the command <tt>make install</tt>. If you are going to install in the default location, you will need to have ''root'' privileges. On most Linux distros this can easily be done with the <tt>su</tt> command (after which you need root's password), or with '''sudo''', entered as <tt>sudo make install</tt>. You can run '''cmake''' with a command that can install Scribus in a directory for which you have write privileges, and therefore do not need to be '' root''.
<big><span style="background-color: #FFFF00">Recently moved from top of page. Still fine tuning how to represent this.</span></big>
{{Warning|You must have CMake version &ge; 2.8.9 (Older versions will fail). See: [[Official:Compile with CMake]]}}
<pre>
mkdir ~/src/
mkdir ~/src/scribus_svn
sudo mkdir /usr/local/scribus_svn
cd ~/src/scribus_svn
svn co svn://scribus.net/trunk/Scribus
cd ./Scribus
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/scribus_svn ..
make
sudo make install
</pre>


For this help, and other advice, continue reading the following sections.
'''Note:'''
* 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.
* in case you want to install the 1.4 stable version, replace the "svn" instruction with following : svn co svn://scribus.net/branches/Version14x/Scribus
<big><span style="background-color: #FFFF00">End of subsection</span></big>


==To start the build==
==Start the Build Process ==
Before continuing, please note that an out-of-source build is recommended, however..
Before continuing, please note that an out-of-source build is recommended, however..
From the Scribus directory:
From the Scribus directory:
Line 168: Line 533:
For example:
For example:


<code>/usr/local/bin/cmake . -DCMAKE_INSTALL_PREFIX:PATH=/opt/scribus134cvs</code>
<code>/usr/local/bin/cmake . -DCMAKE_INSTALL_PREFIX:PATH=/opt/scribus15svn</code>


Some options that the Scribus CMake files know about (more to come!):
Some options that the Scribus CMake files know about (more can be found here : http://wiki.scribus.net/canvas/CMake_Build_Options):
*WANT_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 <code>scribus-1.3.5svn</code>. This should mean that you can install multiple versions with the same prefix with no clashes.
*-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 <code>scribus-1.3.5svn</code>. This should mean that you can install multiple versions with the same prefix with no clashes.
*WANT_DEBUG=1: Sets the build to be a debug release and use -O0 -g3, instead of -O2 (This is the default for now, and cannot be turned off unless you edit the CMakeFiles.txt file).
*-DWANT_DEBUG=1: Sets the build to be a debug release and use -O0 -g3, instead of -O2 (This is the default for now, and cannot be turned off unless you edit the CMakeFiles.txt file).
*WANT_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+.
*<strike>-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+</strike>. ('''DEPRECATED''')
*WANT_LIBART=1 (not available in 1.3.5, default in 1.3.3.x): Makes CMake search for and build with LibArt_LGPL instead of cairo.
*-DWANT_LIBART=1 (not available in 1.3.5, default in 1.3.3.x): Makes CMake search for and build with LibArt_LGPL instead of cairo.
*WANT_QTARTHUR=1: In 1.3.5, uses the QT4 ARTHUR rendering library. This is an alternative to CAIRO.
*-DWANT_QTARTHUR=1: In 1.3.5, uses the QT4 ARTHUR rendering library. This is an alternative to CAIRO.
*-DWANT_HUNSPELL=1: This will enable the new (as of 1.4.2) hunspell-based spell checking capabilities across *all* platforms.


If you have several version of QT installed or QT is installed in a non standard location you'll have to tell cmake where to find it by setting <code>-DQT_QMAKE_EXECUTABLE</code>
If you have several version of QT installed or QT is installed in a non standard location you'll have to tell cmake where to find it by setting <code>-DQT_QMAKE_EXECUTABLE</code>


For example: to make a cairo debug build, then something like this:
<strike>For example: to make a cairo debug build, then something like this:</strike>


<code>/usr/local/bin/cmake . -DCMAKE_INSTALL_PREFIX:PATH=/opt/scribus134cvs -DWANT_CAIRO=1 -DWANT_DEBUG=1 -DWANT_VERSIONING=1</code>
<strike><code>/usr/local/bin/cmake . -DCMAKE_INSTALL_PREFIX:PATH=/opt/scribus134cvs -DWANT_CAIRO=1 -DWANT_DEBUG=1 -DWANT_VERSIONING=1</code></strike>


To use qt_arthur instead:
To use qt_arthur instead:
Line 187: Line 553:
<code>/usr/local/bin/cmake . -DCMAKE_INSTALL_PREFIX:PATH=/opt/scribus134cvs -DWANT_QTARTHUR=1 -DWANT_DEBUG=1 -DWANT_VERSIONING=1</code>
<code>/usr/local/bin/cmake . -DCMAKE_INSTALL_PREFIX:PATH=/opt/scribus134cvs -DWANT_QTARTHUR=1 -DWANT_DEBUG=1 -DWANT_VERSIONING=1</code>


==Out-of-source builds==
==Out-of-Source-Builds==
One of the advantages of CMake is that you can do an out-of-source build. What is this? It enables you to build the application without writing anything at all to the directory where the Scribus source is. This means your source tree is clean, always. Its easier and faster to update, and you can build multiple targets out-of-source from the same source tree. Cool!
One of the advantages of CMake is that you can do an out-of-source build. What is this? It enables you to build the application without writing anything at all to the directory where the Scribus source is. This means your source tree is clean, always. Its easier and faster to update, and you can build multiple targets out-of-source from the same source tree. Cool!


Line 201: Line 567:
So then, instead of doing:
So then, instead of doing:


<code>eg /usr/local/bin/cmake . -DCMAKE_INSTALL_PREFIX:PATH=/opt/scribus134cvs</code>
<code>cmake . -DCMAKE_INSTALL_PREFIX:PATH=/opt/scribus15svn</code>


you would then change to the builddir directory and run:
you would then change to the builddir directory and run:


<code>eg /usr/local/bin/cmake ../Scribus -DCMAKE_INSTALL_PREFIX:PATH=/opt/scribus134cvs</code>
<code>cmake ../Scribus -DCMAKE_INSTALL_PREFIX:PATH=/opt/scribus15svn</code>


Simple!
Simple!
==More CMake Options==
[[CMake_Build_Options]]


==Continuing on to the build stage==
==Continuing on to the build stage==
Line 220: Line 589:
*Checking it works on 64 bit distros
*Checking it works on 64 bit distros
*Add Win32 and Mac OSX support
*Add Win32 and Mac OSX support
==Compilation fails using Qt4 binaries==
Systems with both Qt3 and Qt4 installed: You have <code>uic</code> and <code>moc</code> from Qt4 in the path and it ''may'' results to the compilation crash. This should ''NOT'' be the case with cmake 2.4.2 when released, or when using current Scribus CVS. However, this might be a useful workaround:
Remove cached options from previous cmake configuration run:
<code>rm CMakeCache.txt</code>
Then change PATH variable (for my Gentoo) e.g.:
<code>export PATH=/usr/qt/3/bin/:$PATH</code>
And run cmake config phase again:
eg  <code>~/devel/CMAKE/bin/cmake . -DCMAKE_INSTALL_PREFIX:PATH=/path/to/install/to/scribuscmake/ </code>
==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.
On example of this is the [http://cairographics.org 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:
<code>-DPREFIX_CAIRO:PATH=/path/to/your/cairo/install</code>
==Instructions for specific distributions or versions==
*[[http://boyden.us/scribus.html Scribus 1.3.5svn for Ubuntu 7.10 "Gutsy Gibbon"]]


==Making a tarball for distribution==
==Making a tarball for distribution==
Line 278: Line 620:
Using $(PREFIX) is the key to avoiding hardcoded absolute path problem.
Using $(PREFIX) is the key to avoiding hardcoded absolute path problem.


=
==TODO==
==TODO==
*Enable more pkg-config usage
*Enable more pkg-config usage
*64 bit supoprt
*Prefixes for more packages
*Prefixes for more packages


==Success Stories==
Please add the operating system or distribution that you have tested successfully on:
*Gentoo, current (--[[User:Cbradney|Cbradney]] 17:04, 12 November 2006 (CET))
*Kubuntu Dapper Drake (--[[User:TomZ|TomZ]] 17:08, 12 November 2006 (CET))
*Ubuntu Feisty (--[[User:Oberten|Oberten]] 23 March 2007)
*Ubuntu Gutsy 32bits (--[[User:Brunod|Brunod]] 24 November 2007)
*Ubuntu Hardy (--[[User:a.l.e|a.l.e]] 30 May 2008)
*SuSE Linux 10.0 (--[[User:C_Schaefer|C_schaefer]] 19 November 2006)
*openSuse 10.1 (--[[User:TomZ|TomZ]] 17:08, 12 November 2006 (CET))
*OpenSuSE 10.2 (--[[User:C_Schaefer|C_schaefer]] 28 February 2007)
*OpenSUSE 10.3
*SUSE Linux Enterprise Desktop 10 (i586) --[[User:Mhanski|Mhanski]] 15:41, 21 April 2007 (CEST)
*Fedora Core 6 (--[[User:gpittman|gpittman]] 15:44, 12 November 2006 (EST))
*Fedora 8 i386 (--[[User:Zoonfafer|Zoonfafer]] 12:42, 10 December 2007 (CET))
*Fedora 9 (--[[User:Gpittman|G Pittman]])
*PLD Linux Th (--[[User:Deejay1|DeeJay1]] 09:52, 13 November 2006 (CET))
*Mandriva 2007 (--[[User:Leo|Leo]] [[mailto:leo.thealmighty@gmail.com]] 01:00, 16 November, 2006 (IST)) - a smooth ride
*PCLinuxOS 0.93a (--[[User:Leo|Leo]] [[mailto:leo.thealmighty@gmail.com]] few days before i tried mandriva 2007) - manualy specified lib locations


* MacOSX 10.4 Tiger (--[[User:Avox|avox]] 18:50, 1 March 2007 (CET)) check the advanced settings with ccmake, sometimes it doesnt pick up some paths
==Appimages==


*Debian Sid and Lenny (--[[User:Gemy_c|Gemy_c]] 06 August 2007 and for a long time ;) )
As an alternative to build scribus, you can download and use daily [[AppImages]]

Latest revision as of 21:11, 28 October 2024

Broom.png
This article needs to be cleaned up. Please update the information, remove factual errors, refresh category data, or correct the hyperlinks.

This page tries to describe how to build Scribus from source. The instructions mainly refer to building Scribus on Linux. Building on Mac OS and on Windows is not easy; you can find some explanations for Mac OS here, and for Windows here.

TL;DR (Too Long; Didn't Read)

You know what you are doing already and just want to compile Scribus via SVN, skip the introduction and go to Installing 1.5svn

Why would I Need or Want to 'Build' Scribus?

  1. For Necessity: You are using the current stable version, but certain bugs are a problem, and you know they have been fixed since the last release.
  2. For Science: You have heard about some new features in the development version, and you'd like to try them out.
  3. For the World: You're considering helping out the Scribus project and want to see how it's put together to get some idea about how you can help.

'Or, for that matter, what is this 'Building' you speak of?

Expand this content if you need a little bit more background on what Building source code means. --->

When you are going to build or compile Scribus, what you have downloaded (if you have downloaded the source code) 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.

Next, the actual 'build' process is done with a program called make. To start the process you simply enter make in a command line. That's it. You do not need to have root privileges to compile, and it is generally recommended that do not compile as root (one reason for this is that, by creating a number of files under root's name, you then interfere with subsequent updating from SVN). Compiling takes up a good part of your computer's resources, especially your processor(s), so you will find its performance rather sluggish while compiling is going on. Consequently, many find that compiling is best done by starting make and then walking away from the PC to let it do its work.

Finally, you need to install, done with the command make install. If you are going to install in the default location, you will need to have root privileges. On most Linux distros this can easily be done with the su command (after which you need root's password), or with sudo, entered as sudo make install. You can run cmake with a command that can install Scribus in a directory for which you have write privileges, and therefore do not need to be root.

For this help, and other advice, continue reading the following sections.

Fear is the mind Killer...

"Do not fear building Scribus from source" ~Paul Muad'dib Atreides

There is nothing to fear here, building Scribus yourself is not as hard as it sounds. You will not break your computer.

This page can teach a beginner many things at once: starting with beginning to comprehend the internals of Scribus to appreciating the Command Line shell and how to invoke commands through it. Learn how to install software libraries (components that Scribus utilizes) and go so far as to modify source code through applying patches. This exposure will help increase your skill set to work on most all platforms and widen your knowledge of software creation and maintenance.

1st: Download latest snapshot with Subversion

Subversion is the versioning control system used for Scribus. This allows multiple developers to hack on Scribus source code simultaneously. Check the Subversion page for further details on how to use this tool. Make sure you have svn installed. You don't need to learn all subversion commands and options: "svn co" and "svn up" might suffice, see below for examples.

You should create a directory in which the Scribus source code will be downloaded. Then change to that directory, and once you are there, you can download the source code with a simple command. You have to choose which branch you will download, as shown in the table below:

Status Version SVN Path Command to download from SVN
Development 1.5.x /trunk/Scribus svn co svn://scribus.net/trunk/Scribus scribus15
Development Snapshot 1.5.0 /trunk/Scribus revision 20099 svn co -r 20099 svn://scribus.net/trunk/Scribus scribus150
Stable 1.4.x /branches/Version14x/Scribus svn co svn://scribus.net/branches/Version14x/Scribus scribus14x
Outdated v.1.3.3x /branches/Version133x/Scribus svn co svn://scribus.net/branches/Version13x/Scribus scribus13x

Important Notes:

  • All subversion URLs for Scribus anonsvn are based at: svn://scribus.net/
  • Updating your working copy is much the same as cvs - just cd into your working copy and run "svn up".
  • 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.
  • If you used to check out -r <Version>, check out <SVN Path> instead


Thanks to Anduin.net, anonymous SVN access is updated daily.

Example

Here is an example of the commands for downloading the source code:

(This example is for Linux; on other platforms you should use the corresponding commands)

Let's suppose that you want to download the Scribus 1.5.0. source code in a directory called "scribussource" under your home directory. Here are the commands:

 mkdir ~/scribussource
 cd ~/scribussource
 svn co svn://scribus.net/trunk/Scribus

When subversion finishes downloading, you will find the source code in ~/scribussource/Scribus

If you have the source code and you want to update it to the latest version:

 cd ~/scribussource/Scribus
 svn up

2nd: Install methods: Package Manager, Source, Out-of-Source Build

Essential tools

Before going further, we must understand that in order for anything to get built, tools need to exist. In modern OS's especially Linux many of these are build tools arrive already bundled. If they aren't for some reason you will need to install them manually (see package manager)

  • gcc
  • gcc-c++
  • cmake (version ≥ 2.8.9)
  • subversion – if you're going to compile, you might as well get the latest Scribus updates

There are several option for installation.

Package Managers

Note: many Linux distros have their own Package Managers i.e. Debian has apt, Fedora and Centos have yum, more recently superceded by dnf, Redhat uses rpm etc... On Mac OS X there are several choices, most popular are Macports and Homebrew. In general, by utilizing the installed package manager we can streamline the installations through easy one liners which will automate the install. We do this by invoking the following pattern:

(package-manager) install (software-or-library-package-name)

Debian;    apt-get install cmake
Fedora:    dnf install cmake
MacOSXbrew install cmake

Specific Dependencies

Dependencies are considered to be 3rd party software libraries or other altogether unique software projects that are have components that are needed to build a specific project from. When we want to build Scribus we need to make sure that we have all the dependencies fulfilled or else it will complain to us about missing components or obsolete ones. The following section assumes you need to manually install dependencies. Here are the list of package names that will be needed to be installed before attempting to build Scribus. Each major version of Scribus will require different dependencies.

Version 1.7.x

Ubuntu

Ubuntu v23.04 ---->

  • Run apt-get build-dep scribus . You may need to enable the sources repository first.
  • Initially install:
sudo apt-get install libqt6core5compat6-dev libqt6svg6-dev linguist-qt6 qt6-base-dev qt6-base-dev-tools qt6-base-private-dev qt6-gtk-platformtheme qt6-image-formats-plugins qt6-l10n-tools qt6-svg-dev qt6-tools-dev qt6-tools-dev-tools qt6-translations-l10n 
  • Install the usual libs not related to qt5 :
sudo apt-get install zlib1g-dev libpng12-dev libjpeg-dev libtiff5-dev libpython-all-dev \
                     libfreetype6-dev libcairo2-dev libcups2-dev libxml++2.6-dev liblcms2-dev

Ubuntu v24.04 ---->

  • Run apt-get build-dep scribus . You may need to enable the sources repository first.
  • Initially install:
sudo apt-get install libqt6core5compat6-dev libqt6svg6-dev linguist-qt6 qt6-base-dev qt6-base-dev-tools qt6-base-private-dev qt6-gtk-platformtheme qt6-image-formats-plugins qt6-l10n-tools qt6-svg-dev qt6-tools-dev qt6-tools-dev-tools qt6-translations-l10n 
  • Install the usual libs not related to qt5 :
sudo apt-get install zlib1g-dev libpng-dev libjpeg-dev libtiff5-dev libpython3-all-dev \
                     libfreetype6-dev libcairo2-dev libcups2-dev libxml++2.6-dev liblcms2-dev

Version 1.5.x

Here is a list of dependencies for Scribus 1.5.x:

 Qt (version >= 5.2; see below for details)
 Cairo
 Pixman
 Boost
 Cups (not required on Windows)
 Fontconfig (not required on Windows)
 Freetype
 Libhunspell (if missing, spellchecker won't work)
 Libjpeg
 Libtiff
 Libxml2
 LittleCMS (version >= 2.1)
 Pkgconfig (Linux)
 PoDoFo
 Poppler, Poppler-data, and Poppler-cpp
 Python 2.7
 Python-Pillow
 Tk and Tkinter (required by some scripts shipped with Scribus)


sudo apt-get install qtbase5-dev qttools5-dev qttools5-dev-tools qt5-image-formats-plugins libpoppler-dev libpoppler-cpp-dev libpoppler-private-dev libhunspell-dev libicu-dev libharfbuzz-dev

For Scribus 1.5.3+

 Harfbuzz
 ICU (UC module)
 Qt 5.5+

For Scribus 1.5.5+

 Qt 5.7+
 C++11

On Linux, for each item you have to install both the main package and the development package (for example: cairo and cairo-devel, pixman and pixman-devel, and so on). Some packages should be already installed (for example, Cairo or CUPS).

Getting and installing Qt5

Starting with rev. 19790 (4 February 2015), Qt 5.2 or later is required.

If Qt5 is not present on your system, you have to install or build it.

You can download Qt5 from http://qt-project.org/downloads. Binary installers are available for Windows, Mac OS X and Linux. For Linux, if your distribution provides the latest Qt5, you can install it from its repositories (details for some distributions are listed below).

Also available is the source code, in case you want to build Qt5 yourself, or if an installer is not available for your operating system.

If you're using the Qt installer on Linux, make sure to make the file qt-opensource-linux-x**-5.*.*.run executable. You can do this via your chosen UI or the command line. The latter requires the following commands:

chmode +x /path/to/qt-opensource-linux-x**-5.*.*.run

To start the installation process, use the cd command to move into the installer's directory.

Next, run the following command:

./qt-opensource-linux-x**-5.*.*.run

If run without root privileges, the installer will suggest /home/username/Qt5.* as the installation directory. That's fine if you only want to test Scribus 1.5.x. If you also want to test the latest versions of other programmes using Qt5, you should install Qt5 with root privileges.

If you have Qt4 and Qt5 installed, and/or cmake does not find Qt5, you need to specify its location with the build option -DQT_PREFIX="path-to-Qt5" (for example: -DQT_PREFIX="/home/user/Qt/5.1.1/gcc/")

In case you need a list, the required qt5 libs are :

 Qt5Core
 Qt5Widgets
 Qt5Gui
 Qt5Xml
 Qt5WebKit
 Qt5WebKitWidgets
 Qt5Network
 Qt5OpenGL
 Qt5LinguistTools
 Qt5Quick
 Qt5PrintSupport

In case you got problems, Pygmee suggests too : "it build here after i've build sigil where it make a bit changes in QT5 config".

Debian

On Debian Testing, on top of the packages pulled in by apt-get build-dep you need. ---->

sudo apt install libqt5webkit5-dev qtquick1-5-dev qtdeclarative5-dev \
                     qttools5-dev-tools qttools5-dev liblcms2-dev
sudo apt install libpoppler-private-dev  (3)
Note 1: They are all available in the official Debian repositories.
Note 2: This list should also apply for the latest Ubuntu release.
Note 3: Needed since Ubuntu-16.04 and its derivatives like Linux Mint.
Fedora 19 and later

Fedora 19 and later have Qt5 packages available from their repositories. The requirements seem to be ---->

yum install qt5-qtbase qt5-qtbase-devel qt5-qtdeclarative qt5-qtdeclarative-devel qt5-qttools \
            qt5-qttools-devel qt5-qtwebkit qt5-qtwebkit-devel qt5-qtbase-static

The above list will bring in qt5-qtbase-gui and possibly some other packages as dependencies. You might need also to install glibc-headers.

Notes on Fedora 28 & 29

This will probably also work for Fedora 24 to 27 ---->

Fedora now uses dnf instead of yum for package management. Using the following command will supply all the needed requirements for Scribus 1.5.x (note that some are optional features, such as OpenSceneGraph).

sudo dnf -y install boost-devel cairo-devel cups-devel fontconfig-devel freetype-devel GraphicsMagick-c++-devel GraphicsMagick-devel harfbuzz-devel hunspell-devel kernel-devel lcms2-devel libfreehand-devel libicu-devel libjpeg-turbo-devel libmspub-devel libpagemaker-devel libpng-devel libqxp-devel librevenge-devel libstdc++-devel libtiff-devel libvisio-devel libwpd-devel libxml2-devel libzmf-devel OpenSceneGraph-devel podofo-devel poppler-devel poppler-data poppler-data-devel poppler-cpp poppler-cpp-devel python-devel python-qt5-devel qt5-qtbase-devel qt5-qtdeclarative-devel qt5-qttools-devel qt5-qtwebkit-devel

Even though all of these are just the -devel packages, dnf will pull in all necessary additional requirements. Note that poppler-cpp and poppler-cpp-devel seem to be new requirements.

Notes on Fedora 38

This is focused on building Scribus 1.7.x SVN.

Fedora now uses dnf instead of yum for package management. Using the following command will supply all the needed requirements for Scribus 1.7.x (note that some are optional features, such as OpenSceneGraph).

sudo dnf -y install boost-devel cairo-devel cups-devel fontconfig-devel freetype-devel GraphicsMagick-c++-devel GraphicsMagick-devel harfbuzz-devel hunspell-devel kernel-devel lcms2-devel libfreehand-devel libicu-devel libjpeg-turbo-devel libmspub-devel libpagemaker-devel libpng-devel libqxp-devel librevenge-devel libstdc++-devel libtiff-devel libvisio-devel libwpd-devel libxml2-devel libzmf-devel OpenSceneGraph-devel podofo-devel poppler-devel poppler-data poppler-data-devel poppler-cpp poppler-cpp-devel python-devel qt6-qtbase-devel qt6-qtdeclarative-devel qt6-qttools-devel python3-pyqt6-devel qt6-qtsvg-devel qt6-qt5compat-devel qt6-qtbase-private-devel


Ubuntu

Firstly, if you are running Ubuntu with version < 15.10, upgrade. As of Scribus 1.5.2, Qt 5.3 and cairo 1.14 are required.

Ubuntu v13.04 ---->

  • Initially install:
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:
sudo apt-get install libqt5declarative5-dev qtlocation5-dev qtsensors5-dev 
  • Install the usual libs not related to qt5 :
sudo apt-get install zlib1g-dev libpng12-dev libjpeg-dev libtiff5-dev libpython-all-dev \
                     libfreetype6-dev libcairo2-dev libcups2-dev libxml++2.6-dev liblcms2-dev

Ubuntu v13.10 ---->

Almost the same as 13.04 except no qttools5 and no libqt5declarative5-dev instead use qtdeclarative5-dev

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 apt-get install zlib1g-dev libpng12-dev libjpeg-dev libtiff5-dev libpython-all-dev \
                     libfreetype6-dev libcairo2-dev libcups2-dev libxml++2.6-dev liblcms2-dev
  1. Note 1: There are bugs with qt5 version 5.0.2. Install qt5 version 5.2 with the installer found on https://qt-project.org/downloads.
  2. Note 2: (JLuc, 25 May 2014): I followed this procedure step by step and everything when right out of the box.
  3. Note 3 (unknown author) : In addition, I had to install: libgl1-mesa-dev and dependencies.

Ubuntu v14.04 ---->

This is how i compiles scribus 1.5 on a quite freshly installed Ubuntu 14.04  :

  1. Install scribus 1.5 out of the scribus friend's PPA (https://launchpad.net/~scribus/+archive/ubuntu/ppa). There are too many keyboard management bugs with this version, but it maybe installs some usefull libraries. Then uninstall it.
  2. Install cmake, g++ and subversion in case there are not there allready ("sudo apt-get install cmake" and "sudo apt-get install subversion")
  3. Install (using synaptics or sudo apt-get) the following libraries and their dependancies : libdrm-dev, libgl1-mesa-dev, libxml2-dev, libzip-dev, libfreetype6-dev, liblcms2-dev, libpodofo-dev, libcairo2-dev, libmagick++dev (maybe useless), libgraphicsmagick++1-dev, libcups2-dev, libpython2.7-dev, libpoppler-qt5-dev (maybe useless), libpoppler-cpp-dev, libpoppler-private-dev, libhunspell-dev
  4. Compile using maksvn script (https://github.com/JLuc/makscribus/blob/master/maksvn).

That's it !

Ubuntu v16.04 ---->

To compile scribus 1.5 on ubuntu 16.04, you need to follow:

  1. make sure that you installed QT as mention above.
  2. executed the the following commands to install required libraries:

sudo apt-get update -qq;
sudo apt-get install --force-yes cmake libboost-python-dev libcups2-dev libhunspell-dev libhyphen-dev liblcms2-dev libpodofo-dev libtiff-dev libxml2-dev python-all-dev zlib1g-dev libgraphicsmagick++1-dev libopenscenegraph-dev libpoppler-dev libpoppler-private-dev libcairo2-dev libwpg-dev libmspub-dev libcdr-dev libvisio-dev libharfbuzz-dev libharfbuzz-icu0 coreutils binutils python-tk

OpenSuse

Firstly, if you are running OpenSUSE with version < 13.2, upgrade. As of Scribus 1.5.2, Qt 5.3 and cairo 1.14 are required.

13.2 or newer ---->

  • Install the OS
  • install Qt5 - sudo zypper in -t devel_qt5
  • Install these packages via Yast2 or 'zypper in' from the command line:

python-devel cairo-devel hunspell-devel cmake subversion cups-devel libtiff-devel liblcms2-devel cups-devel boost-devel libjpeg8-devel libtiff-devel libpodofo-devel libpoppler-devel librevenge-devel libcdr-devel libmspub-devel libvisio-devel libfreehand-devel

  • Proceed with Scribus compilation process.
Windows

Please refer to Building_SVN_versions_on_Windows

Mac OSX

MacPorts (recommended by Scribus core-devs) ---->

Needs details


Homebrew Package Manager (Scribus community supported effort) ---->

FYI, please don't post homebrew bugs on the bugtracker. Instead read the top notice on Scribus_and_Homebrew.

1. brew tap scribusproject/scribus
2. brew install --HEAD scribus --verbose
3. brew linkapps --local scribus
4. Invoke with: ~/Applications/Scribus.app/Contents/MacOS/Scribus

Additional dependencies for some graphics formats

In 1.5.0+, there are a number of vector and bitmap graphics formats which can now be imported into Scribus. Some of these have particular additional dependencies.

GraphicsMagick (Optional)

You do not need GraphicsMagick to run cmake or compile 1.5.0svn, but some added import filters will be available if you have it (and cmake will detect it automatically). What Scribus needs are the following packages: graphicsmagick, graphicsmagick-devel, graphicsmagick-c++, and graphicsmagick-c++-devel.

OpenSceneGraph (Optional)

This may be available with your Linux distribution (definitely for Fedora 17 and later). You can also download and compile yourself.

Fedora

sudo yum install OpenSceneGraph OpenSceneGraph-devel

should be enough, and will get you the additional requirements of Inventor, OpenThreads, and OpenThreads-devel.

OpenSUSE

go to http://software.opensuse.org/package/OpenSceneGraph and use the 1-click install procedure.

MS Publisher and WPG Importers

To build Scribus with support for MS Publisher and WPG files, you need libmspub, as well as libwpg and libwpd. Note that the minimum version for PUB import is libmspub 0.0.6, and also that you want the development packages (libwpd-devel, libwpg-devel, libmspub-devel, for example in Fedora).

Update (June 2014): Scribus is now able to import MS Publisher, MS Visio and CorelDraw documents via librevenge. See this page for details.

Scribus 1.4.x

One method for obtaining and then building Scribus is to download the compressed tar file, for example from https://sourceforge.net/projects/scribus/files/scribus/1.4.6/.

Let's imagine you choose the one compressed with 7-zip, which is scribus-1.4.6.7z. Click the link to download, then on the command line go to the directory where it was saved (perhaps Downloads/). To extract this, type

7z x scribus-1.4.6.7z

which will create the directory scribus-1.4.6, and inside this will be all the ingredients you need, aside from the dependencies mentioned below. As of this writing, qt4 is probably the basic Qt on your system.

qt
qt-devel
qtwebkit-devel
poppler-devel              (on debian you might need poppler-private-dev too : see http://bugs.scribus.net/view.php?id=11162)
podofo-devel
ghostscript                   (this should already be bundled)
pkgconfig
lcms2-devel
libjpeg-devel
libtiff-devel
cups-devel
libxml2 and libxml2-devel (libxml2 should already be bundled)
python
python-devel
fontconfig-devel
openssl-devel               (?)
freetype
freetype-devel
python-pillow-devel  (formerly python-imaging-devel)
tk 
tkinter
hunspell 
hunspell-devel              (as of 1.4.2)
cairo                             (cairo should already be bundled)
cairo-devel 
boost-devel

For convenience, here is the above list listed all on the same line ---->

apt-get install qt4 qt4-devel qtwebkit-devel poppler-devel podofo-devel ghostscript pkgconfig lcms2-devel libjpeg-devel libtiff-devel cups-devel libxml2 libxml2-devel python python-devel fontconfig-devel openssl-devel freetype freetype-devel python-pillow-devel tk tkinter hunspell hunspell-devel cairo cairo-devel boost-devel

Once you have all of these, along with cmake, then cd inside the scribus1.4.6 directory and type

cmake ./

for a basic setup so that Scribus 1.4.6 will be installed to the standard location. Scribus is still not built yet, so do this:

make

To install in this system location you need root privileges with sudo or su. Choose one of these, sudo will ask for your password (presuming you have administrative privileges), and su will ask for root's password.

sudo make install

su
make install

In addition to the above each Linux distrubution has it's own quirks to be aware of. The subsections below work to address them:

Fedora

An advantage of building your own Scribus 1.4.6 in Fedora is that, in contrast to the Scribus you may find on the repository, your own built Scribus will have the online manual, which is lacking in Fedora's RPM package. Fedora now uses dnf for package management. This command should cover all that you need (for 1.4.6 – see above for the dnf command for 1.5.x):

sudo dnf qt qt-devel qtwebkit-devel poppler-devel podofo-devel ghostscript-devel pkgconfig lcms2-devel libjpeg-devel libtiff-devel cups-devel libxml2 libxml2-devel python python-devel fontconfig-devel openssl-devel freetype freetype-devel python-pillow-devel tk tkinter hunspell hunspell-devel cairo cairo-devel boost-devel

Something to note is that if you already have all the dependencies for 1.5.x, all you need to add is qt-devel.

Packages for Ubuntu

Warning Warning: Please update this section

To install all the required libraries and packages for Debian or Ubuntu type the following in a terminal:

sudo apt-get build-dep scribus-ng

In March 2011 the build dependencies for Scribus 1.4.0 on Debian/Ubuntu were:

debhelper (>= 7), cmake (>= 2.4.3), gcc (>=3.3.5), libqt4-dev (>= 4.6), libcairo2-dev, zlib1g-dev,
liblcms1-dev (>= 1.13), libtiff4-dev, libcups2-dev,libxml2-dev (>= 2.6.16), gettext, python-all-dev,
libboost-python-dev, libaspell-dev, libpodofo-dev (>= 0.8.4), quilt

Here is a link describing the particulars for Ubuntu 7.10 (Gutsy Gibbon).

The easy way for Debian users

Warning Warning: Please update this section

On Debian, if you install the develeopment packages as described above(apt-get build-dep scribus-ng) you will need the following packages to build the trunk (status September 2011):

  • libqtwebkit-dev
  • poppler-private-dev may be needed, see 11162

If you're using Debian (or Ubuntu) you need to manually compile the SVN version, only if you want to be really really up to date.

Otherwise, you can rely on the .deb for scribus-ng in our own repositories or, if you don't find the packages for your platform (ppc for instance) you can let apt-get compile from source using the latest sources in the repositories (most of the time those will be older than the SVN ones, but you probably don't really care).

You first have to add the source line for deb-src in synaptic, then you should become root (sudo -i) and:

apt-get source scribus-ng;
cd scribus-ng-1.3.5.dfsg~svn20090208;
apt-get build-dep scribus-ng;
debuild -us -uc; dpkg -i 
../scribus-ng_1.3.5.dfsg~svn20090208-3_i386.deb

For more information on using Scribus with debian, please have a look at the Debian page our offical site

Build from Source

Moved from top of the page..being integrated Kunda (talk) 15:07, 29 June 2014 (CEST)
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.

Watch out: * 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.


Take as an example this following set of commands which are geared towards the Linux environment. Here we see a case in which there is a downloading of the Scribus development version (1.5, not yet stable), building it and then installing it. Note that this assumes that the environment has been prepared previously with all the dependencies installed.

Recently moved from top of page. Still fine tuning how to represent this.

Warning Warning: You must have CMake version ≥ 2.8.9 (Older versions will fail). See: Official:Compile with CMake
mkdir ~/src/
mkdir ~/src/scribus_svn
sudo mkdir /usr/local/scribus_svn
cd ~/src/scribus_svn
svn co svn://scribus.net/trunk/Scribus
cd ./Scribus
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/scribus_svn ..
make
sudo make install

Note:

  • 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.
  • in case you want to install the 1.4 stable version, replace the "svn" instruction with following : svn co svn://scribus.net/branches/Version14x/Scribus

End of subsection

Start the Build Process

Before continuing, please note that an out-of-source build is recommended, however.. From the Scribus directory:

/path/to/cmake . -DCMAKE_INSTALL_PREFIX:PATH=/path/to/install/to/scribuscmake/

For example:

/usr/local/bin/cmake . -DCMAKE_INSTALL_PREFIX:PATH=/opt/scribus15svn

Some options that the Scribus CMake files know about (more can be found here : http://wiki.scribus.net/canvas/CMake_Build_Options):

  • -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_DEBUG=1: Sets the build to be a debug release and use -O0 -g3, instead of -O2 (This is the default for now, and cannot be turned off unless you edit the CMakeFiles.txt file).
  • -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+. (DEPRECATED)
  • -DWANT_LIBART=1 (not available in 1.3.5, default in 1.3.3.x): Makes CMake search for and build with LibArt_LGPL instead of cairo.
  • -DWANT_QTARTHUR=1: In 1.3.5, uses the QT4 ARTHUR rendering library. This is an alternative to CAIRO.
  • -DWANT_HUNSPELL=1: This will enable the new (as of 1.4.2) hunspell-based spell checking capabilities across *all* platforms.

If you have several version of QT installed or QT is installed in a non standard location you'll have to tell cmake where to find it by setting -DQT_QMAKE_EXECUTABLE

For example: to make a cairo debug build, then something like this:

/usr/local/bin/cmake . -DCMAKE_INSTALL_PREFIX:PATH=/opt/scribus134cvs -DWANT_CAIRO=1 -DWANT_DEBUG=1 -DWANT_VERSIONING=1

To use qt_arthur instead:

/usr/local/bin/cmake . -DCMAKE_INSTALL_PREFIX:PATH=/opt/scribus134cvs -DWANT_QTARTHUR=1 -DWANT_DEBUG=1 -DWANT_VERSIONING=1

Out-of-Source-Builds

One of the advantages of CMake is that you can do an out-of-source build. What is this? It enables you to build the application without writing anything at all to the directory where the Scribus source is. This means your source tree is clean, always. Its easier and faster to update, and you can build multiple targets out-of-source from the same source tree. Cool!

To do an out-of-source build, you need a new directory to build in. Say you have the source files in:

/home/username/scribuscmake/Scribus

Make the following directory:

/home/username/scribuscmake/builddir

So then, instead of doing:

cmake . -DCMAKE_INSTALL_PREFIX:PATH=/opt/scribus15svn

you would then change to the builddir directory and run:

cmake ../Scribus -DCMAKE_INSTALL_PREFIX:PATH=/opt/scribus15svn

Simple!

More CMake Options

CMake_Build_Options

Continuing on to the build stage

Once this has successfully completed, simply run make && make install.

The CMake based build system is very new to Scribus and it will change and it will need improving. Please report issues on our mailing list or bugtracker.

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

Making a tarball for distribution

To make a tarball for distribution, the old way would be to 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

If you package Scribus for a distribution keep in mind the issue of the install prefix versus temporary install directory prefix. The following seems to work well for Debian packaging:

>_______mkdir -p $(BUILD_DIR)

>_______cd $(BUILD_DIR) && $(CMAKE) \
>_______    -DWANT_DEBUG:STRING=$(DEBUG_FLAG) \
>_______    -DCMAKE_INSTALL_PREFIX:PATH=/usr \
>_______    -DCMAKE_SKIP_RPATH:BOOL=1 \
>_______    -DRPATH_STYLE:STRING=none \
>_______    -DWANT_VERSIONING:BOOL=1 \
>_______    -DCUSTOM_VERSIONTAG:STRING=-ng \
>_______    -DCMAKE_CXX_FLAGS:STRING='-o2 -g -Wall' \
>_______    -DCMAKE_C_FLAGS:STRING='-o2 -g -Wall' ../../

then

>_______$(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.

=

TODO

  • Enable more pkg-config usage
  • Prefixes for more packages


Appimages

As an alternative to build scribus, you can download and use daily AppImages