summary refs log tree commit diff
path: root/gnu/packages/java.scm
diff options
context:
space:
mode:
authorDanny Milosavljevic <dannym@scratchpost.org>2018-10-03 23:56:44 +0200
committerDanny Milosavljevic <dannym@scratchpost.org>2018-10-04 00:06:42 +0200
commit46f9022c9919e647e62a39e0dacf51e31457e6f8 (patch)
treee64582884e5cc8ed432f06779d38d476b7363c83 /gnu/packages/java.scm
parentef1f9acf470e1871395daf18ce5d1c58d87f2ab0 (diff)
downloadguix-46f9022c9919e647e62a39e0dacf51e31457e6f8.tar.gz
gnu: Add java-commons-exec.
* gnu/packages/java.scm (java-commons-exec-1.1): New variable.
(java-commons-exec): New variable.
Diffstat (limited to 'gnu/packages/java.scm')
-rw-r--r--gnu/packages/java.scm79
1 files changed, 79 insertions, 0 deletions
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index d2f4c9d05b..5207c6cc64 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -4288,6 +4288,85 @@ setter and getter method.")
 file filters and endian classes.")
     (license license:asl2.0)))
 
+(define-public java-commons-exec-1.1
+  (package
+    (name "java-commons-exec")
+    (version "1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://apache/commons/exec/source/"
+                           "commons-exec-" version "-src.tar.gz"))
+       (sha256
+        (base32
+         "025dk8xgj10lxwwwqp0hng2rn7fr4vcirxzydqzx9k4dim667alk"))))
+    (build-system ant-build-system)
+    (arguments
+     `(#:test-target "test"
+       #:make-flags
+       (list (string-append "-Dmaven.junit.jar="
+                            (assoc-ref %build-inputs "java-junit")
+                            "/share/java/junit.jar"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'delete-network-tests
+           (lambda _
+             (delete-file "src/test/java/org/apache/commons/exec/DefaultExecutorTest.java")
+             (substitute* "src/test/java/org/apache/commons/exec/TestRunner.java"
+              (("suite\\.addTestSuite\\(DefaultExecutorTest\\.class\\);") ""))
+             #t))
+         ;; The "build" phase automatically tests.
+         (delete 'check)
+         (replace 'install (install-jars "target")))))
+    (native-inputs
+     `(("java-junit" ,java-junit)))
+    (home-page "http://commons.apache.org/proper/commons-exec/")
+    (synopsis "Common program execution related classes")
+    (description "Commons-Exec simplifies executing external processes.")
+    (license license:asl2.0)))
+
+(define-public java-commons-exec
+  (package
+    (inherit java-commons-exec-1.1)
+    (version "1.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://apache/commons/exec/source/"
+                           "commons-exec-" version "-src.tar.gz"))
+       (sha256
+        (base32
+         "17yb4h6f8l49c5iyyvda4z2nmw0bxrx857nrwmsr7mmpb7x441yv"))))
+    (arguments
+     `(#:test-target "test"
+       #:make-flags
+       (list (string-append "-Dmaven.junit.jar="
+                            (assoc-ref %build-inputs "java-junit")
+                            "/share/java/junit.jar")
+             "-Dmaven.compiler.source=1.7"
+             "-Dmaven.compiler.target=1.7")
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'delete-network-tests
+           (lambda* (#:key inputs #:allow-other-keys)
+             ;; This test hangs indefinitely.
+             (delete-file "src/test/java/org/apache/commons/exec/issues/Exec60Test.java")
+             (substitute* "src/test/java/org/apache/commons/exec/issues/Exec41Test.java"
+              (("ping -c 10 127.0.0.1") "sleep 10"))
+             (substitute* "src/test/java/org/apache/commons/exec/issues/Exec49Test.java"
+              (("/bin/ls") "ls"))
+             (call-with-output-file "src/test/scripts/ping.sh"
+               (lambda (port)
+                 (format port "#!~a/bin/sh\nsleep $1\n"
+                              (assoc-ref inputs "bash"))))
+             #t))
+         ;; The "build" phase automatically tests.
+         (delete 'check)
+         (replace 'install (install-jars "target")))))
+    (native-inputs
+     `(("java-junit" ,java-junit)
+       ("java-hamcrest-core" ,java-hamcrest-core)))))
+
 (define-public java-commons-lang
   (package
     (name "java-commons-lang")