From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46349) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cx3lm-0000UP-4y for guix-patches@gnu.org; Sat, 08 Apr 2017 23:44:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cx3li-0002ye-Vf for guix-patches@gnu.org; Sat, 08 Apr 2017 23:44:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:40533) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cx3li-0002xi-OB for guix-patches@gnu.org; Sat, 08 Apr 2017 23:44:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cx3li-0005Nd-Cx for guix-patches@gnu.org; Sat, 08 Apr 2017 23:44:02 -0400 Subject: bug#26346: [PATCH 19/20] build-system/asdf: Handle versioned asdf dependencies. Resent-Message-ID: From: Andy Patterson Date: Sat, 8 Apr 2017 23:43:32 -0400 Message-Id: <20170409034333.3801-2-ajpatter@uwaterloo.ca> In-Reply-To: <20170409034333.3801-1-ajpatter@uwaterloo.ca> References: <20170403003732.1c3b8afb@uwaterloo.ca> <20170409034333.3801-1-ajpatter@uwaterloo.ca> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 26346@debbugs.gnu.org Add support for depencies of the form (:version ). * guix/build/lisp-utils.scm (normalize-dependency): New variable. (make-asd-file)[dependencies]: Use it to generate dependencies with normalized names. [dependency-name]: New variable. [registry]: Use it to flatten the normalized dependencies. --- guix/build/lisp-utils.scm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/guix/build/lisp-utils.scm b/guix/build/lisp-utils.scm index 6d9341bb2..3744bac9d 100644 --- a/guix/build/lisp-utils.scm +++ b/guix/build/lisp-utils.scm @@ -81,6 +81,13 @@ "Replace invalid characters in STR with a hyphen." (string-join (string-tokenize str valid-char-set) "-")) +(define (normalize-dependency dependency) + "Normalize the name of DEPENDENCY." + (match dependency + ((:version name rest ...) + `(:version ,(normalize-string name) ,@rest)) + (name (normalize-string name)))) + (define (inputs->asd-file-map inputs) "Produce a hash table of the form (system . asd-file), where system is the name of an ASD system, and asd-file is the full path to its definition." @@ -273,16 +280,21 @@ system to find its dependencies, as described by GENERATE-DEPENDENCY-LINKS." (system-dependencies system system-asd-file))) (if (eq? 'NIL deps) '() - (map normalize-string deps)))) + (map normalize-dependency deps)))) (define lisp-input-map (inputs->asd-file-map inputs)) + (define dependency-name + (match-lambda + ((_ name _ ...) name) + (name name))) + (define registry (filter-map hash-get-handle (make-list (length dependencies) lisp-input-map) - dependencies)) + (map dependency-name dependencies))) (call-with-output-file asd-file (lambda (port) -- 2.12.2