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.
This commit is contained in:
Pierre Neidhardt 2020-02-24 13:50:43 +01:00
parent 1fde948ade
commit 39fecacaef
2 changed files with 22 additions and 6 deletions

View file

@ -23,6 +23,7 @@
#:use-module (guix search-paths) #:use-module (guix search-paths)
#:use-module (guix build-system) #:use-module (guix build-system)
#:use-module (guix build-system gnu) #:use-module (guix build-system gnu)
#:use-module (guix build-system copy)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (ice-9 match) #:use-module (ice-9 match)
#:use-module (srfi srfi-1) #:use-module (srfi srfi-1)
@ -37,7 +38,7 @@
;; Commentary: ;; Commentary:
;; ;;
;; Standard build procedure for binary packages. This is implemented as an ;; Standard build procedure for binary packages. This is implemented as an
;; extension of `gnu-build-system'. ;; extension of `copy-build-system'.
;; ;;
;; Code: ;; Code:
@ -45,7 +46,7 @@
;; Build-side modules imported by default. ;; Build-side modules imported by default.
`((nonguix build binary-build-system) `((nonguix build binary-build-system)
(nonguix build utils) (nonguix build utils)
,@%gnu-build-system-modules)) ,@%copy-build-system-modules))
(define (default-patchelf) (define (default-patchelf)
"Return the default patchelf package." "Return the default patchelf package."
@ -78,7 +79,6 @@
`(("source" ,source)) `(("source" ,source))
'()) '())
,@inputs ,@inputs
;; Keep the standard inputs of 'gnu-build-system'. ;; Keep the standard inputs of 'gnu-build-system'.
,@(standard-packages))) ,@(standard-packages)))
(build-inputs `(("patchelf" ,patchelf) (build-inputs `(("patchelf" ,patchelf)
@ -94,7 +94,7 @@
#:key (guile #f) #:key (guile #f)
(outputs '("out")) (outputs '("out"))
(patchelf-plan ''()) (patchelf-plan ''())
(install-plan ''(("." (".") "./"))) (install-plan ''(("." "./")))
(search-paths '()) (search-paths '())
(out-of-source? #t) (out-of-source? #t)
(validate-runpath? #t) (validate-runpath? #t)

View file

@ -30,7 +30,11 @@
;; ;;
;; Code: ;; Code:
(define* (install #:key install-plan outputs #:allow-other-keys) (define (new-install)
"Return the copy-build-system `install' procedure."
(@@ (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. "Copy files from the \"source\" build input to the \"out\" output according to INSTALL-PLAN.
An INSTALL-PLAN is made of three elements: An INSTALL-PLAN is made of three elements:
@ -70,6 +74,18 @@ represent the target full path, which only makes sense for single files."
(for-each install install-plan) (for-each install install-plan)
#t) #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) (define* (patchelf #:key inputs outputs patchelf-plan #:allow-other-keys)
"Set the interpreter and the RPATH of files as per the PATCHELF-PLAN. "Set the interpreter and the RPATH of files as per the PATCHELF-PLAN.
@ -132,7 +148,7 @@ The inputs are optional when the file is an executable."
(replace 'install install))) (replace 'install install)))
(define* (binary-build #:key inputs (phases %standard-phases) (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." "Build the given package, applying all of PHASES in order."
(apply gnu:gnu-build #:inputs inputs #:phases phases args)) (apply gnu:gnu-build #:inputs inputs #:phases phases args))