scribus.scm 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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/>.
  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)
  28. #:use-module (gnu packages boost)
  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)
  34. #:use-module (gnu packages icu4c)
  35. #:use-module (gnu packages image)
  36. #:use-module (gnu packages imagemagick)
  37. #:use-module (gnu packages libreoffice)
  38. #:use-module (gnu packages linux)
  39. #:use-module (gnu packages pdf)
  40. #:use-module (gnu packages pkg-config)
  41. #:use-module (gnu packages python)
  42. #:use-module (gnu packages qt)
  43. #:use-module (gnu packages tls)
  44. #:use-module (gnu packages xml))
  45. (define-public scribus
  46. (package
  47. (name "scribus")
  48. (version "1.5.4")
  49. (source
  50. (origin
  51. (method url-fetch)
  52. (uri (string-append "mirror://sourceforge/scribus/scribus-devel/"
  53. version "/scribus-" version ".tar.xz"))
  54. (sha256
  55. (base32
  56. "00ys0p6h3iq77kh72dkl0qrf7qvznq18qdrgiq10gfxja1995034"))
  57. (patches (append
  58. ;; Scribus relies heavily on Poppler internals, which have
  59. ;; changed a lot since the latest Scribus release (2018-04).
  60. ;; Thus, we require a bunch of patches to stay compatible.
  61. (search-patches "scribus-poppler.patch")
  62. (list (origin
  63. (method url-fetch)
  64. (uri (string-append
  65. "https://github.com/scribusproject/scribus/commit/"
  66. "7d4ceeb5cac32287769e3c0238699e0b3e56c24d.patch"))
  67. (file-name "scribus-poppler-0.64.patch")
  68. (sha256
  69. (base32
  70. "1kr27bfzkpabrh42nsrrvlqyycdg9isbavpaa5spgmrhidcg02xj")))
  71. (origin
  72. (method url-fetch)
  73. (uri (string-append
  74. "https://github.com/scribusproject/scribus/commit/"
  75. "76561c1a55cd07c268f8f2b2fea888532933700b.patch"))
  76. (file-name "scribus-poppler-config.patch")
  77. (sha256
  78. (base32
  79. "01k18xjj82c3ndzp89dlpfhhdccc8z0acf8b04r592jyr5y9rc19")))
  80. (origin
  81. (method url-fetch)
  82. (uri (string-append
  83. "https://github.com/scribusproject/scribus/commit/"
  84. "8e05d26c19097ac2ad5b4ebbf40a3771ee6faf9c.patch"))
  85. (file-name "scribus-poppler-0.69.patch")
  86. (sha256
  87. (base32
  88. "1avdmsj5l543j0irq18nxgiw99n395jj56ih5dsal59fn0wbqk42")))
  89. (origin
  90. (method url-fetch)
  91. (uri (string-append "https://git.archlinux.org/svntogit/"
  92. "community.git/plain/trunk/scribus-"
  93. "poppler-0.70.patch?h=packages/scribus&id="
  94. "8ef43ee2fceb0753ed5a76bb0a11c84775898ffc"))
  95. (file-name "scribus-poppler-0.70.patch")
  96. (sha256
  97. (base32
  98. "0dw7ix3jaj0y1q97cmmqwb2qgdx760yhxx86wa8rnx0xhfi5x6qr"))))))
  99. (modules '((guix build utils)))
  100. (snippet
  101. '(begin
  102. (for-each (lambda (file)
  103. (substitute* file
  104. ;; These are required for compatibility with Poppler 0.71.
  105. (("GBool") "bool") (("gTrue") "true") (("gFalse") "false")
  106. ;; ...and this for Poppler 0.72.
  107. (("getCString") "c_str")))
  108. (find-files "scribus/plugins/import/pdf"))
  109. #t))))
  110. (build-system cmake-build-system)
  111. (arguments
  112. `(#:tests? #f ;no test target
  113. #:configure-flags
  114. '("-DWANT_GRAPHICSMAGICK=1")
  115. #:phases
  116. (modify-phases %standard-phases
  117. (add-after 'install 'wrap-program
  118. (lambda* (#:key inputs outputs #:allow-other-keys)
  119. ;; Fix "ImportError: No module named _sysconfigdata_nd" where
  120. ;; Scribus checks PATH and eventually runs system's Python
  121. ;; instead of package's.
  122. (let* ((out (assoc-ref outputs "out"))
  123. (py2 (assoc-ref inputs "python")))
  124. (wrap-program (string-append out "/bin/scribus")
  125. `("PATH" ":" prefix (,(string-append py2 "/bin")))))
  126. #t)))))
  127. (inputs
  128. `(("boost" ,boost)
  129. ("cairo" ,cairo)
  130. ("cups" ,cups)
  131. ("fontconfig" ,fontconfig)
  132. ("freetype" ,freetype)
  133. ("graphicsmagick" ,graphicsmagick)
  134. ("harfbuzz" ,harfbuzz)
  135. ("hunspell" ,hunspell)
  136. ("icu4c" ,icu4c)
  137. ("lcms" ,lcms)
  138. ("libcdr" ,libcdr)
  139. ("libfreehand" ,libfreehand)
  140. ("libjpeg" ,libjpeg)
  141. ("libmspub" ,libmspub)
  142. ("libpagemaker" ,libpagemaker)
  143. ("librevenge" ,librevenge)
  144. ("libtiff" ,libtiff)
  145. ("libvisio" ,libvisio)
  146. ("libxml2" ,libxml2)
  147. ("libzmf" ,libzmf)
  148. ("openssl" ,openssl)
  149. ("podofo" ,podofo)
  150. ("poppler" ,poppler)
  151. ("python" ,python-2) ;need Python library
  152. ("qtbase" ,qtbase)
  153. ("qtdeclarative" ,qtdeclarative)
  154. ("zlib" ,zlib)))
  155. (native-inputs
  156. `(("pkg-config" ,pkg-config)
  157. ("qttools" ,qttools)
  158. ("util-linux" ,util-linux)))
  159. (home-page "https://www.scribus.net")
  160. (synopsis "Desktop publishing and page layout program")
  161. (description
  162. "Scribus is a @dfn{desktop publishing} (DTP) application and can be used
  163. for many tasks; from brochure design to newspapers, magazines, newsletters and
  164. posters to technical documentation. Scribus supports professional DTP
  165. features, such as CMYK color and a color management system to soft proof
  166. images for high quality color printing, flexible PDF creation options,
  167. Encapsulated PostScript import/export and creation of four color separations,
  168. import of EPS/PS and SVG as native vector graphics, Unicode text including
  169. right to left scripts such as Arabic and Hebrew via freetype.")
  170. (license license:gpl2+)))