From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38845) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGTty-0007Mk-Bi for guix-patches@gnu.org; Sun, 19 Nov 2017 13:01:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGTtw-0003hO-VD for guix-patches@gnu.org; Sun, 19 Nov 2017 13:01:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:39192) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eGTtw-0003hE-Re for guix-patches@gnu.org; Sun, 19 Nov 2017 13:01:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eGTtw-0006OR-Ir for guix-patches@gnu.org; Sun, 19 Nov 2017 13:01:04 -0500 Subject: [bug#29359] [PATCH 06/31] gnu: Add java-hawtjni. Resent-Message-ID: From: Julien Lepiller Date: Sun, 19 Nov 2017 18:57:40 +0100 Message-Id: <20171119175805.902-6-julien@lepiller.eu> In-Reply-To: <20171119175805.902-1-julien@lepiller.eu> References: <20171119175805.902-1-julien@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: 29359@debbugs.gnu.org * gnu/packages/java.scm (java-hawtjni): New variable. --- gnu/packages/java.scm | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 1fcbff10a..d517e4928 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -7612,3 +7612,54 @@ including pre-existing objects that you do not have source-code of.") provides a very convenient API for extracting and manipulating data, using the best of DOM, CSS, and jquery-like methods.") (license license:expat))) + +(define-public java-hawtjni + (package + (name "java-hawtjni") + (version "1.15") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/fusesource/hawtjni/archive/" + "hawtjni-project-" version ".tar.gz")) + (sha256 + (base32 + "1bqfd732rmh6svyx17fpw9175gc9gzkcbyps2yyrf50c3zzjas6g")))) + (build-system ant-build-system) + (arguments + `(#:jar-name "hawtjni.jar" + #:source-dir "hawtjni-generator/src/main/java:hawtjni-runtime/src/main/java" + #:tests? #f; no tests + #:phases + (modify-phases %standard-phases + (add-before 'build 'build-native + (lambda* (#:key inputs #:allow-other-keys) + (with-directory-excursion "hawtjni-generator/src/main/resources/" + (system* "gcc" "-c" "hawtjni.c" "-o" "hawtjni.o" + "-fPIC" "-O2" + (string-append "-I" (assoc-ref inputs "jdk") "/include/linux")) + (system* "gcc" "-c" "hawtjni-callback.c" "-o" "hawtjni-callback.o" + "-fPIC" "-O2" + (string-append "-I" (assoc-ref inputs "jdk") "/include/linux")) + (zero? (system* "gcc" "-o" "libhawtjni.so" "-shared" + "hawtjni.o" "hawtjni-callback.o"))))) + (add-after 'install 'install-native + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (lib (string-append out "/lib")) + (inc (string-append out "/include"))) + (mkdir-p lib) + (mkdir-p inc) + (with-directory-excursion "hawtjni-generator/src/main/resources/" + (copy-file "libhawtjni.so" (string-append lib "/libhawtjni.so")) + (copy-file "hawtjni.h" (string-append inc "/hawtjni.h")))) + #t))))) + (inputs + `(("java-commons-cli" ,java-commons-cli) + ("java-asm" ,java-asm) + ("java-geronimo-xbean-finder" ,java-geronimo-xbean-finder))) + (home-page "https://fusesource.github.io/hawtjni/") + (synopsis "JNI code generator") + (description "HawtJNI is a code generator that produces the JNI code needed +to implement java native methods. It is based on the jnigen code generator +that is part of the SWT Tools project.") + (license license:asl2.0))) -- 2.15.0