summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Neidhardt <mail@ambrevar.xyz>2020-02-24 13:50:43 +0100
committerPierre Neidhardt <mail@ambrevar.xyz>2020-02-24 13:50:43 +0100
commit453ec521daeb739b4c794516ba5f03260e91fe00 (patch)
treebd5f249875e0c0864118b883676ef8191eec703a
parentff6ca98099c7c90e64256236a49ab21fa96fe11e (diff)
nonguix: Use the install-plan of the copy-build-system in the binary-build-system.
* nonguix/build-system/binary.scm (lower): Adapt the default value of the install plan. * nonguix/build/binary-build-system.scm (new-install): New procedure. (old-install): Rename former `install' procedure to this. (install): New procedure that dispatches over old-install and new-install.
-rw-r--r--nonguix/build-system/binary.scm6
-rw-r--r--nonguix/build/binary-build-system.scm27
2 files changed, 28 insertions, 5 deletions
diff --git a/nonguix/build-system/binary.scm b/nonguix/build-system/binary.scm
index 2c2bae6..2655e15 100644
--- a/nonguix/build-system/binary.scm
+++ b/nonguix/build-system/binary.scm
@@ -23,6 +23,7 @@
#:use-module (guix search-paths)
#:use-module (guix build-system)
#:use-module (guix build-system gnu)
+ ;; #:use-module (guix build-system copy)
#:use-module (guix packages)
#:use-module (ice-9 match)
#:use-module (srfi srfi-1)
@@ -37,7 +38,7 @@
;; Commentary:
;;
;; Standard build procedure for binary packages. This is implemented as an
-;; extension of `gnu-build-system'.
+;; extension of `copy-build-system'.
;;
;; Code:
@@ -78,7 +79,6 @@
`(("source" ,source))
'())
,@inputs
-
;; Keep the standard inputs of 'gnu-build-system'.
,@(standard-packages)))
(build-inputs `(("patchelf" ,patchelf)
@@ -94,7 +94,7 @@
#:key (guile #f)
(outputs '("out"))
(patchelf-plan ''())
- (install-plan ''(("." (".") "./")))
+ (install-plan ''(("." "./")))
(search-paths '())
(out-of-source? #t)
(validate-runpath? #t)
diff --git a/nonguix/build/binary-build-system.scm b/nonguix/build/binary-build-system.scm
index 984f38c..8e4b82f 100644
--- a/nonguix/build/binary-build-system.scm
+++ b/nonguix/build/binary-build-system.scm
@@ -18,6 +18,8 @@
(define-module (nonguix build binary-build-system)
#:use-module ((guix build gnu-build-system) #:prefix gnu:)
+ #:use-module ((guix build-system copy)) ; TODO: Do we need it?
+ #:use-module ((guix build copy-build-system))
#:use-module (nonguix build utils)
#:use-module (guix build utils)
#:use-module (ice-9 match)
@@ -30,7 +32,16 @@
;;
;; Code:
-(define* (install #:key install-plan outputs #:allow-other-keys)
+(define (new-install)
+ "Return the copy-build-system `install' procedure."
+
+ ;; Do not use `@' to avoid introducing circular dependencies.
+ ;; TODO: Does not work?!?
+ ;; (let ((module (resolve-interface '(guix build copy-build-system))))
+ ;; (module-ref module 'install))
+ (@@ (guix build copy-build-system) install))
+
+(define* (old-install #:key install-plan outputs #:allow-other-keys)
"Copy files from the \"source\" build input to the \"out\" output according to INSTALL-PLAN.
An INSTALL-PLAN is made of three elements:
@@ -70,6 +81,18 @@ represent the target full path, which only makes sense for single files."
(for-each install install-plan)
#t)
+(define* (install #:key install-plan outputs #:allow-other-keys)
+ (define (install-old-format)
+ (warn "Install-plan format deprecated.
+Please update to the format of the copy-build-system.")
+ (old-install #:install-plan install-plan #:outputs outputs))
+ (match (car install-plan)
+ ((source (. matches) target)
+ (install-old-format))
+ ((source #f target)
+ (install-old-format))
+ (_ ((new-install) #:install-plan install-plan #:outputs outputs))))
+
(define* (patchelf #:key inputs outputs patchelf-plan #:allow-other-keys)
"Set the interpreter and the RPATH of files as per the PATCHELF-PLAN.
@@ -132,7 +155,7 @@ The inputs are optional when the file is an executable."
(replace 'install install)))
(define* (binary-build #:key inputs (phases %standard-phases)
- #:allow-other-keys #:rest args)
+ #:allow-other-keys #:rest args)
"Build the given package, applying all of PHASES in order."
(apply gnu:gnu-build #:inputs inputs #:phases phases args))