From: Guillaume Le Vaillant <glv@posteo.net>
To: Efraim Flashner <efraim@flashner.co.il>
Cc: guix-devel@gnu.org
Subject: Re: Question about sbcl-package->ecl-package
Date: Thu, 17 Oct 2019 14:01:00 +0200 [thread overview]
Message-ID: <87v9snshs3.fsf@yamatai> (raw)
In-Reply-To: <87zhi0u6m7.fsf@yamatai>
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 <glv@posteo.net>
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 <ajpatter@uwaterloo.ca>
+;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
;;;
;;; 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?
next prev parent reply other threads:[~2019-10-17 12:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-16 9:26 Question about sbcl-package->ecl-package Guillaume Le Vaillant
2019-10-16 11:59 ` Pierre Neidhardt
2019-10-16 12:47 ` Efraim Flashner
2019-10-16 14:06 ` Guillaume Le Vaillant
2019-10-17 12:01 ` Guillaume Le Vaillant [this message]
2019-10-17 12:20 ` Pierre Neidhardt
2019-10-17 13:09 ` Guillaume Le Vaillant
2019-10-17 13:16 ` Pierre Neidhardt
2019-10-17 13:35 ` Guillaume Le Vaillant
2019-10-17 13:48 ` Pierre Neidhardt
2019-10-17 14:47 ` Guillaume Le Vaillant
2019-10-17 14:54 ` Pierre Neidhardt
2019-10-18 9:22 ` Pierre Neidhardt
2019-10-18 11:55 ` Guillaume Le Vaillant
2019-10-17 13:16 ` Guillaume Le Vaillant
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87v9snshs3.fsf@yamatai \
--to=glv@posteo.net \
--cc=efraim@flashner.co.il \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).