gnu: emacs-svg-icon: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / gv.scm
index f573e31..b2e1fbb 100644 (file)
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
-;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
   #:use-module (gnu packages compression)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages xorg)
-  #:use-module ((guix licenses) #:renamer (symbol-prefix-proc 'license:))
+  #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system gnu))
 
-(define-public ghostscript/x
-  (package (inherit ghostscript)
-    (name (string-append (package-name ghostscript) "-with-x"))
-    (inputs `(("libxext" ,libxext)
-              ("libxt" ,libxt)
-              ,@(package-inputs ghostscript)))))
-
 (define-public gv
   (package
    (name "gv")
             (sha256 (base32
                      "0q8s43z14vxm41pfa8s5h9kyyzk1fkwjhkiwbf2x70alm6rv6qi1"))))
    (build-system gnu-build-system)
-   (propagated-inputs `(("ghostscript" ,ghostscript/x)))
-   (inputs `(("libx11" ,libx11)
+   (arguments
+    '(#:phases (modify-phases %standard-phases
+                 (add-before 'configure 'set-gs-file-name
+                   (lambda* (#:key inputs #:allow-other-keys)
+                     ;; Set the value of 'GV.gsInterpreter' in the generated
+                     ;; 'gv_system.ad' file.
+                     (let ((gs (assoc-ref inputs "ghostscript")))
+                       (with-fluids ((%default-port-encoding "ISO-8859-1"))
+                        (substitute* "src/Makefile.in"
+                          (("GV\\.gsInterpreter:([[:blank:]]+)gs" _ blank)
+                           (string-append "GV.gsInterpreter:" blank
+                                          gs "/bin/gs"))
+                          (("GV\\.gsCmd([[:alpha:]]+):([[:blank:]]+)gs" _
+                            command blank)
+                           (string-append "GV.gsCmd" command ":"
+                                          blank gs "/bin/gs"))))
+                       #t))))))
+   (inputs `(("ghostscript" ,ghostscript/x)
+             ("libx11" ,libx11)
              ("libxaw3d" ,libxaw3d)
              ("libxinerama" ,libxinerama)
              ("libxpm" ,libxpm)
-             ("pkg-config" ,pkg-config)
              ("zlib" ,zlib)))
+   (native-inputs
+     `(("pkg-config" ,pkg-config)))
    (synopsis "PostScript and PDF viewer using Ghostscript as a back-end")
    (description
-    "GV is a graphical user interface to the Ghostscript interpreter. With
-it, one can view and navigate through PostScript and PDF documents in X
+    "GNU GV is a graphical user interface to the Ghostscript interpreter.
+With it, one can view and navigate through PostScript and PDF documents in X
 Windows.")
    (license license:gpl3+)
-   (home-page "http://www.gnu.org/software/gv/")))
+   (home-page "https://www.gnu.org/software/gv/")))