From f57732d79ac265917f154da5791ff203c82c9733 Mon Sep 17 00:00:00 2001
From: Leo Famulari
Date: Tue, 25 Jul 2017 01:46:38 -0400
Subject: [PATCH 2/2] gnu: net-tools: Update to 1.60-0.90da8a0.
Fixes .
* gnu/packages/linux.scm (net-tools): Update to 1.60-0.90da8a0.
[inputs]: Remove the Debian patch.
[arguments]: Use modify-phases. Remove the 'patch' phase. Disable
SELINUX and AFBLUETOOTH from build configuration.
---
gnu/packages/linux.scm | 77 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 76 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 4f9fa6d25..12c6a1241 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -106,6 +106,7 @@
#:use-module (guix build-system python)
#:use-module (guix build-system trivial)
#:use-module (guix download)
+ #:use-module (guix git-download)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix utils)
@@ -1187,6 +1188,18 @@ consists of several tools, of which the most important are @command{ip} and
messages and are accompanied by a set of manpages.")
(license license:gpl2+)))
+;; There are two packages for net-tools. This one, net-tools-for-tests, is
+;; relatively old and buggy. It can be used in package test suites and should
+;; never be referenced by a built package. Use #:disallowed-references to
+;; enforce this. The second one, net-tools, is more recent and probably safer to
+;; use, and it is the one that is exported as a public variable.
+;;
+;; When we are able to rebuild many packages (i.e. core-updates), the
+;; relationship of these two net-tools packages will be reversed. That is,
+;; net-tools will become the primary package, and net-tools-from-tests will
+;; inherit from it.
+;;
+;; See for more information.
(define net-tools-for-tests
;; XXX: This package is basically unmaintained, but it provides a few
;; commands not yet provided by Inetutils, such as 'route', so we have to
@@ -1270,6 +1283,10 @@ messages and are accompanied by a set of manpages.")
;; Use the big Debian patch set (the thing does not even compile out of
;; the box.)
+ ;; XXX The patch is not actually applied, due to a bug in the 'patch' phase
+ ;; above. However, this package variant is only used in GnuTLS's tests. It
+ ;; will be adjusted when convenient for the build farm.
+ ;; See for more information.
(inputs `(("patch" ,(origin
(method url-fetch)
(uri
@@ -1289,8 +1306,66 @@ configuration (iptunnel, ipmaddr).")
(license license:gpl2+)))
(define-public net-tools
- (package (inherit net-tools-for-tests)))
+ (package (inherit net-tools-for-tests)
+ (version "1.60-0.90da8a0")
+ ;; This tarball from Debian is equivalent to a Git checkout of the upstream
+ ;; repo, , commit
+ ;; 90da8a01bd27a945bb85c7773e8174a6cb7037a1.
+ ;; Git depends on net-tools, transitively, so we fetch this tarball to avoid
+ ;; a reference cycle. We should find a better workaround for this problem so
+ ;; that we can use the latest upstream source.
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "http://http.debian.net/debian/pool/main/n/"
+ "net-tools/net-tools_1.60+git20161116.90da8a0"
+ ".orig.tar.gz"))
+ (sha256
+ (base32
+ "0ahrqhxrgqk0x785ghzlpcfgs7418cj1xcpbajxv46slf15mrhnk"))))
+ (arguments
+ '(#:modules ((guix build gnu-build-system)
+ (guix build utils)
+ (srfi srfi-1)
+ (srfi srfi-26))
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'configure
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (mkdir-p (string-append out "/bin"))
+ (mkdir-p (string-append out "/sbin"))
+
+ ;; Pretend we have everything...
+ (system "yes | make config")
+
+ ;; ... except for the things we don't have.
+ ;; HAVE_AFDECnet requires libdnet, which we don't have.
+ ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
+ ;; that have been removed.
+ ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
+ ;; think about adding them later.
+ (substitute* '("config.make" "config.h")
+ (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
+ "")))))
+ (add-after 'install 'remove-redundant-commands
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; Remove commands and man pages redundant with Inetutils.
+ (let* ((out (assoc-ref outputs "out"))
+ (dup (append-map (cut find-files out <>)
+ '("^hostname"
+ "^(yp|nis|dns)?domainname"))))
+ (for-each delete-file dup)
+ #t))))
+ ;; Binaries that depend on libnet-tools.a don't declare that
+ ;; dependency, making it parallel-unsafe.
+ #:parallel-build? #f
+ #:tests? #f ; no test suite
+ #:make-flags (let ((out (assoc-ref %outputs "out")))
+ (list "CC=gcc"
+ (string-append "BASEDIR=" out)
+ (string-append "INSTALLNLSDIR=" out "/share/locale")
+ (string-append "mandir=/share/man")))))))
(define-public libcap
(package
(name "libcap")
--
2.13.3