diff options
Diffstat (limited to 'gnu/packages/build-tools.scm')
-rw-r--r-- | gnu/packages/build-tools.scm | 89 |
1 files changed, 48 insertions, 41 deletions
diff --git a/gnu/packages/build-tools.scm b/gnu/packages/build-tools.scm index 8627f699a1..6c1350c44f 100644 --- a/gnu/packages/build-tools.scm +++ b/gnu/packages/build-tools.scm @@ -204,8 +204,8 @@ programs and other files depend.") (license license:bsd-3))) (define-public gn - (let ((commit "e327ffdc503815916db2543ec000226a8df45163") - (revision "1819")) ;as returned by `git describe`, used below + (let ((commit "1c4151ff5c1d6fbf7fa800b8d4bb34d3abc03a41") + (revision "2072")) ;as returned by `git describe`, used below (package (name "gn") (version (git-version "0.0" revision commit)) @@ -215,49 +215,56 @@ programs and other files depend.") (uri (git-reference (url home-page) (commit commit))) (sha256 (base32 - "0kvlfj3www84zp1vmxh76x8fdjm9hyk8lkh2vdsidafpmm75fphr")) + "02621c9nqpr4pwcapy31x36l5kbyd0vdgd0wdaxj5p8hrxk67d6b")) (file-name (git-file-name name version)))) (build-system gnu-build-system) (arguments - `(#:phases (modify-phases %standard-phases - (add-before 'configure 'set-build-environment - (lambda _ - (setenv "CC" "gcc") (setenv "CXX" "g++") - (setenv "AR" "ar"))) - (replace 'configure - (lambda _ - (invoke "python" "build/gen.py" - "--no-last-commit-position"))) - (add-after 'configure 'create-last-commit-position - (lambda _ - ;; Create "last_commit_position.h" to avoid a dependency - ;; on 'git' (and the checkout..). - (call-with-output-file "out/last_commit_position.h" - (lambda (port) - (format port - (string-append - "#define LAST_COMMIT_POSITION_NUM ~a\n" - "#define LAST_COMMIT_POSITION \"~a (~a)\"\n") - ,revision ,revision ,(string-take commit 8)))))) - (replace 'build - (lambda _ - (invoke "ninja" "-C" "out" "gn" - "-j" (number->string (parallel-job-count))))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (if tests? - (begin - (invoke "ninja" "-C" "out" "gn_unittests" - "-j" (number->string (parallel-job-count))) - (invoke "./out/gn_unittests")) - (format #t "test suite not run~%")))) - (replace 'install - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (install-file "out/gn" (string-append out "/bin")))))))) + (list #:phases + #~(modify-phases %standard-phases + (add-before 'configure 'set-build-environment + (lambda _ + (setenv "CC" "gcc") + (setenv "CXX" "g++") + (setenv "AR" "ar"))) + (replace 'configure + (lambda _ + (invoke "python" "build/gen.py" + "--no-last-commit-position"))) + (add-after 'configure 'create-last-commit-position + (lambda _ + ;; Mimic GenerateLastCommitPosition from gen.py. + (call-with-output-file "out/last_commit_position.h" + (lambda (port) + (format port + "// Generated by Guix. + +#ifndef OUT_LAST_COMMIT_POSITION_H_ +#define OUT_LAST_COMMIT_POSITION_H_ + +#define LAST_COMMIT_POSITION_NUM ~a +#define LAST_COMMIT_POSITION \"~a (~a)\" + +#endif // OUT_LAST_COMMIT_POSITION_H_ +" + #$revision #$revision + #$(string-take commit 12)))))) + (replace 'build + (lambda _ + (invoke "ninja" "-C" "out" "gn" + "-j" (number->string (parallel-job-count))))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (if tests? + (begin + (invoke "ninja" "-C" "out" "gn_unittests" + "-j" (number->string (parallel-job-count))) + (invoke "./out/gn_unittests")) + (format #t "test suite not run~%")))) + (replace 'install + (lambda _ + (install-file "out/gn" (string-append #$output "/bin"))))))) (native-inputs - `(("ninja" ,ninja) - ("python" ,python-wrapper))) + (list ninja python-wrapper)) (synopsis "Generate Ninja build files") (description "GN is a tool that collects information about a project from @file{.gn} |