From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1exY0l-0002An-Nn for guix-patches@gnu.org; Sun, 18 Mar 2018 09:06:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1exY0k-0001sH-Gj for guix-patches@gnu.org; Sun, 18 Mar 2018 09:06:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:59573) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1exY0k-0001s8-Dt for guix-patches@gnu.org; Sun, 18 Mar 2018 09:06:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1exY0k-0004Yp-64 for guix-patches@gnu.org; Sun, 18 Mar 2018 09:06:06 -0400 Subject: [bug#30845] [PATCH 09/82] gnu: Add java-native-access. Resent-Message-ID: From: Julien Lepiller Date: Sun, 18 Mar 2018 14:05:29 +0100 Message-Id: <20180318130530.1654-9-julien@lepiller.eu> In-Reply-To: <20180318134211.38163cd6@lepiller.eu> References: <20180318134211.38163cd6@lepiller.eu> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 30845@debbugs.gnu.org * gnu/packages/java.scm (java-native-access): New variable. --- gnu/packages/java.scm | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 37eeda0a6..54b44a9d0 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -9547,3 +9547,68 @@ substitutions, splits, filtering filenames, etc. This library is the successor of the OROMatcher, AwkTools, PerlTools, and TextTools libraries originally from ORO, Inc.") (license license:asl2.0))) + +(define-public java-native-access + (package + (name "java-native-access") + (version "4.5.1") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/java-native-access/jna/" + "archive/" version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0zrpzkib6b905i018a9pqlzkqinphywr6y4jwv6mwp63jjqvqkd9")) + (modules '((guix build utils))) + (snippet + `(for-each delete-file (find-files "." ".*.jar"))))) + (build-system ant-build-system) + (arguments + `(#:tests? #f; FIXME: tests require reflections.jar + #:test-target "test" + #:make-flags (list "-Ddynlink.native=true") + #:phases + (modify-phases %standard-phases + (add-before 'build 'fix-build.xml + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "build.xml" + ;; Since we removed the bundled ant.jar, give the correct path + (("lib/ant.jar") (string-append (assoc-ref inputs "ant") "/lib/ant.jar")) + ;; We removed generated native libraries. We can only rebuild one + ;; so don't fail if we can't find a native library for another architecture. + (("zipfileset") "zipfileset erroronmissingarchive=\"false\"")) + ;; Copy test dependencies + (copy-file (string-append (assoc-ref inputs "java-junit") + "/share/java/junit.jar") + "lib/junit.jar") + (copy-file (string-append (assoc-ref inputs "java-hamcrest-core") + "/share/java/hamcrest-core.jar") + "lib/hamcrest-core.jar") + ;; FIXME: once reflections.jar is built, copy it to lib/test. + #t)) + (add-before 'build 'build-native + (lambda _ + (invoke "ant" "-Ddynlink.native=true" "native") + #t)) + (replace 'install + (install-jars "build"))))) + (inputs + `(("libffi" ,libffi) + ("libx11" ,libx11) + ("libxt" ,libxt))) + (native-inputs + `(("java-junit" ,java-junit) + ("java-hamcrest-core" ,java-hamcrest-core))) + (home-page "https://github.com/java-native-access/jna") + (synopsis "Access to native shared libraries from Java") + (description "JNA provides Java programs easy access to native shared +libraries without writing anything but Java code - no JNI or native code is +required. JNA allows you to call directly into native functions using natural +Java method invocation.") + ;; Java Native Access project (JNA) is dual-licensed under 2 + ;; alternative Open Source/Free licenses: LGPL 2.1 or later and + ;; Apache License 2.0. (starting with JNA version 4.0.0). + (license (list + license:asl2.0 + license:lgpl2.1+)))) -- 2.16.1