all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Hartmut Goebel <h.goebel@crazy-compilers.com>
To: 41490@debbugs.gnu.org
Subject: [bug#41490] [PATCH 5/5] gnu: Add java-pep-adapter.
Date: Sat, 23 May 2020 20:51:04 +0200	[thread overview]
Message-ID: <b4b1c6c6c6ada7df8d58442c9011441359cc1174.1590259641.git.h.goebel@crazy-compilers.com> (raw)
In-Reply-To: <cover.1590259641.git.h.goebel@crazy-compilers.com>

* gnu/packages/pep.scm (java-pep-adapter): New variable.
---
 gnu/packages/pep.scm | 100 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 100 insertions(+)

diff --git a/gnu/packages/pep.scm b/gnu/packages/pep.scm
index bcef915970..0f169efd22 100644
--- a/gnu/packages/pep.scm
+++ b/gnu/packages/pep.scm
@@ -26,6 +26,8 @@
   #:use-module (gnu packages)
   #:use-module (gnu packages base)
   #:use-module (gnu packages boost)
+  #:use-module (gnu packages documentation)
+  #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages mail) ; for libetpan
   #:use-module (gnu packages nettle)
@@ -247,3 +249,101 @@ ENGINE_INC_PATH=~a/include
     (description "The p≡p Python adapter is an adaptor interface to the p≡p
 (pretty Easy privacy) engine.")
     (license license:gpl3)))
+
+(define-public java-pep-adapter
+  (package
+    (name "java-pep-adapter")
+    (version "2.0.2")
+    (source
+     (origin
+       (method hg-fetch)
+       (uri (hg-reference
+             (url "https://pep.foundation/dev/repos/pEpJNIAdapter")
+             (changeset "9292f1b1a76a"))) ;; r699
+       (file-name (string-append name "-" version "-checkout"))
+       (sha256
+        (base32 "107ldpssc80bq8kndn2nqmav31gphj4lqagaiv3fddlfph4vji48"))))
+    (build-system gnu-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:test-target "test"
+       #:make-flags (list "doxy-all")
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'fix-includes
+           (lambda _
+             (substitute* "src/jniutils.hh"
+               (("#pragma once\n" line)
+                (string-append line
+                               "#include <mutex>\n"
+                               "#include <cassert>\n"
+                               "#include <cstring>\n")))
+             #t))
+         (add-before 'configure 'pin-shared-lib-path
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "src/foundation/pEp/jniadapter/AbstractEngine.java"
+               (("System.loadLibrary\\(\"pEpJNI\"\\);")
+                (string-append "System.load(\""
+                               (assoc-ref outputs "out")
+                               "/lib/libpEpJNI.so" "\");")))
+             #t))
+         (replace 'configure
+           ;; pEpJNIAdapter does not use autotools and configure,
+           ;; but a local.conf. We need to tweak the values there.
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out"))
+                   (engine (assoc-ref inputs "pep-engine"))
+                   (libadapter (assoc-ref inputs "libpepadapter"))
+                   (openjdk  (assoc-ref inputs "openjdk")))
+               (with-output-to-file "local.conf"
+                 (lambda _ ;()
+                   (format #t "
+PREFIX=~a
+ENGINE_LIB_PATH=~a/lib
+ENGINE_INC_PATH=~a/include
+AD_LIB_PATH=~a/lib
+AD_INC_PATH=~a/include
+YML2_PROC=~a
+JAVA_HOME=~a
+"
+                           out engine engine libadapter libadapter
+                           (which "yml2proc") openjdk)))
+               (substitute* "src/Makefile"  ;; suppress some warnings
+                 (("^\\s+OLD_JAVA=") "    xxx_OLD_JAVA="))
+               #t)))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (libout (string-append out "/lib/"))
+                    (javaout (string-append out "/share/java/")))
+               (mkdir-p libout)
+               (mkdir-p javaout)
+               (copy-file "src/libpEpJNI.so"
+                          (string-append libout "/libpEpJNI.so"))
+               (copy-file "src/pEp.jar" (string-append javaout "/pEp.jar"))
+               #t)))
+         (add-after 'install 'install-docs
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "doc"))
+                    (docout (string-append out "/share/doc/pEp-JNI-adapter"))
+                    (cxxout (string-append docout "/cxx"))
+                    (javaout (string-append docout "/java")))
+               (mkdir-p cxxout)
+               (mkdir-p javaout)
+               (copy-recursively "doc/doxygen/cxx/html" cxxout)
+               (copy-recursively "doc/doxygen/java/html" javaout)
+               #t))))))
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("openjdk" ,openjdk9 "jdk")
+       ("which" ,which)
+       ("yml2" ,yml2)))
+    (inputs
+     `(("libpepadapter" ,libpepadapter)
+       ("pep-engine" ,pep-engine)
+       ("util-linux" ,util-linux))) ;; uuid.h
+    (home-page "https://pep.foundation/")
+    (synopsis "Java adapter for p≡p (pretty Easy Privacy)")
+    (description "The p≡p JNI adapter is a Java adapter interface to the p≡p
+(pretty Easy privacy) engine.")
+    (license license:gpl3)))
-- 
2.21.3





  parent reply	other threads:[~2020-05-23 18:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-23 18:48 [bug#41490] [PATCH 0/5] Add pEp (pretty Easy privacy) Hartmut Goebel
2020-05-23 18:51 ` [bug#41490] [PATCH 1/5] gnu: Add yml2 Hartmut Goebel
2020-05-23 18:51 ` [bug#41490] [PATCH 2/5] gnu: Add pep-engine Hartmut Goebel
2020-05-23 18:51 ` [bug#41490] [PATCH 3/5] gnu: Add libpepadapter Hartmut Goebel
2020-05-23 18:51 ` [bug#41490] [PATCH 4/5] gnu: Add python-pep-adapter Hartmut Goebel
2020-05-23 18:51 ` Hartmut Goebel [this message]
2020-06-07 10:09 ` [PATCH 0/5] Add pEp (pretty Easy privacy) Hartmut Goebel
2020-06-08 16:06 ` Advice on package naming (was: [PATCH 0/5] Add pEp (pretty Easy privacy)) Hartmut Goebel
2020-06-09 16:13   ` [bug#41490] Advice on package naming Ludovic Courtès
2020-06-09 18:02     ` bug#41490: " Hartmut Goebel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4b1c6c6c6ada7df8d58442c9011441359cc1174.1590259641.git.h.goebel@crazy-compilers.com \
    --to=h.goebel@crazy-compilers.com \
    --cc=41490@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.