summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--gnu/packages/java.scm24
1 files changed, 21 insertions, 3 deletions
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index aba8119741..a13f6f18d1 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -7000,8 +7000,6 @@ it manages project dependencies, gives diffs jars, and much more.")
     (name "java-aqute-libg")
     (arguments
      `(#:jar-name "java-aqute-libg.jar"
-       #:source-dir "aQute.libg/src"
-       #:tests? #f)); FIXME: tests are in "aQute.libg/test", not in a java directory
        ;; The build fails when source/target more recent than 1.7. This
        ;; is a known issue. See: https://github.com/bndtools/bnd/issues/1327
        ;;
@@ -7010,11 +7008,31 @@ it manages project dependencies, gives diffs jars, and much more.")
        ;; target. It work fine on 1.7, so we use 1.7.
        #:make-flags (list "-Dant.build.javac.source=1.7"
                           "-Dant.build.javac.target=1.7")
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'chdir
+           ;; Change to aQute.libg directory, so that the relative
+           ;; paths in the tests aren't broken.
+           (lambda _
+             (chdir "aQute.libg")
+             #t))
+         (add-before 'check 'create-test-directory
+           ;; Copy the test directory to test/java, since that's where
+           ;; ant-build-system's default project in build.xml expects to find
+           ;; the test classes. Leave a copy in the original place to not
+           ;; break paths in tests.
+           (lambda _
+             (mkdir "src/test")
+             (copy-recursively "test" "src/test/java")
+             #t)))))
     (inputs
      `(("slf4j" ,java-slf4j-api)
        ("osgi-annot" ,java-osgi-annotation)
        ("java-osgi-cmpn" ,java-osgi-cmpn)
-       ("osgi" ,java-osgi-core)))))
+       ("osgi" ,java-osgi-core)))
+    (native-inputs
+     `(("hamcrest" ,java-hamcrest-core)
+       ("java-junit" ,java-junit)))))
 
 (define java-aqute-libg-bootstrap
   (package