mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 23:46:13 -05:00
build-system/asdf: Fix package transform.
* guix/build-system/asdf.scm (package-with-build-system): [find-input-package]: New function. [rewrite]: Use it.
This commit is contained in:
parent
f733862cc9
commit
5cace974a4
1 changed files with 12 additions and 1 deletions
|
@ -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 @@ (define-module (guix build-system asdf)
|
|||
#: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 @@ (define (transform-package-name name)
|
|||
(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
|
||||
|
|
Loading…
Reference in a new issue