summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2018-07-13 00:25:45 +0200
committerMarius Bakke <mbakke@fastmail.com>2018-07-13 00:25:45 +0200
commit49b6dc2b4e02269850dacc71d9e7ec93139ec5b5 (patch)
tree75c62cc7620a7602a37067dd01268393aec32698 /guix
parent7519dc95c7628ceeb5ed616604e8c432723a0a50 (diff)
parent2776b5d5bf3514717cf224de34c0bf2d894f1cee (diff)
Merge branch 'staging'
Diffstat (limited to 'guix')
-rw-r--r--guix/build-system/meson.scm3
-rw-r--r--guix/build/ant-build-system.scm98
-rw-r--r--guix/build/java-utils.scm2
-rw-r--r--guix/build/meson-build-system.scm15
4 files changed, 57 insertions, 61 deletions
diff --git a/guix/build-system/meson.scm b/guix/build-system/meson.scm
index 529a2b8b0f..e894e1472d 100644
--- a/guix/build-system/meson.scm
+++ b/guix/build-system/meson.scm
@@ -148,8 +148,7 @@ has a 'meson.build' file."
#:search-paths ',(map search-path-specification->sexp
search-paths)
#:phases
- (if (string-prefix? "arm" ,(or (%current-target-system)
- (%current-system)))
+ (if (string-prefix? "arm" ,system)
(modify-phases build-phases (delete 'fix-runpath))
build-phases)
#:configure-flags ,configure-flags
diff --git a/guix/build/ant-build-system.scm b/guix/build/ant-build-system.scm
index d081a2b313..d79b4d503b 100644
--- a/guix/build/ant-build-system.scm
+++ b/guix/build/ant-build-system.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2016, 2018 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -68,14 +68,11 @@
(target (@ (name "manifest"))
(mkdir (@ (dir "${manifest.dir}")))
- (echo (@ (file "${manifest.file}")
- (message ,(string-append
- (if main-class
- (string-append
- "Main-Class: " main-class
- "${line.separator}")
- "")
- "")))))
+ (manifest (@ (file "${manifest.file}"))
+ ,(if main-class
+ `(attribute (@ (name "Main-Class")
+ (value ,main-class)))
+ "")))
(target (@ (name "compile"))
(mkdir (@ (dir "${classes.dir}")))
@@ -150,7 +147,8 @@ to the default GNU unpack strategy."
(begin
(mkdir "src")
(with-directory-excursion "src"
- (zero? (system* "jar" "-xf" source))))
+ (invoke "jar" "-xf" source))
+ #t)
;; Use GNU unpack strategy for things that aren't jar archives.
((assq-ref gnu:%standard-phases 'unpack) #:source source)))
@@ -171,7 +169,7 @@ to the default GNU unpack strategy."
(define* (build #:key (make-flags '()) (build-target "jar")
#:allow-other-keys)
- (zero? (apply system* `("ant" ,build-target ,@make-flags))))
+ (apply invoke `("ant" ,build-target ,@make-flags)))
(define* (generate-jar-indices #:key outputs #:allow-other-keys)
"Generate file \"META-INF/INDEX.LIST\". This file does not use word wraps
@@ -181,10 +179,11 @@ grafting works - and so that the garbage collector doesn't collect
dependencies of this jar file."
(define (generate-index jar)
(invoke "jar" "-i" jar))
- (every (match-lambda
- ((output . directory)
- (every generate-index (find-files directory "\\.jar$"))))
- outputs))
+ (for-each (match-lambda
+ ((output . directory)
+ (for-each generate-index (find-files directory "\\.jar$"))))
+ outputs)
+ #t)
(define* (strip-jar-timestamps #:key outputs
#:allow-other-keys)
@@ -194,50 +193,49 @@ repack them. This is necessary to ensure that archives are reproducible."
(format #t "repacking ~a\n" jar)
(let* ((dir (mkdtemp! "jar-contents.XXXXXX"))
(manifest (string-append dir "/META-INF/MANIFEST.MF")))
- (and (with-directory-excursion dir
- (zero? (system* "jar" "xf" jar)))
- (delete-file jar)
- ;; XXX: copied from (gnu build install)
- (for-each (lambda (file)
- (let ((s (lstat file)))
- (unless (eq? (stat:type s) 'symlink)
- (utime file 0 0 0 0))))
- (find-files dir #:directories? #t))
+ (with-directory-excursion dir
+ (invoke "jar" "xf" jar))
+ (delete-file jar)
+ ;; XXX: copied from (gnu build install)
+ (for-each (lambda (file)
+ (let ((s (lstat file)))
+ (unless (eq? (stat:type s) 'symlink)
+ (utime file 0 0 0 0))))
+ (find-files dir #:directories? #t))
- ;; The jar tool will always set the timestamp on the manifest file
- ;; and the containing directory to the current time, even when we
- ;; reuse an existing manifest file. To avoid this we use "zip"
- ;; instead of "jar". It is important that the manifest appears
- ;; first.
- (with-directory-excursion dir
- (let* ((files (find-files "." ".*" #:directories? #t))
- ;; To ensure that the reference scanner can detect all
- ;; store references in the jars we disable compression
- ;; with the "-0" option.
- (command (if (file-exists? manifest)
- `("zip" "-0" "-X" ,jar ,manifest ,@files)
- `("zip" "-0" "-X" ,jar ,@files))))
- (unless (zero? (apply system* command))
- (error "'zip' failed"))))
- (utime jar 0 0)
- #t)))
+ ;; The jar tool will always set the timestamp on the manifest file
+ ;; and the containing directory to the current time, even when we
+ ;; reuse an existing manifest file. To avoid this we use "zip"
+ ;; instead of "jar". It is important that the manifest appears
+ ;; first.
+ (with-directory-excursion dir
+ (let* ((files (find-files "." ".*" #:directories? #t))
+ ;; To ensure that the reference scanner can detect all
+ ;; store references in the jars we disable compression
+ ;; with the "-0" option.
+ (command (if (file-exists? manifest)
+ `("zip" "-0" "-X" ,jar ,manifest ,@files)
+ `("zip" "-0" "-X" ,jar ,@files))))
+ (apply invoke command)))
+ (utime jar 0 0)
+ #t))
- (every (match-lambda
- ((output . directory)
- (every repack-archive (find-files directory "\\.jar$"))))
- outputs))
+ (for-each (match-lambda
+ ((output . directory)
+ (for-each repack-archive (find-files directory "\\.jar$"))))
+ outputs)
+ #t)
(define* (check #:key target (make-flags '()) (tests? (not target))
(test-target "check")
#:allow-other-keys)
(if tests?
- (zero? (apply system* `("ant" ,test-target ,@make-flags)))
- (begin
- (format #t "test suite not run~%")
- #t)))
+ (apply invoke `("ant" ,test-target ,@make-flags))
+ (format #t "test suite not run~%"))
+ #t)
(define* (install #:key (make-flags '()) #:allow-other-keys)
- (zero? (apply system* `("ant" "install" ,@make-flags))))
+ (apply invoke `("ant" "install" ,@make-flags)))
(define %standard-phases
(modify-phases gnu:%standard-phases
diff --git a/guix/build/java-utils.scm b/guix/build/java-utils.scm
index 402d377bf8..128be1edeb 100644
--- a/guix/build/java-utils.scm
+++ b/guix/build/java-utils.scm
@@ -31,7 +31,7 @@
(define* (ant-build-javadoc #:key (target "javadoc") (make-flags '())
#:allow-other-keys)
- (zero? (apply system* `("ant" ,target ,@make-flags))))
+ (apply invoke `("ant" ,target ,@make-flags)))
(define* (install-jars jar-directory)
"Install jar files from JAR-DIRECTORY to the default target directory. This
diff --git a/guix/build/meson-build-system.scm b/guix/build/meson-build-system.scm
index e7690a4c37..e4aae8212f 100644
--- a/guix/build/meson-build-system.scm
+++ b/guix/build/meson-build-system.scm
@@ -58,15 +58,14 @@
(mkdir build-dir)
(chdir build-dir)
- (zero? (apply system* "meson" args))))
+ (apply invoke "meson" args)))
(define* (build #:key parallel-build?
#:allow-other-keys)
"Build a given meson package."
- (zero? (apply system* "ninja"
- (if parallel-build?
- `("-j" ,(number->string (parallel-job-count)))
- '("-j" "1")))))
+ (invoke "ninja" "-j" (if parallel-build?
+ (number->string (parallel-job-count))
+ "1")))
(define* (check #:key test-target parallel-tests? tests?
#:allow-other-keys)
@@ -75,13 +74,13 @@
(number->string (parallel-job-count))
"1"))
(if tests?
- (zero? (system* "ninja" test-target))
+ (invoke "ninja" test-target)
(begin
(format #t "test suite not run~%")
#t)))
(define* (install #:rest args)
- (zero? (system* "ninja" "install")))
+ (invoke "ninja" "install"))
(define* (fix-runpath #:key (elf-directories '("lib" "lib64" "libexec"
"bin" "sbin"))
@@ -135,7 +134,7 @@ for example libraries only needed for the tests."
(find-files dir elf-pred))
existing-elf-dirs))))
(for-each (lambda (elf-file)
- (system* "patchelf" "--shrink-rpath" elf-file)
+ (invoke "patchelf" "--shrink-rpath" elf-file)
(handle-file elf-file elf-list))
elf-list)))))
(for-each handle-output outputs)