gnu: python-babel: Update to 2.7.0.
[guix.git] / gnu / packages / scribus.scm
blob20795da2753116b86e8731cee4325ff1418f0c3a
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2018 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2017, 2018 Nicolas Goaziou <mail@nicolasgoaziou.fr>
5 ;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
22 (define-module (gnu packages scribus)
23   #:use-module (guix packages)
24   #:use-module (guix download)
25   #:use-module (guix utils)
26   #:use-module ((guix licenses) #:prefix license:)
27   #:use-module (guix build-system cmake)
28   #:use-module (gnu packages)
29   #:use-module (gnu packages boost)
30   #:use-module (gnu packages compression)
31   #:use-module (gnu packages cups)
32   #:use-module (gnu packages fontutils)
33   #:use-module (gnu packages ghostscript)
34   #:use-module (gnu packages gtk)
35   #:use-module (gnu packages icu4c)
36   #:use-module (gnu packages image)
37   #:use-module (gnu packages imagemagick)
38   #:use-module (gnu packages libreoffice)
39   #:use-module (gnu packages linux)
40   #:use-module (gnu packages pdf)
41   #:use-module (gnu packages pkg-config)
42   #:use-module (gnu packages python)
43   #:use-module (gnu packages qt)
44   #:use-module (gnu packages tls)
45   #:use-module (gnu packages xml))
47 (define-public scribus
48   (package
49     (name "scribus")
50     (version "1.5.4")
51     (source
52      (origin
53        (method url-fetch)
54        (uri (string-append "mirror://sourceforge/scribus/scribus-devel/"
55                            version "/scribus-" version ".tar.xz"))
56        (sha256
57         (base32
58          "00ys0p6h3iq77kh72dkl0qrf7qvznq18qdrgiq10gfxja1995034"))
59        (patches (append
60                  ;; Scribus relies heavily on Poppler internals, which have
61                  ;; changed a lot since the latest Scribus release (2018-04).
62                  ;; Thus, we require a bunch of patches to stay compatible.
63                  (search-patches "scribus-poppler.patch")
64                  (list (origin
65                          (method url-fetch)
66                          (uri (string-append
67                                "https://github.com/scribusproject/scribus/commit/"
68                                "7d4ceeb5cac32287769e3c0238699e0b3e56c24d.patch"))
69                          (file-name "scribus-poppler-0.64.patch")
70                          (sha256
71                           (base32
72                            "1kr27bfzkpabrh42nsrrvlqyycdg9isbavpaa5spgmrhidcg02xj")))
73                        (origin
74                          (method url-fetch)
75                          (uri (string-append
76                                "https://github.com/scribusproject/scribus/commit/"
77                                "76561c1a55cd07c268f8f2b2fea888532933700b.patch"))
78                          (file-name "scribus-poppler-config.patch")
79                          (sha256
80                           (base32
81                            "01k18xjj82c3ndzp89dlpfhhdccc8z0acf8b04r592jyr5y9rc19")))
82                        (origin
83                          (method url-fetch)
84                          (uri (string-append
85                                "https://github.com/scribusproject/scribus/commit/"
86                                "8e05d26c19097ac2ad5b4ebbf40a3771ee6faf9c.patch"))
87                          (file-name "scribus-poppler-0.69.patch")
88                          (sha256
89                           (base32
90                            "1avdmsj5l543j0irq18nxgiw99n395jj56ih5dsal59fn0wbqk42")))
91                        (origin
92                          (method url-fetch)
93                          (uri (string-append "https://git.archlinux.org/svntogit/"
94                                              "community.git/plain/trunk/scribus-"
95                                              "poppler-0.70.patch?h=packages/scribus&id="
96                                              "8ef43ee2fceb0753ed5a76bb0a11c84775898ffc"))
97                          (file-name "scribus-poppler-0.70.patch")
98                          (sha256
99                           (base32
100                            "0dw7ix3jaj0y1q97cmmqwb2qgdx760yhxx86wa8rnx0xhfi5x6qr"))))))
101        (modules '((guix build utils)))
102        (snippet
103         '(begin
104            (for-each (lambda (file)
105                        (substitute* file
106                          ;; These are required for compatibility with Poppler 0.71.
107                          (("GBool") "bool") (("gTrue") "true") (("gFalse") "false")
108                          ;; ...and this for Poppler 0.72.
109                          (("getCString") "c_str")))
110                      (find-files "scribus/plugins/import/pdf"))
111            #t))))
112     (build-system cmake-build-system)
113     (arguments
114      `(#:tests? #f                      ;no test target
115        #:configure-flags
116        '("-DWANT_GRAPHICSMAGICK=1")
117        #:phases
118        (modify-phases %standard-phases
119          (add-after 'install 'wrap-program
120            (lambda* (#:key inputs outputs #:allow-other-keys)
121              ;; Fix "ImportError: No module named _sysconfigdata_nd" where
122              ;; Scribus checks PATH and eventually runs system's Python
123              ;; instead of package's.
124              (let* ((out (assoc-ref outputs "out"))
125                     (py2 (assoc-ref inputs "python")))
126                (wrap-program (string-append out "/bin/scribus")
127                  `("PATH" ":" prefix (,(string-append py2 "/bin")))))
128              #t)))))
129     (inputs
130      `(("boost" ,boost)
131        ("cairo" ,cairo)
132        ("cups" ,cups)
133        ("fontconfig" ,fontconfig)
134        ("freetype" ,freetype)
135        ("graphicsmagick" ,graphicsmagick)
136        ("harfbuzz" ,harfbuzz)
137        ("hunspell" ,hunspell)
138        ("icu4c" ,icu4c)
139        ("lcms" ,lcms)
140        ("libcdr" ,libcdr)
141        ("libfreehand" ,libfreehand)
142        ("libjpeg" ,libjpeg)
143        ("libmspub" ,libmspub)
144        ("libpagemaker" ,libpagemaker)
145        ("librevenge" ,librevenge)
146        ("libtiff" ,libtiff)
147        ("libvisio" ,libvisio)
148        ("libxml2" ,libxml2)
149        ("libzmf" ,libzmf)
150        ("openssl" ,openssl)
151        ("podofo" ,podofo)
152        ("poppler" ,poppler)
153        ("python" ,python-2)             ;need Python library
154        ("qtbase" ,qtbase)
155        ("qtdeclarative" ,qtdeclarative)
156        ("zlib" ,zlib)))
157     (native-inputs
158      `(("pkg-config" ,pkg-config)
159        ("qttools" ,qttools)
160        ("util-linux" ,util-linux)))
161     (home-page "https://www.scribus.net")
162     (synopsis "Desktop publishing and page layout program")
163     (description
164      "Scribus is a @dfn{desktop publishing} (DTP) application and can be used
165 for many tasks; from brochure design to newspapers, magazines, newsletters and
166 posters to technical documentation.  Scribus supports professional DTP
167 features, such as CMYK color and a color management system to soft proof
168 images for high quality color printing, flexible PDF creation options,
169 Encapsulated PostScript import/export and creation of four color separations,
170 import of EPS/PS and SVG as native vector graphics, Unicode text including
171 right to left scripts such as Arabic and Hebrew via freetype.")
172     (license license:gpl2+)))