summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorRicardo Wurmus <ricardo.wurmus@mdc-berlin.de>2015-01-30 16:57:13 +0100
committerRicardo Wurmus <ricardo.wurmus@mdc-berlin.de>2015-02-19 13:48:29 +0100
commit9953fa7602a0f59e28cc67f8f38ab4b311040e74 (patch)
tree280a16cdf608ac7659b77cb055d290c3c7d0b33c /gnu
parent8622a07280bc3c6f7b3f4a57fb496be8934f2a14 (diff)
downloadguix-9953fa7602a0f59e28cc67f8f38ab4b311040e74.tar.gz
gnu: Add Ant.
* gnu/packages/java.scm (ant): New variable.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/java.scm52
1 files changed, 52 insertions, 0 deletions
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 4a86f63bdb..c486742c14 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -48,6 +48,58 @@
   #:use-module (gnu packages zip)
   #:use-module (gnu packages texinfo))
 
+(define-public ant
+  (package
+    (name "ant")
+    (version "1.9.4")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://www.apache.org/dist/ant/source/apache-ant-"
+                    version "-src.tar.gz"))
+              (sha256
+               (base32
+                "09kf5s1ir0rdrclsy174bsvbdcbajza9fja490w4mmvcpkw3zpak"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f ; no "check" target
+       #:phases
+       (alist-cons-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.*)")))
+        (alist-replace
+         'build
+         (lambda _
+           (setenv "JAVA_HOME"
+                   (assoc-ref %build-inputs "icedtea6"))
+           ;; 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")))))
+         (alist-delete
+          'configure
+          (alist-delete 'install %standard-phases))))))
+    (native-inputs
+     `(("icedtea6" ,icedtea6)))
+    (home-page "http://ant.apache.org")
+    (synopsis "Build tool for Java")
+    (description
+     "Ant is a platform-independent build tool for Java.  It is similar to
+make but is implemented using the Java language, requires the Java platform,
+and is best suited to building Java projects.  Ant uses XML to describe the
+build process and its dependencies, whereas Make uses Makefile format.")
+    (license license:asl2.0)))
+
 (define-public icedtea6
   (package
     (name "icedtea6")