mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 23:46:13 -05:00
gnu: linux-libre: Use system->architecture.
* gnu/packages/linux.scm (linux-libre): Use system->architecture.
This commit is contained in:
parent
614d1738e2
commit
6d7ef2aad2
1 changed files with 8 additions and 8 deletions
|
@ -84,7 +84,7 @@ (define-module (gnu packages linux)
|
||||||
|
|
||||||
(define-public (system->linux-architecture arch)
|
(define-public (system->linux-architecture arch)
|
||||||
"Return the Linux architecture name for ARCH, a Guix system name such as
|
"Return the Linux architecture name for ARCH, a Guix system name such as
|
||||||
\"x86_64-linux\"."
|
\"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
|
||||||
(let ((arch (car (string-split arch #\-))))
|
(let ((arch (car (string-split arch #\-))))
|
||||||
(cond ((string=? arch "i686") "i386")
|
(cond ((string=? arch "i686") "i386")
|
||||||
((string-prefix? "mips" arch) "mips")
|
((string-prefix? "mips" arch) "mips")
|
||||||
|
@ -292,7 +292,7 @@ (define-public linux-libre
|
||||||
(modify-phases %standard-phases
|
(modify-phases %standard-phases
|
||||||
(delete 'configure)
|
(delete 'configure)
|
||||||
(replace 'build
|
(replace 'build
|
||||||
(lambda* (#:key system inputs #:allow-other-keys #:rest args)
|
(lambda* (#:key inputs #:allow-other-keys #:rest args)
|
||||||
;; Avoid introducing timestamps
|
;; Avoid introducing timestamps
|
||||||
(setenv "KCONFIG_NOTIMESTAMP" "1")
|
(setenv "KCONFIG_NOTIMESTAMP" "1")
|
||||||
(setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
|
(setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
|
||||||
|
@ -301,12 +301,12 @@ (define-public linux-libre
|
||||||
(system* "patch" "-p1" "--force"
|
(system* "patch" "-p1" "--force"
|
||||||
"-i" (assoc-ref inputs "patch/freedo+gnu"))
|
"-i" (assoc-ref inputs "patch/freedo+gnu"))
|
||||||
|
|
||||||
(let ((arch (car (string-split system #\-))))
|
(let ((arch ,(system->linux-architecture
|
||||||
(setenv "ARCH"
|
(or (%current-target-system)
|
||||||
(cond ((string=? arch "i686") "i386")
|
(%current-system)))))
|
||||||
((string=? arch "mips64el") "mips")
|
(setenv "ARCH" arch))
|
||||||
(else arch)))
|
|
||||||
(format #t "`ARCH' set to `~a'~%" (getenv "ARCH")))
|
(format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
|
||||||
|
|
||||||
(let ((build (assoc-ref %standard-phases 'build))
|
(let ((build (assoc-ref %standard-phases 'build))
|
||||||
(config (assoc-ref inputs "kconfig")))
|
(config (assoc-ref inputs "kconfig")))
|
||||||
|
|
Loading…
Reference in a new issue