Subject: [bug#30845] [PATCH 10/82] gnu: Add java-native-access-platform.

From: Julien Lepiller <[email-masked]>
Date: Sun, 18 Mar 2018 14:05:30 +0100

* gnu/packages/java.scm (java-native-access-platform): New variable.
---
 gnu/packages/java.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 54b44a9d0..fa11480eb 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -9612,3 +9612,32 @@ Java method invocation.")
     (license (list
                license:asl2.0
                license:lgpl2.1+))))
+
+(define-public java-native-access-platform
+  (package
+    (inherit java-native-access)
+    (name "java-native-access-platform")
+    (arguments
+     `(#:test-target "test"
+       #:tests? #f; require jna-test.jar
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'chdir
+           (lambda _
+             (chdir "contrib/platform")))
+         (add-after 'chdir 'fix-ant
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "nbproject/project.properties"
+               (("../../build/jna.jar")
+                (string-append (assoc-ref inputs "java-native-access")
+                               "/share/java/jna.jar"))
+               (("../../lib/hamcrest-core-.*.jar")
+                (string-append (assoc-ref inputs "java-hamcrest-core")
+                               "/share/java/hamcrest-core.jar"))
+               (("../../lib/junit.jar")
+                (string-append (assoc-ref inputs "java-junit")
+                               "/share/java/junit.jar")))))
+         (replace 'install
+           (install-jars "dist")))))
+    (inputs
+     `(("java-native-access" ,java-native-access)))))
-- 
2.16.1