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.
This commit is contained in:
Ricardo Wurmus 2017-03-02 15:32:41 +01:00
parent 7aa370231d
commit a8d3cb62ab
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -1082,6 +1082,9 @@ (define-public java-hamcrest-core
(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 @@ (define-public java-hamcrest-core
#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)))