aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2017-03-02 15:32:41 +0100
committerRicardo Wurmus <rekado@elephly.net>2017-05-10 17:59:24 +0200
commita8d3cb62abb2f9760d2144412ef557ea3b1ebfc8 (patch)
tree896dcbd6e234e051d431405cf10d50bd2f1751fd /gnu/packages
parent7aa370231dfb696f14f240554877850a466456a0 (diff)
downloadpatches-a8d3cb62abb2f9760d2144412ef557ea3b1ebfc8.tar
patches-a8d3cb62abb2f9760d2144412ef557ea3b1ebfc8.tar.gz
gnu: java-hamcrest-core: Install all jars without version suffix.
* gnu/packages/java.scm (java-hamcrest-core)[arguments]: Install all three jars and strip the version suffix.
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/java.scm24
1 files changed, 20 insertions, 4 deletions
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index feb1d99234..eae1c85616 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -1082,6 +1082,9 @@ an Ant task that extends the built-in @code{jar} task.")
(build-system ant-build-system)
(arguments
`(#:tests? #f ; Tests require junit
+ #:modules ((guix build ant-build-system)
+ (guix build utils)
+ (srfi srfi-1))
#:make-flags (list (string-append "-Dversion=" ,version))
#:build-target "core"
#:phases
@@ -1133,10 +1136,23 @@ private Method[] allMethods = getSortedMethods();")))))
#t))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
- (install-file (string-append "build/hamcrest-core-"
- ,version ".jar")
- (string-append (assoc-ref outputs "out")
- "/share/java")))))))
+ (let* ((target (string-append (assoc-ref outputs "out")
+ "/share/java/"))
+ (version-suffix ,(string-append "-" version ".jar"))
+ (install-without-version-suffix
+ (lambda (jar)
+ (copy-file jar
+ (string-append target
+ (basename jar version-suffix)
+ ".jar")))))
+ (mkdir-p target)
+ (for-each
+ install-without-version-suffix
+ (find-files "build"
+ (lambda (name _)
+ (and (string-suffix? ".jar" name)
+ (not (string-suffix? "-sources.jar" name)))))))
+ #t)))))
(native-inputs
`(("java-qdox-1.12" ,java-qdox-1.12)
("java-jarjar" ,java-jarjar)))