From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35592) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fvFdi-0000QG-6s for guix-patches@gnu.org; Thu, 30 Aug 2018 01:37:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fvFde-0005eM-WD for guix-patches@gnu.org; Thu, 30 Aug 2018 01:37:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:32781) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fvFde-0005dF-Rl for guix-patches@gnu.org; Thu, 30 Aug 2018 01:37:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fvFde-00076V-L6 for guix-patches@gnu.org; Thu, 30 Aug 2018 01:37:02 -0400 Subject: [bug#32582] [PATCH 1/5] build-system/asdf: Handle all asdf dependency specifications. Resent-Message-ID: From: Andy Patterson Date: Thu, 30 Aug 2018 01:36:28 -0400 Message-Id: <20180830053632.26414-1-ajpatter@uwaterloo.ca> In-Reply-To: <20180830012813.7830cfc6@uwaterloo.ca> References: <20180830012813.7830cfc6@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: 32582@debbugs.gnu.org Add support for dependencies of the form (:version ), (:feature ) and (:require ), as defined by . * 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 | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/guix/build/lisp-utils.scm b/guix/build/lisp-utils.scm index 21cb620d5..3a7afab43 100644 --- a/guix/build/lisp-utils.scm +++ b/guix/build/lisp-utils.scm @@ -81,6 +81,20 @@ "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. Handles dependency definitions of the +dependency-def form described by +." + (match dependency + ((':version name rest ...) + `(:version ,(normalize-string name) ,@rest)) + ((':feature feature-specification dependency-specification) + `(:feature + ,feature-specification + ,(normalize-dependency dependency-specification))) + ((? string? name) (normalize-string name)) + (require-specification require-specification))) + (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 +287,24 @@ 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 + ((':version name _ ...) name) + ((':feature _ dependency-specification) + (dependency-name dependency-specification)) + ((? string? name) name) + (_ #f))) + (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.18.0