unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 1/2] gnu: Move package util-linux into its own module.
@ 2014-07-21 12:46 John Darrington
  2014-07-21 12:46 ` [PATCH 2/2] gnu, guix: Add a gzip package which includes tests, and use it where possible John Darrington
  0 siblings, 1 reply; 4+ messages in thread
From: John Darrington @ 2014-07-21 12:46 UTC (permalink / raw)
  To: guix-devel; +Cc: John Darrington

* gnu-system.am:  Add file util-linux.scm
* gnu/packages/linux.scm (util-linux): Remove variable.
* gnu/packages/util-linux.scm : New file.
---
 gnu-system.am               |    1 +
 gnu/packages/linux.scm      |   41 +-------------------------
 gnu/packages/util-linux.scm |   67 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 69 insertions(+), 40 deletions(-)
 create mode 100644 gnu/packages/util-linux.scm

diff --git a/gnu-system.am b/gnu-system.am
index 0423d14..b681d66 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -233,6 +233,7 @@ GNU_SYSTEM_MODULES =				\
   gnu/packages/uucp.scm				\
   gnu/packages/unrtf.scm			\
   gnu/packages/upnp.scm				\
+  gnu/packages/util-linux.scm			\
   gnu/packages/valgrind.scm			\
   gnu/packages/version-control.scm		\
   gnu/packages/video.scm			\
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 09d123a..1bf7608 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -39,6 +39,7 @@
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages util-linux)
   #:use-module (gnu packages attr)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages autotools)
@@ -363,46 +364,6 @@ use the proc filesystem. We're not about changing the world, but
 providing the system administrator with some help in common tasks.")
     (license gpl2+)))
 
-(define-public util-linux
-  (package
-    (name "util-linux")
-    (version "2.21")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append "mirror://kernel.org/linux/utils/"
-                                  name "/v" version "/"
-                                  name "-" version ".2" ".tar.xz"))
-              (sha256
-               (base32
-                "1rpgghf7n0zx0cdy8hibr41wvkm2qp1yvd8ab1rxr193l1jmgcir"))
-              (patches (list (search-patch "util-linux-perl.patch")))))
-    (build-system gnu-build-system)
-    (arguments
-     `(#:configure-flags '("--disable-use-tty-group"
-                           "--enable-ddate")
-       #:phases (alist-cons-after
-                 'install 'patch-chkdupexe
-                 (lambda* (#:key outputs #:allow-other-keys)
-                   (let ((out (assoc-ref outputs "out")))
-                     (substitute* (string-append out "/bin/chkdupexe")
-                       ;; Allow 'patch-shebang' to do its work.
-                       (("@PERL@") "/bin/perl"))))
-                 %standard-phases)))
-    (inputs `(("zlib" ,guix:zlib)
-              ("ncurses" ,ncurses)))
-    (native-inputs
-     `(("perl" ,perl)))
-    (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
-    (synopsis "Collection of utilities for the Linux kernel")
-    (description
-     "util-linux is a random collection of utilities for the Linux kernel.")
-
-    ;; Note that util-linux doesn't use the same license for all the
-    ;; code.  GPLv2+ is the default license for a code without an
-    ;; explicitly defined license.
-    (license (list gpl3+ gpl2+ gpl2 lgpl2.0+
-                   bsd-4 public-domain))))
-
 (define-public procps
   (package
     (name "procps")
diff --git a/gnu/packages/util-linux.scm b/gnu/packages/util-linux.scm
new file mode 100644
index 0000000..f853170
--- /dev/null
+++ b/gnu/packages/util-linux.scm
@@ -0,0 +1,67 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages util-linux)
+  #:use-module ((guix licenses)
+                #:hide (zlib))
+  #:use-module (gnu packages)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages perl)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build-system gnu))
+
+(define-public util-linux
+  (package
+    (name "util-linux")
+    (version "2.21")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://kernel.org/linux/utils/"
+                                  name "/v" version "/"
+                                  name "-" version ".2" ".tar.xz"))
+              (sha256
+               (base32
+                "1rpgghf7n0zx0cdy8hibr41wvkm2qp1yvd8ab1rxr193l1jmgcir"))
+              (patches (list (search-patch "util-linux-perl.patch")))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags '("--disable-use-tty-group"
+                           "--enable-ddate")
+       #:phases (alist-cons-after
+                 'install 'patch-chkdupexe
+                 (lambda* (#:key outputs #:allow-other-keys)
+                   (let ((out (assoc-ref outputs "out")))
+                     (substitute* (string-append out "/bin/chkdupexe")
+                       ;; Allow 'patch-shebang' to do its work.
+                       (("@PERL@") "/bin/perl"))))
+                 %standard-phases)))
+    (inputs `(("zlib" ,zlib)
+              ("ncurses" ,ncurses)))
+    (native-inputs `(("perl" ,perl)))
+    (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
+    (synopsis "Collection of utilities for the Linux kernel")
+    (description
+     "util-linux is a random collection of utilities for the Linux kernel.")
+
+    ;; Note that util-linux doesn't use the same license for all the
+    ;; code.  GPLv2+ is the default license for a code without an
+    ;; explicitly defined license.
+    (license (list gpl3+ gpl2+ gpl2 lgpl2.0+
+                   bsd-4 public-domain))))
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] gnu, guix: Add a gzip package which includes tests, and use it where possible.
  2014-07-21 12:46 [PATCH 1/2] gnu: Move package util-linux into its own module John Darrington
@ 2014-07-21 12:46 ` John Darrington
  2014-07-21 16:17   ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: John Darrington @ 2014-07-21 12:46 UTC (permalink / raw)
  To: guix-devel; +Cc: John Darrington

* gnu/packages/base.scm: Replace "gzip" with "untested-gzip".
* gnu/packages/bootstrap.scm: Replace "gzip" with "untested-gzip".
* gnu/packages/compression.scm: gzip -> untested-gzip. Add gzip.
* gnu/packages/make-bootstrap.scm: Replace "gzip" with "untested-gzip".
* guix/packages.scm: Replace "gzip" with "untested-gzip".
---
 gnu/packages/base.scm           |    2 +-
 gnu/packages/bootstrap.scm      |    2 +-
 gnu/packages/compression.scm    |   39 ++++++++++++++++++++++++++++++++++++---
 gnu/packages/make-bootstrap.scm |    2 +-
 guix/packages.scm               |    4 ++--
 5 files changed, 41 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 005e1c0..b0b016b 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -1186,7 +1186,7 @@ store.")
               ((name package)
                (list name (finalize package))))
              `(("tar" ,tar)
-               ("gzip" ,gzip)
+               ("gzip" ,untested-gzip)
                ("bzip2" ,bzip2)
                ("xz" ,xz)
                ("diffutils" ,diffutils)
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index 981cde9..28bbdcd 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -69,7 +69,7 @@
     `(("tar"   ,%bootstrap-coreutils&co)
       ("xz"    ,%bootstrap-coreutils&co)
       ("bzip2" ,%bootstrap-coreutils&co)
-      ("gzip"  ,%bootstrap-coreutils&co)
+      ("untested-gzip"  ,%bootstrap-coreutils&co)
       ("patch" ,%bootstrap-coreutils&co)))
 
   (let ((orig-method (origin-method source)))
diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index 6887ba6..665e887 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -24,6 +24,8 @@
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
+  #:use-module (gnu packages less)
+  #:use-module (gnu packages util-linux)
   #:use-module (gnu packages which))
 
 (define-public zlib
@@ -71,6 +73,31 @@ independent of the input data and can be reduced, if necessary, at some cost
 in compression.")
     (license license:zlib)))
 
+;; A version of gzip which doesn't get tested.  Most users should not use
+;; this.  It is here for use early in the bootstrap process where a circular
+;; dependency would otherwise arise.
+(define-public untested-gzip
+  (package
+   (name "untested-gzip")
+   (version "1.6")
+   (source (origin
+            (method url-fetch)
+            (uri (string-append "mirror://gnu/gzip/gzip-"
+                                version ".tar.gz"))
+            (sha256
+             (base32
+              "0zlgdm4v3dndrbiz7b67mbbj25dpwqbmbzjiycssvrfrcfvq7swp"))))
+   (build-system gnu-build-system)
+   (synopsis "General file (de)compression (using lzw)")
+   (arguments '(#:tests? #f))
+   (description
+    "GNU Gzip provides data compression and decompression utilities; the
+typical extension is \".gz\".  Unlike the \"zip\" format, it compresses a single
+file; as a result, it is often used in conjunction with \"tar\", resulting in
+\".tar.gz\" or \".tgz\", etc.")
+   (license license:gpl3+)
+   (home-page "http://www.gnu.org/software/gzip/")))
+
 (define-public gzip
   (package
    (name "gzip")
@@ -83,10 +110,16 @@ in compression.")
              (base32
               "0zlgdm4v3dndrbiz7b67mbbj25dpwqbmbzjiycssvrfrcfvq7swp"))))
    (build-system gnu-build-system)
-   (synopsis "General file (de)compression (using lzw)")
    (arguments
-    ;; FIXME: The test suite wants `less', and optionally Perl.
-    '(#:tests? #f))
+    `(#:phases (alist-cons-before
+                'configure 'pref-conf
+                (lambda _
+                  (substitute* "Makefile.in"
+                    (("-e 's\\|/bin/sh\\|\\$\\(SHELL\\)\\|g'") "")))
+               %standard-phases)))
+  (synopsis "General file (de)compression (using lzw)")
+   (native-inputs `(("less" ,less)
+                    ("util-linux" ,util-linux)))
    (description
     "GNU Gzip provides data compression and decompression utilities; the
 typical extension is \".gz\".  Unlike the \"zip\" format, it compresses a single
diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
index 2808beb..e224362 100644
--- a/gnu/packages/make-bootstrap.scm
+++ b/gnu/packages/make-bootstrap.scm
@@ -191,7 +191,7 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
               ((name package)
                (list name (finalize package))))
              `(("tar" ,tar)
-               ("gzip" ,gzip)
+               ("gzip" ,untested-gzip)
                ("bzip2" ,bzip2)
                ("xz" ,xz)
                ("patch" ,patch)
diff --git a/guix/packages.scm b/guix/packages.scm
index 985a573..0bf3cfa 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -284,7 +284,7 @@ corresponds to the arguments expected by `set-path-environment-variable'."
     `(("tar"   ,(ref '(gnu packages base) 'tar))
       ("xz"    ,(ref '(gnu packages compression) 'xz))
       ("bzip2" ,(ref '(gnu packages compression) 'bzip2))
-      ("gzip"  ,(ref '(gnu packages compression) 'gzip))
+      ("untested-gzip"  ,(ref '(gnu packages compression) 'untested-gzip))
       ("lzip"  ,(ref '(gnu packages compression) 'lzip))
       ("patch" ,(ref '(gnu packages base) 'patch)))))
 
@@ -314,7 +314,7 @@ IMPORTED-MODULES specify modules to use/import for use by SNIPPET."
         source))
 
   (define decompression-type
-    (cond ((string-suffix? "gz" source-file-name)  "gzip")
+    (cond ((string-suffix? "gz" source-file-name)  "untested-gzip")
           ((string-suffix? "bz2" source-file-name) "bzip2")
           ((string-suffix? "lz" source-file-name)  "lzip")
           (else "xz")))
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] gnu, guix: Add a gzip package which includes tests, and use it where possible.
  2014-07-21 12:46 ` [PATCH 2/2] gnu, guix: Add a gzip package which includes tests, and use it where possible John Darrington
@ 2014-07-21 16:17   ` Ludovic Courtès
  2014-07-21 16:26     ` John Darrington
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2014-07-21 16:17 UTC (permalink / raw)
  To: John Darrington; +Cc: guix-devel

Just so I understand the context: what part of util-linux does gzip
depend on for its tests (that should be written in a comment)?

Since gzip is built at the very end of the bootstrap process, is
“untested-gzip” really needed?  For instance, couldn’t the final gzip be
built against an util-linux that is itself built against %boot5-inputs?

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] gnu, guix: Add a gzip package which includes tests, and use it where possible.
  2014-07-21 16:17   ` Ludovic Courtès
@ 2014-07-21 16:26     ` John Darrington
  0 siblings, 0 replies; 4+ messages in thread
From: John Darrington @ 2014-07-21 16:26 UTC (permalink / raw)
  To: Ludovic Court??s; +Cc: guix-devel

On Mon, Jul 21, 2014 at 06:17:37PM +0200, Ludovic Court??s wrote:
> Just so I understand the context: what part of util-linux does gzip
> depend on for its tests (that should be written in a comment)?

gzip depends on "more".


> Since gzip is built at the very end of the bootstrap process, is
> ???untested-gzip??? really needed?  For instance, couldn???t the final gzip be
> built against an util-linux that is itself built against %boot5-inputs?

I did try a number of such workarounds  but ran into issues.
I think the problem is that gzip is needed to unzip the tarball of util-linux.

J'

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-21 16:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-21 12:46 [PATCH 1/2] gnu: Move package util-linux into its own module John Darrington
2014-07-21 12:46 ` [PATCH 2/2] gnu, guix: Add a gzip package which includes tests, and use it where possible John Darrington
2014-07-21 16:17   ` Ludovic Courtès
2014-07-21 16:26     ` John Darrington

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).