gnu: zig-0.10: Use gexp.
* gnu/packages/zig.scm (zig-0.10)[arguments]: Use gexp. Change-Id: I8ba6a4bd92784637cd3a4448e2f99ed521a17f3a
This commit is contained in:
parent
282927e970
commit
ca8dda2428
|
@ -20,6 +20,7 @@
|
||||||
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
(define-module (gnu packages zig)
|
(define-module (gnu packages zig)
|
||||||
|
#:use-module (guix gexp)
|
||||||
#:use-module (guix packages)
|
#:use-module (guix packages)
|
||||||
#:use-module (guix utils)
|
#:use-module (guix utils)
|
||||||
#:use-module (guix git-download)
|
#:use-module (guix git-download)
|
||||||
|
@ -53,24 +54,24 @@ (define-public zig-0.10
|
||||||
(native-inputs
|
(native-inputs
|
||||||
(list llvm-15))
|
(list llvm-15))
|
||||||
(arguments
|
(arguments
|
||||||
`(#:configure-flags
|
(list
|
||||||
(list ,@(if (%current-target-system)
|
#:configure-flags
|
||||||
'(string-append "-DZIG_TARGET_TRIPLE="
|
#~(list #$@(if (%current-target-system)
|
||||||
(%current-target-system))
|
(list (string-append "-DZIG_TARGET_TRIPLE="
|
||||||
|
(%current-target-system)))
|
||||||
'())
|
'())
|
||||||
(string-append "-DZIG_TARGET_MCPU=baseline")
|
"-DZIG_TARGET_MCPU=baseline"
|
||||||
"-DZIG_SHARED_LLVM=ON"
|
"-DZIG_SHARED_LLVM=ON"
|
||||||
(string-append "-DZIG_LIB_DIR=" (assoc-ref %outputs "out")
|
(string-append "-DZIG_LIB_DIR=" #$output "/lib/zig"))
|
||||||
"/lib/zig"))
|
|
||||||
#:validate-runpath? #f ;TODO: zig binary can't find ld-linux.
|
#:validate-runpath? #f ;TODO: zig binary can't find ld-linux.
|
||||||
#:out-of-source? #f ;for tests
|
#:out-of-source? #f ;for tests
|
||||||
#:phases
|
#:phases
|
||||||
(modify-phases %standard-phases
|
#~(modify-phases %standard-phases
|
||||||
(add-after 'unpack 'set-env-variables
|
(add-after 'unpack 'set-env-variables
|
||||||
(lambda* (#:key inputs native-inputs #:allow-other-keys)
|
(lambda _
|
||||||
;; Set CC, since the stage 2 zig relies on it to find the libc
|
;; Set CC, since the stage 2 zig relies on it to find the libc
|
||||||
;; installation, and otherwise silently links against its own.
|
;; installation, and otherwise silently links against its own.
|
||||||
(setenv "CC" ,(cc-for-target))
|
(setenv "CC" #$(cc-for-target))
|
||||||
;; Set cache dir, otherwise Zig looks for `$HOME/.cache'.
|
;; Set cache dir, otherwise Zig looks for `$HOME/.cache'.
|
||||||
(setenv "ZIG_GLOBAL_CACHE_DIR"
|
(setenv "ZIG_GLOBAL_CACHE_DIR"
|
||||||
(string-append (getcwd) "/zig-cache"))))
|
(string-append (getcwd) "/zig-cache"))))
|
||||||
|
@ -82,9 +83,9 @@ (define-public zig-0.10
|
||||||
(("/usr/bin/env") (search-input-file inputs "/bin/env")))))
|
(("/usr/bin/env") (search-input-file inputs "/bin/env")))))
|
||||||
(delete 'check)
|
(delete 'check)
|
||||||
(add-after 'install 'check
|
(add-after 'install 'check
|
||||||
(lambda* (#:key outputs tests? #:allow-other-keys)
|
(lambda* (#:key tests? #:allow-other-keys)
|
||||||
(when tests?
|
(when tests?
|
||||||
(invoke (string-append (assoc-ref outputs "out") "/bin/zig")
|
(invoke (string-append #$output "/bin/zig")
|
||||||
"build" "test"
|
"build" "test"
|
||||||
;; We're not testing the compiler bootstrap chain.
|
;; We're not testing the compiler bootstrap chain.
|
||||||
"-Dskip-stage1"
|
"-Dskip-stage1"
|
||||||
|
|
Loading…
Reference in a new issue