gnu: All snippets report errors using exceptions, else return #t.
[jackhill/guix/guix.git] / gnu / packages / scribus.scm
CommitLineData
3279b7ec
RW
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
b13b9834 3;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
4a8bd550 4;;; Copyright © 2017 Nicolas Goaziou <mail@nicolasgoaziou.fr>
3279b7ec
RW
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages scribus)
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix utils)
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (guix build-system cmake)
27 #:use-module (gnu packages)
4a8bd550 28 #:use-module (gnu packages boost)
3279b7ec
RW
29 #:use-module (gnu packages compression)
30 #:use-module (gnu packages cups)
31 #:use-module (gnu packages fontutils)
32 #:use-module (gnu packages ghostscript)
33 #:use-module (gnu packages gtk)
4a8bd550 34 #:use-module (gnu packages icu4c)
3279b7ec 35 #:use-module (gnu packages image)
4a8bd550
NG
36 #:use-module (gnu packages imagemagick)
37 #:use-module (gnu packages libreoffice)
3279b7ec 38 #:use-module (gnu packages linux)
4a8bd550 39 #:use-module (gnu packages pdf)
3279b7ec
RW
40 #:use-module (gnu packages pkg-config)
41 #:use-module (gnu packages python)
42 #:use-module (gnu packages qt)
4a8bd550 43 #:use-module (gnu packages tls)
3279b7ec
RW
44 #:use-module (gnu packages xml))
45
46(define-public scribus
47 (package
48 (name "scribus")
4a8bd550
NG
49 (version "1.5.3")
50 (source
51 (origin
52 (method url-fetch)
53 (uri (string-append "mirror://sourceforge/scribus/scribus-devel/"
54 version "/scribus-" version ".tar.xz"))
55 (sha256
56 (base32
57 "0kyp45vidxa3v35ic9592db4zk3m8al26vck38q5v7z14x3hp8vk"))
58 (patches
59 (list
60 (origin
61 (method url-fetch)
62 (uri (string-append "https://github.com/scribusproject/scribus/commit/"
63 "61186c7ef083046b7e0c908952e8a773e2787d82.patch"))
64 (file-name "scribus-fix-poppler-0.58-breakage.patch")
65 (sha256
66 (base32 "189qw9xmgz01xz1w1bi9lzrp399zk1j1iz5qdhchdrhgnd69b7ly")))
67 (origin
68 (method url-fetch)
69 (uri (string-append "https://github.com/scribusproject/scribus/commit/"
70 "d82b1c989bd0e79b5611521f671adbfb94996e5e.patch"))
71 (file-name "scribus-fix-poppler-packaging.patch")
72 (sha256
73 (base32 "1p9s18jjvj2h0ba1xvk1zhmnn4f4n3ykrgb56mjd6in30h0vrykx")))))
74 (modules '((guix build utils)))
75 (snippet
76 ;; Fix typo. Equivalent to patch at
77 ;; https://bugs.scribus.net/view.php?id=14850
6cbee49d
MW
78 '(begin
79 (substitute* "cmake/modules/FindLIBPODOFO.cmake"
80 (("find_package\\(OPENSSL\\)") "find_package(OpenSSL)"))
81 #t))))
3279b7ec 82 (build-system cmake-build-system)
0cd27c65 83 (arguments
4a8bd550 84 `(#:tests? #f ;no test target
0cd27c65 85 #:configure-flags
aa6ae8d3
NG
86 '("-DWANT_GRAPHICSMAGICK=1")
87 #:phases
88 (modify-phases %standard-phases
89 (add-after 'install 'wrap-program
90 (lambda* (#:key inputs outputs #:allow-other-keys)
91 ;; Fix "ImportError: No module named _sysconfigdata_nd" where
92 ;; Scribus checks PATH and eventually runs system's Python
93 ;; instead of package's.
94 (let* ((out (assoc-ref outputs "out"))
95 (py2 (assoc-ref inputs "python")))
96 (wrap-program (string-append out "/bin/scribus")
97 `("PATH" ":" prefix (,(string-append py2 "/bin")))))
98 #t)))))
3279b7ec 99 (inputs
4a8bd550
NG
100 `(("boost" ,boost)
101 ("cairo" ,cairo)
3279b7ec 102 ("cups" ,cups)
4a8bd550
NG
103 ("fontconfig" ,fontconfig)
104 ("freetype" ,freetype)
3279b7ec 105 ("graphicsmagick" ,graphicsmagick)
4a8bd550
NG
106 ("harfbuzz" ,harfbuzz)
107 ("hunspell" ,hunspell)
108 ("icu4c" ,icu4c)
3279b7ec 109 ("lcms" ,lcms)
4a8bd550
NG
110 ("libcdr" ,libcdr)
111 ("libfreehand" ,libfreehand)
3279b7ec 112 ("libjpeg" ,libjpeg)
4a8bd550
NG
113 ("libmspub" ,libmspub)
114 ("libpagemaker" ,libpagemaker)
115 ("librevenge" ,librevenge)
3279b7ec 116 ("libtiff" ,libtiff)
4a8bd550 117 ("libvisio" ,libvisio)
3279b7ec 118 ("libxml2" ,libxml2)
4a8bd550
NG
119 ("openssl" ,openssl)
120 ("podofo" ,podofo)
121 ("poppler" ,poppler)
122 ("python" ,python-2) ;need Python library
b13b9834
EF
123 ("qtbase" ,qtbase)
124 ("qtdeclarative" ,qtdeclarative)
3279b7ec
RW
125 ("zlib" ,zlib)))
126 (native-inputs
4a8bd550
NG
127 `(("pkg-config" ,pkg-config)
128 ("qttools" ,qttools)
129 ("util-linux" ,util-linux)))
130 (home-page "https://www.scribus.net")
3279b7ec
RW
131 (synopsis "Desktop publishing and page layout program")
132 (description
133 "Scribus is a @dfn{desktop publishing} (DTP) application and can be used
134for many tasks; from brochure design to newspapers, magazines, newsletters and
135posters to technical documentation. Scribus supports professional DTP
136features, such as CMYK color and a color management system to soft proof
137images for high quality color printing, flexible PDF creation options,
138Encapsulated PostScript import/export and creation of four color separations,
139import of EPS/PS and SVG as native vector graphics, Unicode text including
140right to left scripts such as Arabic and Hebrew via freetype.")
141 (license license:gpl2+)))