gnu: emacs-consult: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / ghostscript.scm
index 7839ac5..03a516d 100644 (file)
@@ -7,7 +7,7 @@
 ;;; Copyright © 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
-;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2018, 2020 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -58,7 +58,9 @@
             (sha256 (base32
                      "083xisy6z01zhm7p7rgk4bx9d6zlr8l20qkfv1g29ylnhgwzvij8"))))
    (build-system gnu-build-system)
-   (inputs `(("libjpeg" ,libjpeg)
+   (arguments
+    `(#:configure-flags '("--disable-static")))
+   (inputs `(("libjpeg" ,libjpeg-turbo)
              ("libtiff" ,libtiff)
              ("zlib" ,zlib)))
    (synopsis "Little CMS, a small-footprint colour management engine")
@@ -88,7 +90,8 @@ Consortium standard (ICC), approved as ISO 15076-1.")
    (native-inputs
     `(("automake" ,automake))) ; For up to date 'config.guess' and 'config.sub'.
    (arguments
-    `(#:phases
+    `(#:configure-flags '("--disable-static")
+      #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'fix-configure
           (lambda* (#:key inputs native-inputs #:allow-other-keys)
@@ -156,13 +159,7 @@ printing, and psresize, for adjusting page sizes.")
 (define-public ghostscript
   (package
     (name "ghostscript")
-    (version "9.27")
-
-    ;; The problems addressed by GHOSTSCRIPT/FIXED are not security-related,
-    ;; but they have a significant impact on usability, hence this graft.
-    ;; TODO: Ungraft on next update cycle.
-    (replacement ghostscript/fixed)
-
+    (version "9.52")
     (source
       (origin
         (method url-fetch)
@@ -172,8 +169,10 @@ printing, and psresize, for adjusting page sizes.")
                             "/ghostscript-" version ".tar.xz"))
         (sha256
          (base32
-          "06dnj0mxyaryfbwlsjwaqf847w91w2h8f108kxxcc41nrnx1y3zw"))
-        (patches (search-patches "ghostscript-no-header-creationdate.patch"
+          "0z1w42y2jmcpl2m1l3z0sfii6zmvzcwcgzn6bydklia6ig7jli2p"))
+        (patches (search-patches "ghostscript-freetype-compat.patch"
+                                 "ghostscript-CVE-2020-15900.patch"
+                                 "ghostscript-no-header-creationdate.patch"
                                  "ghostscript-no-header-id.patch"
                                  "ghostscript-no-header-uuid.patch"))
         (modules '((guix build utils)))
@@ -205,6 +204,10 @@ printing, and psresize, for adjusting page sizes.")
              (string-append "ZLIBDIR="
                             (assoc-ref %build-inputs "zlib") "/include")
              "--enable-dynamic"
+             "--disable-compile-inits"
+             (string-append "--with-fontpath="
+                            (assoc-ref %build-inputs "gs-fonts")
+                            "/share/fonts/type1/ghostscript")
 
              ,@(if (%current-target-system)
                    '(;; Specify the native compiler, which is used to build 'echogs'
@@ -232,10 +235,6 @@ printing, and psresize, for adjusting page sizes.")
             (substitute* "base/gscdef.c"
               (("GS_DOCDIR")
                "\"~/.guix-profile/share/doc/ghostscript\""))
-            ;; The docdir default changed in 9.23 and a compatibility
-            ;; symlink was added from datadir->docdir.  Remove it.
-            (substitute* "base/unixinst.mak"
-              (("ln -s \\$\\(DESTDIR\\)\\$\\(docdir\\).*") ""))
             #t))
          (add-after 'configure 'patch-config-files
            (lambda _
@@ -268,6 +267,7 @@ printing, and psresize, for adjusting page sizes.")
                #t))))))
     (native-inputs
      `(("perl" ,perl)
+       ("pkg-config" ,pkg-config)       ;needed for freetype
        ("python" ,python-wrapper)
        ("tcl" ,tcl)
 
@@ -275,12 +275,14 @@ printing, and psresize, for adjusting page sizes.")
        ;; these libraries.
        ,@(if (%current-target-system)
              `(("zlib/native" ,zlib)
-               ("libjpeg/native" ,libjpeg))
+               ("libjpeg/native" ,libjpeg-turbo))
              '())))
     (inputs
-     `(("freetype" ,freetype)
+     `(("fontconfig" ,fontconfig)
+       ("freetype" ,freetype)
+       ("gs-fonts" ,gs-fonts)
        ("jbig2dec" ,jbig2dec)
-       ("libjpeg" ,libjpeg)
+       ("libjpeg" ,libjpeg-turbo)
        ("libpaper" ,libpaper)
        ("libpng" ,libpng)
        ("libtiff" ,libtiff)
@@ -294,25 +296,6 @@ output file formats and printers.")
     (home-page "https://www.ghostscript.com/")
     (license license:agpl3+)))
 
-(define ghostscript/fixed
-  ;; This adds the Freetype dependency (among other things), which fixes the
-  ;; rendering issues described in <https://issues.guix.gnu.org/issue/34877>.
-  (package/inherit
-   ghostscript
-   (arguments
-    (substitute-keyword-arguments (package-arguments ghostscript)
-      ((#:configure-flags flags ''())
-       `(append (list "--disable-compile-inits"
-                      (string-append "--with-fontpath="
-                                     (assoc-ref %build-inputs "gs-fonts")
-                                     "/share/fonts/type1/ghostscript"))
-                ,flags))))
-   (native-inputs `(("pkg-config" ,pkg-config)    ;needed for freetype
-                    ,@(package-native-inputs ghostscript)))
-   (inputs `(("gs-fonts" ,gs-fonts)
-             ("fontconfig" ,fontconfig)
-             ,@(package-inputs ghostscript)))))
-
 (define-public ghostscript/x
   (package/inherit ghostscript
     (name (string-append (package-name ghostscript) "-with-x"))