gnu: cross-base: Inherit arguments from 'mig'.

That way, 'xmig' inherits the 'avoid-perl-dependency' build phase.

* gnu/packages/hurd.scm (mig)[arguments]: In 'avoid-perl-dependency',
use 'find-files' to locate the "mig" executable(s).
* gnu/packages/cross-base.scm (cross-kernel-headers*)[xmig]: Use
'substitute-keyword-arguments'.
This commit is contained in:
Ludovic Courtès 2023-03-04 17:40:44 +01:00
parent 3442edac89
commit a6194d1f35
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 19 additions and 17 deletions

View file

@ -415,19 +415,20 @@ (define xmig
(inherit mig) (inherit mig)
(name (string-append "mig-cross")) (name (string-append "mig-cross"))
(arguments (arguments
(list #:modules '((guix build gnu-build-system) (substitute-keyword-arguments (package-arguments mig)
(guix build utils) ((#:configure-flags flags #~'())
(srfi srfi-26)) #~(list #$(string-append "--target=" target)))
#:phases ((#:tests? _ #f)
#~(modify-phases %standard-phases #f)
((#:phases phases #~%standard-phases)
#~(modify-phases #$phases
(add-before 'configure 'set-cross-headers-path (add-before 'configure 'set-cross-headers-path
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(let* ((mach #+(this-package-input xgnumach-headers-name)) (let* ((mach #+(this-package-input xgnumach-headers-name))
(cpath (string-append mach "/include"))) (cpath (string-append mach "/include")))
(for-each (cut setenv <> cpath) (for-each (lambda (variable)
'#$%gcc-cross-include-paths))))) (setenv variable cpath))
#:configure-flags #~(list #$(string-append "--target=" target)) '#$%gcc-cross-include-paths))))))))
#:tests? #f))
(propagated-inputs (list xgnumach-headers)) (propagated-inputs (list xgnumach-headers))
(native-inputs (native-inputs
(modify-inputs (package-native-inputs mig) (modify-inputs (package-native-inputs mig)

View file

@ -130,10 +130,11 @@ (define-public mig
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-after 'install 'avoid-perl-dependency (add-after 'install 'avoid-perl-dependency
(lambda* (#:key build inputs outputs #:allow-other-keys) (lambda* (#:key build inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))) (let* ((out (assoc-ref outputs "out"))
;; By default 'mig' uses Perl to compute (bin (string-append out "/bin")))
;; 'libexecdir_rel'. Avoid it. ;; By default 'mig' (or 'TARGET-mig') uses Perl to
(substitute* (string-append out "/bin/mig") ;; compute 'libexecdir_rel'. Avoid it.
(substitute* (find-files bin "mig$")
(("^libexecdir_rel=.*") (("^libexecdir_rel=.*")
"libexecdir_rel=../libexec\n")))))))) "libexecdir_rel=../libexec\n"))))))))
(home-page "https://www.gnu.org/software/hurd/microkernel/mach/mig/gnu_mig.html") (home-page "https://www.gnu.org/software/hurd/microkernel/mach/mig/gnu_mig.html")