summary refs log tree commit diff
path: root/gnu/packages/java.scm
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2017-05-18 23:28:17 +0200
committerRicardo Wurmus <rekado@elephly.net>2017-05-22 18:56:35 +0200
commit8bbd0408408c43af6d40cb4935878985321077c7 (patch)
tree3f548d8197dce4c21e0cca688a9e73bd4fb083ac /gnu/packages/java.scm
parent5c7952fbf4b56684412b4c5e0751e4076e4f23da (diff)
downloadguix-8bbd0408408c43af6d40cb4935878985321077c7.tar.gz
gnu: Add ant/java8.
* gnu/packages/java.scm (ant/java8): New variable.
Diffstat (limited to 'gnu/packages/java.scm')
-rw-r--r--gnu/packages/java.scm45
1 files changed, 45 insertions, 0 deletions
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index abb2f62add..19d8d67e52 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -1692,6 +1692,51 @@ IcedTea build harness.")
     (native-inputs
      `(("gcj" ,gcj)))))
 
+(define-public ant/java8
+  (package (inherit ant-bootstrap)
+    (name "ant")
+    (version "1.10.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://apache/ant/source/apache-ant-"
+                                  version "-src.tar.gz"))
+              (sha256
+               (base32
+                "10p3dh77lkzzzcy32dk9azljixzadp46fggjfbvgkl8mmb8cxxv8"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  (for-each delete-file
+                            (find-files "lib/optional" "\\.jar$"))
+                  #t))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments ant-bootstrap)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (add-after 'unpack 'remove-scripts
+             ;; Remove bat / cmd scripts for DOS as well as the antRun and runant
+             ;; wrappers.
+             (lambda _
+               (for-each delete-file
+                         (find-files "src/script"
+                                     "(.*\\.(bat|cmd)|runant.*|antRun.*)"))
+               #t))
+           (replace 'build
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
+
+               ;; Disable tests to avoid dependency on hamcrest-core, which needs
+               ;; Ant to build.  This is necessary in addition to disabling the
+               ;; "check" phase, because the dependency on "test-jar" would always
+               ;; result in the tests to be run.
+               (substitute* "build.xml"
+                 (("depends=\"jars,test-jar\"") "depends=\"jars\""))
+               (zero? (system* "bash" "bootstrap.sh"
+                               (string-append "-Ddist.dir="
+                                              (assoc-ref outputs "out"))))))))))
+    (native-inputs
+     `(("jdk" ,icedtea-8 "jdk")))))
+
 (define-public clojure
   (let* ((remove-archives '(begin
                              (for-each delete-file