Building Scribus-1.4.0rc3 on Solaris 10


Being a Qt application, Scribus builds on Solaris 10 without much trouble. The only thing that deserves some attention is its CUPS dependency.

If no local CUPS installation is present – and on a stock Solaris 10 system there isn't – it is necessary to build one first. Note that this does not mean that CUPS has to be the system's print spooler, because it can be used in client-only mode. In this case it can use another CUPS server on the net or even Solaris 10's IPP service which is not based on CUPS but should be compatible. This means that cupsd does not have to run locally at all.

The rest of the build is straightforward.

I used the following prerequisite packages in addition to CUPS and Qt – all of them installed from source with prefix /usr/local/dist:

The GNU make version in use was 3.80. GCC, if used, was 4.5.2. The build took place on a Solaris 10 x86 machine, but there is no reason why it shouldn't work on SPARC.

Prerequisites: CUPS and Qt

Scribus recommends GCC and also uses some hard-coded GCC flags, so a GCC ABI should be preferred when building Qt, appropriately indicated by the installation prefix.

Package Compiler used Remarks
cups-1.4.6 Solaris Studio 12.2 The source needs a patch to enable Kerberos support – at least on Solaris 10 10/08:
echo '--- cups-1.4.6-org/cups/http-private.h  Mon Apr 12 06:03:53 2010
+++ cups-1.4.6/cups/http-private.h      Mon May 30 00:11:04 2011
@@ -57,6 +57,9 @@
 #      define GSS_C_NT_HOSTBASED_SERVICE gss_nt_service_name
 #    ifdef HAVE_KRB5_H
+#ifdef __cplusplus
+extern "C" {
 #      include <krb5.h>
 #    endif /* HAVE_KRB5_H */
 #  endif /* HAVE_GSSAPI */'\
| gpatch -p1

Configuration and (non-root) installation:

ac_cv_func_statfs=no \
./configure \
--prefix=/usr/local/dist/cups-1.4.6 \
--with-rcdir=/usr/local/dist/cups-1.4.6/etc \
--with-menudir=/usr/local/dist/cups-1.4.6/share/applications \
--with-icondir=/usr/local/dist/cups-1.4.6/share/icons \
CC=cc CXX=CC \
LDFLAGS="-L/usr/lib/mps -R/usr/lib/mps -lnss3"
make install
Qt-4.7.3 gcc-4.5.2

Configuration and installation:

./configure -platform solaris-g++ \
    -prefix /usr/local/dist/qt-4.7.3-g++4 -opensource \
    -R /usr/local/dist/gcc-4.5.2/lib \
    -R /usr/sfw/lib \
    -R /usr/openwin/sfw/lib
    -L /usr/local/dist/gcc-4.5.2/lib \
gmake -j3
gmake install

(It is necessary to include an explicit library path to GCC's directory if libraries in /usr/sfw/lib are used, because on Solaris 10 an older GCC library is in that directory.)


Scribus needs a little patch to prevent the use of glibc API (Solaris would provide equivalent functions in walkcontext and cplus_demangle, but it's not really important):

echo 'diff -rub scribus-1.4.0.rc3/scribus/util.cpp scribus-1.4.0.rc3.sol10/scribus/util.cpp
--- scribus-1.4.0.rc3/scribus/util.cpp  Sun Oct 31 11:44:16 2010
+++ scribus-1.4.0.rc3.sol10/scribus/util.cpp    Tue May 31 00:03:00 2011
@@ -35,7 +35,7 @@

 #include <signal.h>

-#if !defined(_WIN32) && !defined(Q_OS_MAC) 
+#if !defined(_WIN32) && !defined(Q_OS_MAC) && !defined(Q_OS_SOLARIS)
 #include <execinfo.h>
 #include <cxxabi.h>
@@ -937,7 +937,7 @@
 void printBacktrace ( int nFrames )
-#if !defined(_WIN32) && !defined(Q_OS_MAC) && !defined(Q_OS_OPENBSD)  && !defined(Q_OS_FREEBSD)
+#if !defined(_WIN32) && !defined(Q_OS_MAC) && !defined(Q_OS_SOLARIS) && !defined(Q_OS_OPENBSD)  && !defined(Q_OS_FREEBSD)
'"\t"'void ** trace = new void*[nFrames + 1];
'"\t"'char **messages = ( char ** ) NULL;
'"\t"'int i, trace_size = 0;'\
| gpatch -p1

After that, the build works as follows:

export PKG_CONFIG_PATH=/usr/local/dist/lib/pkgconfig:/usr/lib/pkgconfig
export PATH=/usr/local/dist/qt-4.7.3-g++4/bin:/usr/local/dist/bin:$PATH
mkdir build
cd build

# create the makefiles
cmake .. \
-DCMAKE_INSTALL_PREFIX:PATH=/usr/local/dist/scribus-1.4.0rc3 \
-DCMAKE_INCLUDE_PATH=/usr/local/dist/cups-1.4.6/include \

# build it
make install

Last update 2011-06-17