all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCHES] gnu: netpbm: Move man pages to share/man
@ 2014-03-20  8:46 Mark H Weaver
  0 siblings, 0 replies; only message in thread
From: Mark H Weaver @ 2014-03-20  8:46 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1048 bytes --]

These patches are ultimately aimed at simply installing the man pages
for netpbm in PREFIX/share/man instead of PREFIX/man.  I also noticed
that the recipe is indented in such a way that is quite misleading, and
that its install phase could be simplified.

* The first patch is purely whitespace changes.

* The second patch simplifies the install phase without changing its
  behavior.

* The third patch moves 'man' to 'share/man'.

I also noticed that the man pages 'netpbm' installs are merely pointers
to the web site.  The documentation is not distributed in the tarball at
all, and there is apparently no way to get an immutable copy of the
documentation corresponding to the tarball without fetching a particular
revision from a subversion repository.

They install a program called 'manweb' that launches a web browser.
It finds the URL in a rather gross way: by looking for a file called
'doc.url' in $PATH, which it helpfully installs in PREFIX/bin.  Ugh.

Anyway, here are the patches that at least improve things somewhat.

     Mark


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH 1/3] gnu: netpbm: Reindent recipe --]
[-- Type: text/x-patch, Size: 9224 bytes --]

From 5015998104802fc512e89a4d84a508e25e788692 Mon Sep 17 00:00:00 2001
From: Mark H Weaver <mhw@netris.org>
Date: Thu, 20 Mar 2014 04:05:09 -0400
Subject: [PATCH 1/3] gnu: netpbm: Reindent recipe.

* gnu/packages/netpbm.scm (netpbm): Reindent.  Fix dangling close parentheses.
---
 gnu/packages/netpbm.scm | 166 ++++++++++++++++++++++++------------------------
 1 file changed, 83 insertions(+), 83 deletions(-)

diff --git a/gnu/packages/netpbm.scm b/gnu/packages/netpbm.scm
index 01d672e..5875a93 100644
--- a/gnu/packages/netpbm.scm
+++ b/gnu/packages/netpbm.scm
@@ -35,93 +35,93 @@
 
 (define-public netpbm
   (package
-   (name "netpbm")
-   (version "10.61.01")
-   (source (origin
-            (method url-fetch)
-            ;; The "super-stable" and "stable" versions do not compile
-            ;; with newer libpng; we need the "advanced" version. The tarball
-            ;; on the server is generated by sourceforge from the "advanced"
-            ;; branch of the subversion repository:
-            ;; svn checkout http://netpbm.svn.sourceforge.net/svnroot/netpbm/advanced netpbm-version
-            (uri (string-append "http://www.multiprecision.org/guix/netpbm-"
-                                version ".tar.xz"))
-            (sha256 (base32
-                     "10nwvxc85kr6vhlhhahagy7s9848bbixl54b0p4ppim4g0dl10jz"))))
-   (build-system gnu-build-system)
-   (inputs `(("ghostscript" ,ghostscript)
-             ("libjpeg" ,libjpeg)
-             ("libpng" ,libpng)
-             ("libtiff" ,libtiff)
-             ("libxml2" ,libxml2)
-             ("zlib" ,zlib)))
-   (native-inputs
+    (name "netpbm")
+    (version "10.61.01")
+    (source (origin
+              (method url-fetch)
+              ;; The "super-stable" and "stable" versions do not compile
+              ;; with newer libpng; we need the "advanced" version. The tarball
+              ;; on the server is generated by sourceforge from the "advanced"
+              ;; branch of the subversion repository:
+              ;; svn checkout http://netpbm.svn.sourceforge.net/svnroot/netpbm/advanced netpbm-version
+              (uri (string-append "http://www.multiprecision.org/guix/netpbm-"
+                                  version ".tar.xz"))
+              (sha256 (base32
+                       "10nwvxc85kr6vhlhhahagy7s9848bbixl54b0p4ppim4g0dl10jz"))))
+    (build-system gnu-build-system)
+    (inputs `(("ghostscript" ,ghostscript)
+              ("libjpeg" ,libjpeg)
+              ("libpng" ,libpng)
+              ("libtiff" ,libtiff)
+              ("libxml2" ,libxml2)
+              ("zlib" ,zlib)))
+    (native-inputs
      `(("flex" ,flex)
        ("perl" ,perl)
        ("pkg-config" ,pkg-config)
        ("python" ,python-wrapper)))
-   (arguments
-    `(#:phases
-      (alist-replace
-       'configure
-       (lambda* (#:key #:allow-other-keys #:rest args)
-        (copy-file "config.mk.in" "config.mk")
-        (let ((f (open-file "config.mk" "a")))
-         (display "CC=gcc\n" f)
-         (display "CFLAGS_SHLIB += -fPIC\n" f)
-         (display "TIFFLIB = libtiff.so\n" f)
-         (display "JPEGLIB = libjpeg.so\n" f)
-         (display "ZLIB = libz.so\n" f)
-         (close-port f)
-         ;; drop advertisement for non-free program
-         (substitute* "converter/ppm/Makefile" (("hpcdtoppm") ""))
-         ;; drop programs without license, see
-         ;; http://packages.debian.org/changelogs/pool/main/n/netpbm-free/netpbm-free_10.0-12.2/libnetpbm10.copyright
-         (substitute* "converter/pbm/Makefile" (("pbmto4425") ""))
-         (substitute* "converter/pbm/Makefile" (("pbmtoln03") ""))
-         (substitute* "converter/pbm/Makefile" (("pbmtolps") ""))
-         (substitute* "converter/pbm/Makefile" (("pbmtopk") ""))
-         (substitute* "converter/pbm/Makefile" (("pktopbm") ""))
-         (substitute* "converter/pgm/Makefile" (("spottopgm") ""))
-         (substitute* "converter/ppm/Makefile" (("ppmtopjxl") ""))
-         ))
-      (alist-replace
-       'check
-       (lambda* (#:key #:allow-other-keys #:rest args)
-        (let ((check (assoc-ref %standard-phases 'check)))
-          ;; install temporarily into /tmp/netpbm
-          (system* "make" "package")
-          ;; remove test requiring X
-          (substitute* "test/all-in-place.test" (("pamx") ""))
-          ;; do not worry about non-existing file
-          (substitute* "test/all-in-place.test" (("^rm ") "rm -f "))
-          ;; remove four tests that fail for unknown reasons
-          (substitute* "test/Test-Order" (("all-in-place.test") ""))
-          (substitute* "test/Test-Order" (("pnmpsnr.test") ""))
-          (substitute* "test/Test-Order" (("pnmremap1.test") ""))
-          (substitute* "test/Test-Order" (("gif-roundtrip.test") ""))
-          (apply check args)))
-      (alist-replace
-       'install
-       (lambda* (#:key outputs make-flags #:allow-other-keys)
-        (let ((out (assoc-ref outputs "out")))
-         (apply system* "make" "package"
-                        (string-append "pkgdir=" out) make-flags)
-         ;; copy static library
-         (copy-file (string-append out "/link/libnetpbm.a")
-                    (string-append out "/lib/libnetpbm.a"))
-         ;; remove superfluous folders and files
-         (system* "rm" "-r" (string-append out "/link"))
-         (system* "rm" "-r" (string-append out "/misc"))
-         (with-directory-excursion out
-           (for-each delete-file
-                     '("config_template" "pkginfo" "README" "VERSION")))))
-      %standard-phases)))))
-   (synopsis "Netpbm, a toolkit for manipulation of images")
-   (description
-    "Netpbm is a toolkit for the manipulation of graphic images, including
+    (arguments
+     `(#:phases
+       (alist-replace
+        'configure
+        (lambda* (#:key #:allow-other-keys #:rest args)
+          (copy-file "config.mk.in" "config.mk")
+          (let ((f (open-file "config.mk" "a")))
+            (display "CC=gcc\n" f)
+            (display "CFLAGS_SHLIB += -fPIC\n" f)
+            (display "TIFFLIB = libtiff.so\n" f)
+            (display "JPEGLIB = libjpeg.so\n" f)
+            (display "ZLIB = libz.so\n" f)
+            (close-port f)
+            ;; drop advertisement for non-free program
+            (substitute* "converter/ppm/Makefile" (("hpcdtoppm") ""))
+            ;; drop programs without license, see
+            ;; http://packages.debian.org/changelogs/pool/main/n/netpbm-free/netpbm-free_10.0-12.2/libnetpbm10.copyright
+            (substitute* "converter/pbm/Makefile" (("pbmto4425") ""))
+            (substitute* "converter/pbm/Makefile" (("pbmtoln03") ""))
+            (substitute* "converter/pbm/Makefile" (("pbmtolps") ""))
+            (substitute* "converter/pbm/Makefile" (("pbmtopk") ""))
+            (substitute* "converter/pbm/Makefile" (("pktopbm") ""))
+            (substitute* "converter/pgm/Makefile" (("spottopgm") ""))
+            (substitute* "converter/ppm/Makefile" (("ppmtopjxl") ""))))
+        (alist-replace
+         'check
+         (lambda* (#:key #:allow-other-keys #:rest args)
+           (let ((check (assoc-ref %standard-phases 'check)))
+             ;; install temporarily into /tmp/netpbm
+             (system* "make" "package")
+             ;; remove test requiring X
+             (substitute* "test/all-in-place.test" (("pamx") ""))
+             ;; do not worry about non-existing file
+             (substitute* "test/all-in-place.test" (("^rm ") "rm -f "))
+             ;; remove four tests that fail for unknown reasons
+             (substitute* "test/Test-Order" (("all-in-place.test") ""))
+             (substitute* "test/Test-Order" (("pnmpsnr.test") ""))
+             (substitute* "test/Test-Order" (("pnmremap1.test") ""))
+             (substitute* "test/Test-Order" (("gif-roundtrip.test") ""))
+             (apply check args)))
+         (alist-replace
+          'install
+          (lambda* (#:key outputs make-flags #:allow-other-keys)
+            (let ((out (assoc-ref outputs "out")))
+              (apply system* "make" "package"
+                     (string-append "pkgdir=" out)
+                     make-flags)
+              ;; copy static library
+              (copy-file (string-append out "/link/libnetpbm.a")
+                         (string-append out "/lib/libnetpbm.a"))
+              ;; remove superfluous folders and files
+              (system* "rm" "-r" (string-append out "/link"))
+              (system* "rm" "-r" (string-append out "/misc"))
+              (with-directory-excursion out
+                (for-each delete-file
+                          '("config_template" "pkginfo" "README" "VERSION")))))
+          %standard-phases)))))
+    (synopsis "Netpbm, a toolkit for manipulation of images")
+    (description
+     "Netpbm is a toolkit for the manipulation of graphic images, including
 the conversion of images between a variety of different formats.
 There are over 300 separate tools in the package including converters for
 about 100 graphics formats.")
-   (license gpl2)
-   (home-page "http://netpbm.sourceforge.net/")))
+    (license gpl2)
+    (home-page "http://netpbm.sourceforge.net/")))
-- 
1.8.4


[-- Attachment #3: [PATCH 2/3] gnu: netpbm: Use 'with-directory-excursion' to simplify install phase --]
[-- Type: text/x-patch, Size: 1884 bytes --]

From c2e645e739ab8a75ef41c07c1303b97938d82f60 Mon Sep 17 00:00:00 2001
From: Mark H Weaver <mhw@netris.org>
Date: Thu, 20 Mar 2014 04:15:53 -0400
Subject: [PATCH 2/3] gnu: netpbm: Use 'with-directory-excursion' to simplify
 install phase.

* gnu/packages/netpbm.scm (netpbm): In install phase, move the 'copy-file' and
  'system*' calls within the 'make-directory-excursion' to simplify the code.
---
 gnu/packages/netpbm.scm | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/netpbm.scm b/gnu/packages/netpbm.scm
index 5875a93..20b4bd7 100644
--- a/gnu/packages/netpbm.scm
+++ b/gnu/packages/netpbm.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
+;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -107,13 +108,12 @@
               (apply system* "make" "package"
                      (string-append "pkgdir=" out)
                      make-flags)
-              ;; copy static library
-              (copy-file (string-append out "/link/libnetpbm.a")
-                         (string-append out "/lib/libnetpbm.a"))
-              ;; remove superfluous folders and files
-              (system* "rm" "-r" (string-append out "/link"))
-              (system* "rm" "-r" (string-append out "/misc"))
               (with-directory-excursion out
+                ;; copy static library
+                (copy-file "link/libnetpbm.a" "lib/libnetpbm.a")
+                ;; remove superfluous folders and files
+                (system* "rm" "-r" "link")
+                (system* "rm" "-r" "misc")
                 (for-each delete-file
                           '("config_template" "pkginfo" "README" "VERSION")))))
           %standard-phases)))))
-- 
1.8.4


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: [PATCH 3/3] gnu: netpbm: Move man pages to share/man --]
[-- Type: text/x-patch, Size: 933 bytes --]

From 5aeb0ad06c7fb69d7a87c29cbb71e65b6a6bac29 Mon Sep 17 00:00:00 2001
From: Mark H Weaver <mhw@netris.org>
Date: Thu, 20 Mar 2014 04:18:50 -0400
Subject: [PATCH 3/3] gnu: netpbm: Move man pages to share/man.

* gnu/packages/netpbm.scm (netpbm): In install phase, move the
  man pages to share/man.
---
 gnu/packages/netpbm.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gnu/packages/netpbm.scm b/gnu/packages/netpbm.scm
index 20b4bd7..6eb1a47 100644
--- a/gnu/packages/netpbm.scm
+++ b/gnu/packages/netpbm.scm
@@ -114,6 +114,8 @@
                 ;; remove superfluous folders and files
                 (system* "rm" "-r" "link")
                 (system* "rm" "-r" "misc")
+                (mkdir "share")
+                (rename-file "man" "share/man")
                 (for-each delete-file
                           '("config_template" "pkginfo" "README" "VERSION")))))
           %standard-phases)))))
-- 
1.8.4


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-03-20  8:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-20  8:46 [PATCHES] gnu: netpbm: Move man pages to share/man Mark H Weaver

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.