Subject: [PATCH 07/17] build-system/asdf: Don't rename inputs.

From: Andy Patterson <[email-masked]>
Date: Mon, 3 Apr 2017 09:01:24 -0400

* guix/build-system/asdf.scm (package-with-build-system)[transform]: Use updated
`new-inputs' prodcedure for inputs and native-inputs.
<rewrite>: Don't rename inputs.
<new-propagated-inputs>: Draw from package-inputs and package-native-inputs
for source packages.  Use the original package's propagated-inputs otherwise.
<new-inputs>: Convert into a function to be used to transform inputs and
native-inputs.
* gnu/packages/lisp.scm (sbcl-fiveam, sbcl-bordeaux-threads)
(sbcl-flexi-streams, sbcl-cl-ppcre, sbcl-stumpwm, sbcl-slynk-arglists)
(sbcl-slynk-fancy-inspector): Don't prefix input names.
---
 gnu/packages/lisp.scm      | 18 +++++++++---------
 guix/build-system/asdf.scm | 44 ++++++++++++++++++++++----------------------
 2 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 183e37b92..863b35cea 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -657,7 +657,7 @@ portable between implementations.")
        (sha256
         (base32 "0f48pcbhqs3wwwzjl5nk57d4hcbib4l9xblxc66b8c2fhvhmhxnv"))
        (file-name (string-append "fiveam-" version ".tar.gz"))))
-    (inputs `(("sbcl-alexandria" ,sbcl-alexandria)))
+    (inputs `(("alexandria" ,sbcl-alexandria)))
     (build-system asdf-build-system/sbcl)
     (synopsis "Common Lisp testing framework")
     (description "FiveAM is a simple (as far as writing and running tests
@@ -685,8 +685,8 @@ interactive development model in mind.")
                (base32 "10ryrcx832fwqdawb6jmknymi7wpdzhi30qzx7cbrk0cpnka71w2"))
               (file-name
                (string-append "bordeaux-threads-" version ".tar.gz"))))
-    (inputs `(("sbcl-alexandria" ,sbcl-alexandria)))
-    (native-inputs `(("tests:cl-fiveam" ,sbcl-fiveam)))
+    (inputs `(("alexandria" ,sbcl-alexandria)))
+    (native-inputs `(("fiveam" ,sbcl-fiveam)))
     (build-system asdf-build-system/sbcl)
     (synopsis "Portable shared-state concurrency library for Common Lisp")
     (description "BORDEAUX-THREADS is a proposed standard for a minimal
@@ -747,7 +747,7 @@ thin compatibility layer for gray streams.")
         (base32 "16grnxvs7vqm5s6myf8a5s7vwblzq1kgwj8i7ahz8vwvihm9gzfi"))
        (file-name (string-append "flexi-streams-" version ".tar.gz"))))
     (build-system asdf-build-system/sbcl)
-    (inputs `(("sbcl-trivial-gray-streams" ,sbcl-trivial-gray-streams)))
+    (inputs `(("trivial-gray-streams" ,sbcl-trivial-gray-streams)))
     (synopsis "Implementation of virtual bivalent streams for Common Lisp")
     (description "Flexi-streams is an implementation of \"virtual\" bivalent
 streams that can be layered atop real binary or bivalent streams and that can
@@ -777,7 +777,7 @@ streams which are similar to string streams.")
         (base32 "1i7daxf0wnydb0pgwiym7qh2wy70n14lxd6dyv28sy0naa8p31gd"))
        (file-name (string-append "cl-ppcre-" version ".tar.gz"))))
     (build-system asdf-build-system/sbcl)
-    (native-inputs `(("tests:cl-flexi-streams" ,sbcl-flexi-streams)))
+    (native-inputs `(("flexi-streams" ,sbcl-flexi-streams)))
     (synopsis "Portable regular expression library for Common Lisp")
     (description "CL-PPCRE is a portable regular expression library for Common
 Lisp, which is compatible with perl.  It is pretty fast, thread-safe, and
@@ -847,8 +847,8 @@ from other CLXes around the net.")
                (base32 "1maxp98gh64az3d9vz9br6zdd6rc9fmj2imvax4by85g6kxvdz1i"))
               (file-name (string-append "stumpwm-" version ".tar.gz"))))
     (build-system asdf-build-system/sbcl)
-    (inputs `(("sbcl-cl-ppcre" ,sbcl-cl-ppcre)
-              ("sbcl-clx" ,sbcl-clx)))
+    (inputs `(("cl-ppcre" ,sbcl-cl-ppcre)
+              ("clx" ,sbcl-clx)))
     (outputs '("out" "lib"))
     (arguments
      '(#:phases
@@ -966,7 +966,7 @@ multiple inspectors with independent history.")
   (package
     (inherit sbcl-slynk-boot0)
     (name "sbcl-slynk-arglists")
-    (inputs `(("sbcl-slynk" ,sbcl-slynk-boot0)))
+    (inputs `(("slynk" ,sbcl-slynk-boot0)))
     (arguments
      `(#:asd-file "slynk.asd"
        ,@(package-arguments sbcl-slynk-boot0)))))
@@ -986,7 +986,7 @@ multiple inspectors with independent history.")
   (package
     (inherit sbcl-slynk-arglists)
     (name "sbcl-slynk-fancy-inspector")
-    (inputs `(("sbcl-slynk-util" ,sbcl-slynk-util)
+    (inputs `(("slynk-util" ,sbcl-slynk-util)
               ,@(package-inputs sbcl-slynk-arglists)))))
 
 (define ecl-slynk-fancy-inspector
diff --git a/guix/build-system/asdf.scm b/guix/build-system/asdf.scm
index 4b5af95c9..d02565b2d 100644
--- a/guix/build-system/asdf.scm
+++ b/guix/build-system/asdf.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2016 Andy Patterson <[email-masked]>
+;;; Copyright © 2016, 2017 Andy Patterson <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -163,33 +163,35 @@ set up using CL source package conventions."
          (match-lambda
            ((name content . rest)
             (let* ((is-package? (package? content))
-                   (new-content (if is-package? (transform content) content))
-                   (new-name (if (and is-package?
-                                      (string-prefix? from-prefix name))
-                                 (package-name new-content)
-                                 name)))
-              `(,new-name ,new-content ,@rest)))))
+                   (new-content (if is-package? (transform content) content)))
+              `(,name ,new-content ,@rest)))))
 
        ;; Special considerations for source packages: CL inputs become
-       ;; propagated, and un-handled arguments are removed. Native inputs are
-       ;; removed as are extraneous outputs.
+       ;; propagated, and un-handled arguments are removed.
+
        (define new-propagated-inputs
          (if target-is-source?
              (map rewrite
-                  (filter (match-lambda
-                            ((_ input . _)
-                             (has-from-build-system? input)))
-                          (package-inputs pkg)))
-             '()))
-
-       (define new-inputs
+                  (append
+                   (filter (match-lambda
+                             ((_ input . _)
+                              (has-from-build-system? input)))
+                           (append (package-inputs pkg)
+                                   ;; The native inputs might be needed just
+                                   ;; to load the system.
+                                   (package-native-inputs pkg)))
+                   (package-propagated-inputs pkg)))
+
+             (map rewrite (package-propagated-inputs pkg))))
+
+       (define (new-inputs inputs-getter)
          (if target-is-source?
              (map rewrite
                   (filter (match-lambda
                             ((_ input . _)
                              (not (has-from-build-system? input))))
-                          (package-inputs pkg)))
-             (map rewrite (package-inputs pkg))))
+                          (inputs-getter pkg)))
+             (map rewrite (inputs-getter pkg))))
 
        (define base-arguments
          (if target-is-source?
@@ -212,11 +214,9 @@ set up using CL source package conventions."
            (arguments
             (substitute-keyword-arguments base-arguments
               ((#:phases phases) (list phases-transformer phases))))
-           (inputs new-inputs)
+           (inputs (new-inputs package-inputs))
            (propagated-inputs new-propagated-inputs)
-           (native-inputs (if target-is-source?
-                              '()
-                              (map rewrite (package-native-inputs pkg))))
+           (native-inputs (new-inputs package-native-inputs))
            (outputs (if target-is-source?
                         '("out")
                         (package-outputs pkg)))))
-- 
2.11.1