gnu: Add emacs-evil-ediff.
[jackhill/guix/guix.git] / gnu / packages / scribus.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2017 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/>.
21
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))
46
47 (define-public scribus
48 (package
49 (name "scribus")
50 (version "1.5.3")
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 "0kyp45vidxa3v35ic9592db4zk3m8al26vck38q5v7z14x3hp8vk"))
59 (patches
60 (list
61 (origin
62 (method url-fetch)
63 (uri (string-append "https://github.com/scribusproject/scribus/commit/"
64 "61186c7ef083046b7e0c908952e8a773e2787d82.patch"))
65 (file-name "scribus-fix-poppler-0.58-breakage.patch")
66 (sha256
67 (base32 "189qw9xmgz01xz1w1bi9lzrp399zk1j1iz5qdhchdrhgnd69b7ly")))
68 (origin
69 (method url-fetch)
70 (uri (string-append "https://github.com/scribusproject/scribus/commit/"
71 "d82b1c989bd0e79b5611521f671adbfb94996e5e.patch"))
72 (file-name "scribus-fix-poppler-packaging.patch")
73 (sha256
74 (base32 "1p9s18jjvj2h0ba1xvk1zhmnn4f4n3ykrgb56mjd6in30h0vrykx")))))
75 (modules '((guix build utils)))
76 (snippet
77 ;; Fix typo. Equivalent to patch at
78 ;; https://bugs.scribus.net/view.php?id=14850
79 '(substitute* "cmake/modules/FindLIBPODOFO.cmake"
80 (("find_package\\(OPENSSL\\)") "find_package(OpenSSL)")))))
81 (build-system cmake-build-system)
82 (arguments
83 `(#:tests? #f ;no test target
84 #:configure-flags
85 '("-DWANT_GRAPHICSMAGICK=1")
86 #:phases
87 (modify-phases %standard-phases
88 (add-after 'unpack 'patch-source
89 (lambda _
90 ;; Fix build against Qt 5.11.
91 (substitute* "scribus/plugins/tools/lenseffects/lensdialog.cpp"
92 (("#include <cmath>") "#include <cmath>
93 #include <QStyleOptionGraphicsItem>"))
94 (substitute* "scribus/plugins/tools/2geomtools/meshdistortion/meshdistortiondialog.cpp"
95 (("#include <QGraphicsItem>") "#include <QGraphicsItem>
96 #include <QStyleOptionGraphicsItem>"))
97 (substitute* "scribus/sclistboxpixmap.h"
98 (("#include <QVariant>") "#include <QVariant>
99 #include <QStyleOptionViewItem>
100 #include <QAbstractItemDelegate>"))
101 #t))
102 (add-after 'install 'wrap-program
103 (lambda* (#:key inputs outputs #:allow-other-keys)
104 ;; Fix "ImportError: No module named _sysconfigdata_nd" where
105 ;; Scribus checks PATH and eventually runs system's Python
106 ;; instead of package's.
107 (let* ((out (assoc-ref outputs "out"))
108 (py2 (assoc-ref inputs "python")))
109 (wrap-program (string-append out "/bin/scribus")
110 `("PATH" ":" prefix (,(string-append py2 "/bin")))))
111 #t)))))
112 (inputs
113 `(("boost" ,boost)
114 ("cairo" ,cairo)
115 ("cups" ,cups)
116 ("fontconfig" ,fontconfig)
117 ("freetype" ,freetype)
118 ("graphicsmagick" ,graphicsmagick)
119 ("harfbuzz" ,harfbuzz)
120 ("hunspell" ,hunspell)
121 ("icu4c" ,icu4c)
122 ("lcms" ,lcms)
123 ("libcdr" ,libcdr)
124 ("libfreehand" ,libfreehand)
125 ("libjpeg" ,libjpeg)
126 ("libmspub" ,libmspub)
127 ("libpagemaker" ,libpagemaker)
128 ("librevenge" ,librevenge)
129 ("libtiff" ,libtiff)
130 ("libvisio" ,libvisio)
131 ("libxml2" ,libxml2)
132 ("openssl" ,openssl)
133 ("podofo" ,podofo)
134 ("poppler" ,poppler)
135 ("python" ,python-2) ;need Python library
136 ("qtbase" ,qtbase)
137 ("qtdeclarative" ,qtdeclarative)
138 ("zlib" ,zlib)))
139 (native-inputs
140 `(("pkg-config" ,pkg-config)
141 ("qttools" ,qttools)
142 ("util-linux" ,util-linux)))
143 (home-page "https://www.scribus.net")
144 (synopsis "Desktop publishing and page layout program")
145 (description
146 "Scribus is a @dfn{desktop publishing} (DTP) application and can be used
147 for many tasks; from brochure design to newspapers, magazines, newsletters and
148 posters to technical documentation. Scribus supports professional DTP
149 features, such as CMYK color and a color management system to soft proof
150 images for high quality color printing, flexible PDF creation options,
151 Encapsulated PostScript import/export and creation of four color separations,
152 import of EPS/PS and SVG as native vector graphics, Unicode text including
153 right to left scripts such as Arabic and Hebrew via freetype.")
154 (license license:gpl2+)))