summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <ricardo.wurmus@mdc-berlin.de>2016-05-10 15:50:28 +0200
committerRicardo Wurmus <rekado@elephly.net>2016-05-20 15:24:32 +0200
commit932f2b70a6a5eee15b1508d7aae7f8a7fdb0e23a (patch)
tree76f61fb6173968d5d0bdc8336f6969b128055df9
parent987a1183344a716a65d13796dca9013a0c2bcf66 (diff)
downloadpatches-932f2b70a6a5eee15b1508d7aae7f8a7fdb0e23a.tar
patches-932f2b70a6a5eee15b1508d7aae7f8a7fdb0e23a.tar.gz
ant-build-system: Add unpack phase.
* guix/build/ant-build-system.scm (unpack): New procedure. (%standard-phases): Use it.
-rw-r--r--guix/build/ant-build-system.scm12
1 files changed, 12 insertions, 0 deletions
diff --git a/guix/build/ant-build-system.scm b/guix/build/ant-build-system.scm
index 27277af34b..6dc19ff2db 100644
--- a/guix/build/ant-build-system.scm
+++ b/guix/build/ant-build-system.scm
@@ -86,6 +86,17 @@ INPUTS."
(find-files dir "\\.*jar$")))
inputs)) ":"))
+(define* (unpack #:key source #:allow-other-keys)
+ "Unpack the jar archive SOURCE. When SOURCE is not a jar archive fall back
+to the default GNU unpack strategy."
+ (if (string-suffix? ".jar" source)
+ (begin
+ (mkdir "src")
+ (with-directory-excursion "src"
+ (zero? (system* "jar" "-xf" source))))
+ ;; Use GNU unpack strategy for things that aren't jar archives.
+ ((assq-ref gnu:%standard-phases 'unpack) #:source source)))
+
(define* (configure #:key inputs outputs (jar-name #f)
#:allow-other-keys)
(when jar-name
@@ -151,6 +162,7 @@ repack them. This is necessary to ensure that archives are reproducible."
(define %standard-phases
(modify-phases gnu:%standard-phases
+ (replace 'unpack unpack)
(replace 'configure configure)
(replace 'build build)
(replace 'check check)