From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guillaume Le Vaillant Subject: Re: Question about sbcl-package->ecl-package Date: Thu, 17 Oct 2019 14:01:00 +0200 Message-ID: <87v9snshs3.fsf@yamatai> References: <871rvdujku.fsf@yamatai> <87k194zyt6.fsf@ambrevar.xyz> <20191016124745.GH1014@E5400> <87zhi0u6m7.fsf@yamatai> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:51045) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL4Sq-0002yc-TC for guix-devel@gnu.org; Thu, 17 Oct 2019 08:01:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iL4Sp-0007XR-8e for guix-devel@gnu.org; Thu, 17 Oct 2019 08:01:08 -0400 Received: from mout02.posteo.de ([185.67.36.66]:47239) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iL4So-0007WU-Az for guix-devel@gnu.org; Thu, 17 Oct 2019 08:01:07 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 4686C2400FC for ; Thu, 17 Oct 2019 14:01:02 +0200 (CEST) In-reply-to: <87zhi0u6m7.fsf@yamatai> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Efraim Flashner Cc: guix-devel@gnu.org Guillaume Le Vaillant skribis: > However, when I try to compile 'ecl-simple-parallel-tasks', guix first > tries to build a different derivation of 'ecl-chanl', which fails > because it apparently doesn't have the modified phases declared in the > definition of 'ecl-chanl'. I was able to get guix to fetch the right package as input using the following patch: --8<---------------cut here---------------start------------->8--- >From 4213b8b9d64e2536df7ede308772a38cc71e2bf4 Mon Sep 17 00:00:00 2001 From: Guillaume Le Vaillant Date: Thu, 17 Oct 2019 12:07:38 +0200 Subject: [PATCH] build-system/asdf: Fix package transform. * 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 =C2=A9 2016, 2017 Andy Patterson +;;; Copyright =C2=A9 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))) =20 + (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))))) =20 ;; Special considerations for source packages: CL inputs become --=20 2.23.0 --8<---------------cut here---------------end--------------->8--- I was not sure if using the '(gnu packages)' module here (for the 'find-packages-by-name' function) would cause a circular dependency or not, but apparently it works. What do you think about this patch? Should I submit it to guix-patches?