guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about sbcl-package->ecl-package


From: Guillaume Le Vaillant
Subject: Re: Question about sbcl-package->ecl-package
Date: Thu, 17 Oct 2019 14:01:00 +0200
User-agent: mu4e 1.2.0; emacs 26.3

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 <address@hidden>
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 © 2016, 2017 Andy Patterson <address@hidden>
+;;; Copyright © 2019 Guillaume Le Vaillant <address@hidden>
 ;;;
 ;;; 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
--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?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]