Archived
1
0
Fork 0

gnu: gn: Use G-expression.

* gnu/packages/build-tools.scm (gn)[arguments]: Convert to G-expression.
This commit is contained in:
Marius Bakke 2022-11-28 04:39:59 +01:00
parent e069db7e30
commit 6f0a8371fe
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA

View file

@ -219,22 +219,24 @@ programs and other files depend.")
(file-name (git-file-name name version)))) (file-name (git-file-name name version))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
`(#:phases (modify-phases %standard-phases (list #:phases
(add-before 'configure 'set-build-environment #~(modify-phases %standard-phases
(lambda _ (add-before 'configure 'set-build-environment
(setenv "CC" "gcc") (setenv "CXX" "g++") (lambda _
(setenv "AR" "ar"))) (setenv "CC" "gcc")
(replace 'configure (setenv "CXX" "g++")
(lambda _ (setenv "AR" "ar")))
(invoke "python" "build/gen.py" (replace 'configure
"--no-last-commit-position"))) (lambda _
(add-after 'configure 'create-last-commit-position (invoke "python" "build/gen.py"
(lambda _ "--no-last-commit-position")))
;; Mimic GenerateLastCommitPosition from gen.py. (add-after 'configure 'create-last-commit-position
(call-with-output-file "out/last_commit_position.h" (lambda _
(lambda (port) ;; Mimic GenerateLastCommitPosition from gen.py.
(format port (call-with-output-file "out/last_commit_position.h"
"// Generated by Guix. (lambda (port)
(format port
"// Generated by Guix.
#ifndef OUT_LAST_COMMIT_POSITION_H_ #ifndef OUT_LAST_COMMIT_POSITION_H_
#define OUT_LAST_COMMIT_POSITION_H_ #define OUT_LAST_COMMIT_POSITION_H_
@ -244,23 +246,23 @@ programs and other files depend.")
#endif // OUT_LAST_COMMIT_POSITION_H_ #endif // OUT_LAST_COMMIT_POSITION_H_
" "
,revision ,revision ,(string-take commit 12)))))) #$revision #$revision
(replace 'build #$(string-take commit 12))))))
(lambda _ (replace 'build
(invoke "ninja" "-C" "out" "gn" (lambda _
"-j" (number->string (parallel-job-count))))) (invoke "ninja" "-C" "out" "gn"
(replace 'check "-j" (number->string (parallel-job-count)))))
(lambda* (#:key tests? #:allow-other-keys) (replace 'check
(if tests? (lambda* (#:key tests? #:allow-other-keys)
(begin (if tests?
(invoke "ninja" "-C" "out" "gn_unittests" (begin
"-j" (number->string (parallel-job-count))) (invoke "ninja" "-C" "out" "gn_unittests"
(invoke "./out/gn_unittests")) "-j" (number->string (parallel-job-count)))
(format #t "test suite not run~%")))) (invoke "./out/gn_unittests"))
(replace 'install (format #t "test suite not run~%"))))
(lambda* (#:key outputs #:allow-other-keys) (replace 'install
(let ((out (assoc-ref outputs "out"))) (lambda _
(install-file "out/gn" (string-append out "/bin")))))))) (install-file "out/gn" (string-append #$output "/bin")))))))
(native-inputs (native-inputs
(list ninja python-wrapper)) (list ninja python-wrapper))
(synopsis "Generate Ninja build files") (synopsis "Generate Ninja build files")