From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:50073) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL70c-0006DT-B7 for guix-patches@gnu.org; Thu, 17 Oct 2019 10:44:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iL70a-0006nh-2k for guix-patches@gnu.org; Thu, 17 Oct 2019 10:44:10 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39847) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iL70Z-0006n4-Hp for guix-patches@gnu.org; Thu, 17 Oct 2019 10:44:08 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iL70Z-0006pj-G0 for guix-patches@gnu.org; Thu, 17 Oct 2019 10:44:07 -0400 Subject: [bug#37791] [PATCH 1/4] build-system/asdf: Fix package transform. Resent-Message-ID: From: Guillaume Le Vaillant Date: Thu, 17 Oct 2019 16:43:09 +0200 Message-Id: <20191017144312.13121-1-glv@posteo.net> In-Reply-To: <87pnivsajn.fsf@yamatai> References: <87pnivsajn.fsf@yamatai> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: 37791@debbugs.gnu.org Cc: Guillaume Le Vaillant * guix/build-system/asdf.scm (package-with-build-system): [find-input-package]: New function. [rewrite]: Use it. --- guix/build-system/asdf.scm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/guix/build-system/asdf.scm b/guix/build-system/asdf.scm index af04084c86..f794bf006b 100644 --- a/guix/build-system/asdf.scm +++ b/guix/build-system/asdf.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016, 2017 Andy Patterson +;;; Copyright © 2019 Guillaume Le Vaillant ;;; ;;; This file is part of GNU Guix. ;;; @@ -32,6 +33,7 @@ #:use-module (ice-9 regex) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) + #:use-module (gnu packages) #:export (%asdf-build-system-modules %asdf-build-modules asdf-build @@ -160,13 +162,22 @@ set up using CL source package conventions." (define (has-from-build-system? pkg) (eq? from-build-system (package-build-system pkg))) + (define (find-input-package pkg) + (let* ((name (package-name pkg)) + (new-name (transform-package-name name)) + (pkgs (find-packages-by-name new-name))) + (if (null? pkgs) #f (list-ref pkgs 0)))) + (define transform (mlambda (pkg) (define rewrite (match-lambda ((name content . rest) (let* ((is-package? (package? content)) - (new-content (if is-package? (transform content) content))) + (new-content (if is-package? + (or (find-input-package content) + (transform content)) + content))) `(,name ,new-content ,@rest))))) ;; Special considerations for source packages: CL inputs become -- 2.23.0