1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016, 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
4 ;;; This file is part of GNU Guix.
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19 (define-module (gnu packages pep)
20 #:use-module ((guix licenses) #:prefix license:)
21 #:use-module (guix packages)
22 #:use-module (guix git-download)
23 #:use-module (guix hg-download)
24 #:use-module (guix build-system gnu)
25 #:use-module (guix build-system python)
26 #:use-module (gnu packages)
27 #:use-module (gnu packages base)
28 #:use-module (gnu packages boost)
29 #:use-module (gnu packages documentation)
30 #:use-module (gnu packages java)
31 #:use-module (gnu packages linux)
32 #:use-module (gnu packages mail) ; for libetpan
33 #:use-module (gnu packages nettle)
34 #:use-module (gnu packages pkg-config)
35 #:use-module (gnu packages sequoia)
36 #:use-module (gnu packages sqlite)
37 #:use-module (gnu packages tls)
38 #:use-module (gnu packages xml))
47 (url "https://pep.foundation/dev/repos/yml2")
49 (file-name (string-append name "-" version "-checkout"))
51 (base32 "10jjjyq1mz18zkzvxd62aba00h69gd9cglisqcvb81j67ml2v1bx"))))
52 (build-system python-build-system)
54 `(("python-lxml" ,python-lxml)))
55 (home-page "https://fdik.org/yml/")
56 (synopsis "Use a Domain Specific Language for XML without defining
58 (description "The YML compiler is a small Python script. It
59 provides the command line front end yml2c. As default, it compiles
60 your script and outputs to stdout, that usually is the terminal. Your
61 shell provides options to redirect the output into a pipe or a file.")
62 (license license:gpl2)))
65 ;; pEp Engine requires libetpan with a set of patches that have not been
67 (let ((commit "210ba2b3b310b8b7a6ee4a4e35e50f7fa379643f") ; 2020-06-03
68 (checksum "00000nij3ray7nssvq0lzb352wmnab8ffzk7dgff2c68mvjbh1l6")
72 (name "fdik-libetpan")
73 (version (string-append "1.6-" revision "." (string-take commit 8)))
76 (inherit (package-source libetpan))
79 (url "https://github.com/fdik/libetpan")
81 (file-name (string-append name "-" version))
82 (sha256 (base32 checksum)))))))
84 (define-public pep-engine
92 (url "https://pep.foundation/dev/repos/pEpEngine")
93 (changeset "ebb62ba262dd"))) ;; r4721
94 (file-name (string-append name "-" version "-checkout"))
96 (base32 "0ljf79j4ng7l8w6pbdcrfzb4yk51zslypvq0n72ib1d7grqvnagi"))))
97 (build-system gnu-build-system)
99 '(#:parallel-build? #f
101 (modify-phases %standard-phases
103 ;; pEpEngie does not use autotools and configure,
104 ;; but a local.conf. We need to tweak the values there.
105 (lambda* (#:key inputs outputs #:allow-other-keys)
106 (let ((out (assoc-ref outputs "out"))
107 (yml2 (assoc-ref inputs "yml2")))
108 (with-output-to-file "local.conf"
112 PER_MACHINE_DIRECTORY=${PREFIX}/share/pEp
113 SYSTEM_DB=~a/share/pEp/system.db
118 out out (which "asn1c")
119 (string-append yml2 "/bin"))))
122 (add-after 'install 'install-db
124 (invoke "make" "-C" "db" "install"))))))
126 `(("asn1c" ,asn1c) ; >= 0.9.27
127 ("pkg-config" ,pkg-config)
130 `(("libetpan" ,fdik-libetpan)
131 ("libiconv" ,libiconv)
134 ("sequoia" ,sequoia4pEp)
136 ("util-linux" ,util-linux "lib"))) ;; uuid.h
137 (home-page "https://pep.foundation/")
138 (synopsis "Library for automatic key management and encryption of
140 (description "The p≡p engine is the core part of p≡p (pretty Easy
142 (license ;; code: GPL 3, docs: CC-BY-SA
143 (list license:gpl3 license:cc-by-sa3.0))))
145 (define-public libpepadapter
147 (name "libpepadapter")
153 (url "https://pep.foundation/dev/repos/libpEpAdapter")
154 (changeset "e8fe371c870a"))) ;; r168
155 (file-name (string-append name "-" version "-checkout"))
157 (base32 "1mlpavjbnmslvmr5jxcvpjgb2x40nhmxjb10hza3kn4qzj0k1pjz"))))
158 (build-system gnu-build-system)
160 '(#:test-target "test"
161 #:tests? #f ;; building the tests fails
163 (modify-phases %standard-phases
165 ;; libpEpAdapter does not use autotools and configure,
166 ;; but a local.conf. We need to tweak the values there.
167 (lambda* (#:key inputs outputs #:allow-other-keys)
168 (let ((out (assoc-ref outputs "out"))
169 (engine (assoc-ref inputs "pep-engine")))
170 (with-output-to-file "local.conf"
174 ENGINE_LIB_PATH=~a/lib
175 ENGINE_INC_PATH=~a/include
176 " out engine engine))))
179 `(("pep-engine" ,pep-engine)))
180 (home-page "https://pep.foundation/")
181 (synopsis "Library for building p≡p adapters")
182 (description "This C++ library provides common structures used in p≡p
183 (pretty Easy privacy) adapters.")
184 (license license:bsd-3)))
186 (define-public python-pep-adapter
188 (name "python-pep-adapter")
194 (url "https://pep.foundation/dev/repos/pEpPythonAdapter")
195 (changeset "66df0e5b9405"))) ;; r374
196 (file-name (string-append name "-" version "-checkout"))
198 (base32 "107i1s8jf8gyhpmqcs64q9csxa3fwc8g7s57iyccqb4czw8gph6d"))))
199 (build-system python-build-system)
201 `(;; Adding configure-flags does not work, running `build_ext`
202 ;; with these flags, neither does adding the options to
203 ;; `setup.cfg`: Either `build` or `install` fails (since
204 ;; flags are given or missing), or "command 'BuildExtCommand'
205 ;; has no such option 'pep_engine"
206 ;; '(#:configure-flags
207 ;; (list (string-append "--with-pEp-engine="
208 ;; (assoc-ref inputs "pEpEngine"))
209 ;; (string-append "--with-pEp-libadapter="
210 ;; (assoc-ref inputs "libpEpAdapter"))
211 ;; ;;(string-append "--boost="
212 ;; (assoc-ref inputs "boost")) not supported
213 ;; (string-append "--with-asn1c-share="
214 ;; (assoc-ref inputs "asn1c") "/share"))
216 (modify-phases %standard-phases
217 (add-before 'build 'fix-setup.py
219 (substitute* "setup.py"
220 (("^(\\s+SYS_INCLUDES = )\\['/usr.*" _ a)
221 (string-append a "os.getenv('CPATH', '').split(os.pathsep)\n"))
222 (("^(\\s+SYS_LIB_PREFIXES = )\\['/usr.*" _ a)
223 (string-append a "os.getenv('LIBRARY_PATH', '').split(os.pathsep)\n"))
224 (("^(\\s+SYS_SHARES = )\\['/usr.*" _ a)
225 (string-append a "['" (assoc-ref %build-inputs "asn1c") "/share']\n")))
229 ("boost-python" ,boost-with-python3)
230 ("libpepadapter" ,libpepadapter)
231 ("pep-engine" ,pep-engine)))
232 (home-page "https://pep.foundation/")
233 (synopsis "Python adapter for p≡p (pretty Easy Privacy)")
234 (description "The p≡p Python adapter is an adaptor interface to the p≡p
235 (pretty Easy privacy) engine.")
236 (license license:gpl3)))
238 (define-public java-pep-adapter
240 (name "java-pep-adapter")
246 (url "https://pep.foundation/dev/repos/pEpJNIAdapter")
247 (changeset "534537c9cd50"))) ;; r763
248 (file-name (string-append name "-" version "-checkout"))
250 (base32 "107ldpssc80bq8kndn2n000000gphj4lqagaiv3fddlfph4vji48"))))
251 (build-system gnu-build-system)
252 (outputs '("out" "doc"))
254 `(#:test-target "test"
255 #:make-flags (list "doxy-all")
257 (modify-phases %standard-phases
258 (add-before 'configure 'fix-includes
260 (substitute* "src/jniutils.hh"
261 (("#pragma once\n" line)
264 "#include <cassert>\n"
265 "#include <cstring>\n")))
267 (add-before 'configure 'pin-shared-lib-path
268 (lambda* (#:key outputs #:allow-other-keys)
269 (substitute* "src/foundation/pEp/jniadapter/AbstractEngine.java"
270 (("System.loadLibrary\\(\"pEpJNI\"\\);")
271 (string-append "System.load(\""
272 (assoc-ref outputs "out")
273 "/lib/libpEpJNI.so" "\");")))
276 ;; pEpJNIAdapter does not use autotools and configure,
277 ;; but a local.conf. We need to tweak the values there.
278 (lambda* (#:key inputs outputs #:allow-other-keys)
279 (let ((out (assoc-ref outputs "out"))
280 (engine (assoc-ref inputs "pep-engine"))
281 (libadapter (assoc-ref inputs "libpepadapter"))
282 (openjdk (assoc-ref inputs "openjdk")))
283 (with-output-to-file "local.conf"
287 ENGINE_LIB_PATH=~a/lib
288 ENGINE_INC_PATH=~a/include
290 AD_INC_PATH=~a/include
294 out engine engine libadapter libadapter
295 (which "yml2proc") openjdk)))
296 (substitute* "src/Makefile" ;; suppress some warnings
297 (("^\\s+OLD_JAVA=") " xxx_OLD_JAVA="))
300 (lambda* (#:key outputs #:allow-other-keys)
301 (let* ((out (assoc-ref outputs "out"))
302 (libout (string-append out "/lib/"))
303 (javaout (string-append out "/share/java/")))
306 (copy-file "src/libpEpJNI.so"
307 (string-append libout "/libpEpJNI.so"))
308 (copy-file "src/pEp.jar" (string-append javaout "/pEp.jar"))
310 (add-after 'install 'install-docs
311 (lambda* (#:key outputs #:allow-other-keys)
312 (let* ((out (assoc-ref outputs "doc"))
313 (docout (string-append out "/share/doc/pEp-JNI-adapter"))
314 (cxxout (string-append docout "/cxx"))
315 (javaout (string-append docout "/java")))
318 (copy-recursively "doc/doxygen/cxx/html" cxxout)
319 (copy-recursively "doc/doxygen/java/html" javaout)
322 `(("doxygen" ,doxygen)
323 ("openjdk" ,openjdk9 "jdk")
327 `(("libpepadapter" ,libpepadapter)
328 ("pep-engine" ,pep-engine)
329 ("util-linux" ,util-linux))) ;; uuid.h
330 (home-page "https://pep.foundation/")
331 (synopsis "Java adapter for p≡p (pretty Easy Privacy)")
332 (description "The p≡p JNI adapter is a Java adapter interface to the p≡p
333 (pretty Easy privacy) engine.")
334 (license license:gpl3)))