Commit | Line | Data |
---|---|---|
d7a341f8 | 1 | ;;; GNU Guix --- Functional package management for GNU |
c7f02372 | 2 | ;;; Copyright © 2016, 2020, 2021 Hartmut Goebel <h.goebel@crazy-compilers.com> |
d7a341f8 HG |
3 | ;;; |
4 | ;;; This file is part of GNU Guix. | |
5 | ;;; | |
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. | |
10 | ;;; | |
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. | |
15 | ;;; | |
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/>. | |
18 | ||
19 | (define-module (gnu packages pep) | |
20 | #:use-module ((guix licenses) #:prefix license:) | |
21 | #:use-module (guix packages) | |
221c5144 | 22 | #:use-module (guix git-download) |
221c5144 | 23 | #:use-module (guix build-system gnu) |
d7a341f8 HG |
24 | #:use-module (guix build-system python) |
25 | #:use-module (gnu packages) | |
221c5144 | 26 | #:use-module (gnu packages base) |
9b722166 | 27 | #:use-module (gnu packages boost) |
140087fa | 28 | #:use-module (gnu packages check) |
3cf7088f | 29 | #:use-module (gnu packages documentation) |
c85edf2c | 30 | #:use-module (gnu packages graphviz) |
3cf7088f | 31 | #:use-module (gnu packages java) |
221c5144 HG |
32 | #:use-module (gnu packages linux) |
33 | #:use-module (gnu packages mail) ; for libetpan | |
34 | #:use-module (gnu packages nettle) | |
35 | #:use-module (gnu packages pkg-config) | |
ed210c1b | 36 | #:use-module (gnu packages python-build) |
140087fa | 37 | #:use-module (gnu packages python-xyz) |
221c5144 HG |
38 | #:use-module (gnu packages sequoia) |
39 | #:use-module (gnu packages sqlite) | |
40 | #:use-module (gnu packages tls) | |
d7a341f8 HG |
41 | #:use-module (gnu packages xml)) |
42 | ||
43 | (define-public yml2 | |
44 | (package | |
45 | (name "yml2") | |
c7f02372 HG |
46 | (version "2.7.0") |
47 | (source | |
48 | (origin | |
49 | (method git-fetch) | |
50 | (uri (git-reference | |
51 | (url "https://gitea.pep.foundation/fdik/yml2") | |
52 | (commit version))) | |
53 | (file-name (git-file-name name version)) | |
d7a341f8 | 54 | (sha256 |
c7f02372 | 55 | (base32 "0fm1x1fv4lwcpbn59s55idzf7x173n59xpz8rlrxalmi6gvsjijr")))) |
d7a341f8 HG |
56 | (build-system python-build-system) |
57 | (propagated-inputs | |
8394619b | 58 | (list python-lxml)) |
d7a341f8 HG |
59 | (home-page "https://fdik.org/yml/") |
60 | (synopsis "Use a Domain Specific Language for XML without defining | |
61 | a grammar") | |
62 | (description "The YML compiler is a small Python script. It | |
63 | provides the command line front end yml2c. As default, it compiles | |
64 | your script and outputs to stdout, that usually is the terminal. Your | |
65 | shell provides options to redirect the output into a pipe or a file.") | |
66 | (license license:gpl2))) | |
221c5144 HG |
67 | |
68 | (define fdik-libetpan | |
69 | ;; pEp Engine requires libetpan with a set of patches that have not been | |
70 | ;; upstreamed yet. | |
85d80283 HG |
71 | (let ((commit "0b80c39dd1504462ba3a39dc53db7c960c3a63f3") ; 2020-11-27 |
72 | (checksum "0gv3ivaziadybjlf6rfpv1j5z5418243v5cvl4swlxd2njsh7gjk") | |
73 | (revision "6")) | |
221c5144 HG |
74 | (package |
75 | (inherit libetpan) | |
76 | (name "fdik-libetpan") | |
77 | (version (string-append "1.6-" revision "." (string-take commit 8))) | |
78 | (source | |
79 | (origin | |
80 | (inherit (package-source libetpan)) | |
81 | (method git-fetch) | |
82 | (uri (git-reference | |
85d80283 | 83 | (url "https://gitea.pep.foundation/pEp.foundation/libetpan") |
221c5144 HG |
84 | (commit commit))) |
85 | (file-name (string-append name "-" version)) | |
86 | (sha256 (base32 checksum))))))) | |
87 | ||
221c5144 HG |
88 | (define-public pep-engine |
89 | (package | |
90 | (name "pep-engine") | |
85d80283 | 91 | (version "2.1.34") |
221c5144 HG |
92 | (source |
93 | (origin | |
85d80283 HG |
94 | (method git-fetch) |
95 | (uri (git-reference | |
96 | (url "https://gitea.pep.foundation/pEp.foundation/pEpEngine") | |
97 | (commit (string-append "Release_" version)))) | |
98 | (file-name (git-file-name name version)) | |
221c5144 | 99 | (sha256 |
85d80283 | 100 | (base32 "00q96y9j985qfa382acsz02i0zf6ayq2gmg8z70jzl04isg1h3cn")))) |
221c5144 HG |
101 | (build-system gnu-build-system) |
102 | (arguments | |
103 | '(#:parallel-build? #f | |
85d80283 | 104 | #:make-flags '("NDEBUG=1") ; release build |
221c5144 HG |
105 | #:phases |
106 | (modify-phases %standard-phases | |
107 | (replace 'configure | |
85d80283 | 108 | ;; pEpEngine does not use autotools and configure, |
221c5144 HG |
109 | ;; but a local.conf. We need to tweak the values there. |
110 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
111 | (let ((out (assoc-ref outputs "out")) | |
112 | (yml2 (assoc-ref inputs "yml2"))) | |
113 | (with-output-to-file "local.conf" | |
114 | (lambda () | |
115 | (format #t " | |
116 | PREFIX=~a | |
117 | PER_MACHINE_DIRECTORY=${PREFIX}/share/pEp | |
118 | SYSTEM_DB=~a/share/pEp/system.db | |
119 | ASN1C=~a | |
120 | YML2_PATH=~a | |
121 | OPENPGP=SEQUOIA | |
122 | " | |
123 | out out (which "asn1c") | |
124 | (string-append yml2 "/bin")))) | |
125 | #t))) | |
126 | (delete 'check) | |
127 | (add-after 'install 'install-db | |
128 | (lambda _ | |
129 | (invoke "make" "-C" "db" "install")))))) | |
130 | (native-inputs | |
8394619b LC |
131 | (list asn1c ; >= 0.9.27 |
132 | pkg-config yml2)) | |
221c5144 | 133 | (inputs |
3f9c432b MB |
134 | (list fdik-libetpan |
135 | nettle | |
136 | openssl | |
137 | sequoia | |
138 | sqlite | |
139 | `(,util-linux "lib"))) ;; uuid.h | |
221c5144 HG |
140 | (home-page "https://pep.foundation/") |
141 | (synopsis "Library for automatic key management and encryption of | |
142 | messages") | |
143 | (description "The p≡p engine is the core part of p≡p (pretty Easy | |
144 | privacy).") | |
145 | (license ;; code: GPL 3, docs: CC-BY-SA | |
146 | (list license:gpl3 license:cc-by-sa3.0)))) | |
cfd15d96 HG |
147 | |
148 | (define-public libpepadapter | |
149 | (package | |
150 | (name "libpepadapter") | |
c178f859 | 151 | (version "2.1.21") |
cfd15d96 HG |
152 | (source |
153 | (origin | |
c178f859 HG |
154 | (method git-fetch) |
155 | (uri (git-reference | |
156 | (url "https://gitea.pep.foundation/pEp.foundation/libpEpAdapter") | |
157 | (commit (string-append "Release_" version)))) | |
158 | (file-name (git-file-name name version)) | |
cfd15d96 | 159 | (sha256 |
c178f859 | 160 | (base32 "09ljj3x09y99wc47n063hpn62zi8cdvdha82rnaypvirrlga6a5w")))) |
cfd15d96 HG |
161 | (build-system gnu-build-system) |
162 | (arguments | |
163 | '(#:test-target "test" | |
164 | #:tests? #f ;; building the tests fails | |
c178f859 | 165 | #:make-flags '("NDEBUG=1") ; release build |
cfd15d96 HG |
166 | #:phases |
167 | (modify-phases %standard-phases | |
168 | (replace 'configure | |
169 | ;; libpEpAdapter does not use autotools and configure, | |
170 | ;; but a local.conf. We need to tweak the values there. | |
171 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
172 | (let ((out (assoc-ref outputs "out")) | |
173 | (engine (assoc-ref inputs "pep-engine"))) | |
174 | (with-output-to-file "local.conf" | |
c178f859 | 175 | (lambda _ |
cfd15d96 HG |
176 | (format #t " |
177 | PREFIX=~a | |
178 | ENGINE_LIB_PATH=~a/lib | |
179 | ENGINE_INC_PATH=~a/include | |
180 | " out engine engine)))) | |
181 | #t))))) | |
182 | (inputs | |
8394619b | 183 | (list pep-engine)) |
cfd15d96 HG |
184 | (home-page "https://pep.foundation/") |
185 | (synopsis "Library for building p≡p adapters") | |
186 | (description "This C++ library provides common structures used in p≡p | |
187 | (pretty Easy privacy) adapters.") | |
188 | (license license:bsd-3))) | |
9b722166 HG |
189 | |
190 | (define-public python-pep-adapter | |
191 | (package | |
192 | (name "python-pep-adapter") | |
140087fa | 193 | (version "2.1.3") |
9b722166 HG |
194 | (source |
195 | (origin | |
140087fa HG |
196 | (method git-fetch) |
197 | (uri (git-reference | |
198 | (url "https://gitea.pep.foundation/pEp.foundation/pEpPythonAdapter") | |
199 | (commit version))) | |
200 | (file-name (git-file-name name version)) | |
9b722166 | 201 | (sha256 |
140087fa | 202 | (base32 "0ssz21p1k7xx3snmd4g3ggzq565rlzdmp90l2mph6yfp1y65p39s")))) |
9b722166 HG |
203 | (build-system python-build-system) |
204 | (arguments | |
205 | `(;; Adding configure-flags does not work, running `build_ext` | |
206 | ;; with these flags, neither does adding the options to | |
207 | ;; `setup.cfg`: Either `build` or `install` fails (since | |
208 | ;; flags are given or missing), or "command 'BuildExtCommand' | |
209 | ;; has no such option 'pep_engine" | |
210 | ;; '(#:configure-flags | |
211 | ;; (list (string-append "--with-pEp-engine=" | |
212 | ;; (assoc-ref inputs "pEpEngine")) | |
213 | ;; (string-append "--with-pEp-libadapter=" | |
214 | ;; (assoc-ref inputs "libpEpAdapter")) | |
215 | ;; ;;(string-append "--boost=" | |
216 | ;; (assoc-ref inputs "boost")) not supported | |
217 | ;; (string-append "--with-asn1c-share=" | |
218 | ;; (assoc-ref inputs "asn1c") "/share")) | |
219 | #:phases | |
220 | (modify-phases %standard-phases | |
221 | (add-before 'build 'fix-setup.py | |
222 | (lambda _ | |
223 | (substitute* "setup.py" | |
224 | (("^(\\s+SYS_INCLUDES = )\\['/usr.*" _ a) | |
225 | (string-append a "os.getenv('CPATH', '').split(os.pathsep)\n")) | |
226 | (("^(\\s+SYS_LIB_PREFIXES = )\\['/usr.*" _ a) | |
227 | (string-append a "os.getenv('LIBRARY_PATH', '').split(os.pathsep)\n")) | |
228 | (("^(\\s+SYS_SHARES = )\\['/usr.*" _ a) | |
229 | (string-append a "['" (assoc-ref %build-inputs "asn1c") "/share']\n"))) | |
140087fa HG |
230 | #t)) |
231 | (add-before 'build 'remove-wheel-requirement | |
232 | ;; we dont't build a wheel | |
233 | (lambda _ | |
234 | (substitute* "setup.cfg" | |
235 | ((" wheel *>= [0-9.]*") "")) | |
236 | (substitute* "pyproject.toml" | |
237 | (("\"wheel *>=.*\"") "")) | |
9b722166 | 238 | #t))))) |
140087fa | 239 | (native-inputs |
8394619b | 240 | (list python-pytest python-pytest-forked)) |
9b722166 | 241 | (inputs |
8394619b LC |
242 | (list boost libpepadapter pep-engine python-setuptools-scm |
243 | `(,util-linux "lib"))) ;; uuid.h | |
9b722166 HG |
244 | (home-page "https://pep.foundation/") |
245 | (synopsis "Python adapter for p≡p (pretty Easy Privacy)") | |
246 | (description "The p≡p Python adapter is an adaptor interface to the p≡p | |
247 | (pretty Easy privacy) engine.") | |
248 | (license license:gpl3))) | |
3cf7088f HG |
249 | |
250 | (define-public java-pep-adapter | |
251 | (package | |
252 | (name "java-pep-adapter") | |
c85edf2c | 253 | (version "2.1.23") |
3cf7088f HG |
254 | (source |
255 | (origin | |
c85edf2c HG |
256 | (method git-fetch) |
257 | (uri (git-reference | |
258 | (url "https://gitea.pep.foundation/pEp.foundation/pEpJNIAdapter") | |
259 | (commit (string-append "Release_" version)))) | |
260 | (file-name (git-file-name name version)) | |
3cf7088f | 261 | (sha256 |
c85edf2c | 262 | (base32 "1sw3a5ggxcrkghvpp0a6h2lz461x55ldgfw5y4pw7c3gk5wynvjk")))) |
3cf7088f HG |
263 | (build-system gnu-build-system) |
264 | (outputs '("out" "doc")) | |
265 | (arguments | |
266 | `(#:test-target "test" | |
c85edf2c | 267 | #:make-flags '("NDEBUG=1" "all" "doc") ; release build |
3cf7088f HG |
268 | #:phases |
269 | (modify-phases %standard-phases | |
3cf7088f HG |
270 | (add-before 'configure 'pin-shared-lib-path |
271 | (lambda* (#:key outputs #:allow-other-keys) | |
c85edf2c | 272 | (substitute* "src/java/foundation/pEp/jniadapter/AbstractEngine.java" |
3cf7088f HG |
273 | (("System.loadLibrary\\(\"pEpJNI\"\\);") |
274 | (string-append "System.load(\"" | |
275 | (assoc-ref outputs "out") | |
276 | "/lib/libpEpJNI.so" "\");"))) | |
277 | #t)) | |
278 | (replace 'configure | |
279 | ;; pEpJNIAdapter does not use autotools and configure, | |
280 | ;; but a local.conf. We need to tweak the values there. | |
281 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
282 | (let ((out (assoc-ref outputs "out")) | |
283 | (engine (assoc-ref inputs "pep-engine")) | |
284 | (libadapter (assoc-ref inputs "libpepadapter")) | |
285 | (openjdk (assoc-ref inputs "openjdk"))) | |
286 | (with-output-to-file "local.conf" | |
c85edf2c | 287 | (lambda _ |
3cf7088f HG |
288 | (format #t " |
289 | PREFIX=~a | |
290 | ENGINE_LIB_PATH=~a/lib | |
291 | ENGINE_INC_PATH=~a/include | |
292 | AD_LIB_PATH=~a/lib | |
293 | AD_INC_PATH=~a/include | |
294 | YML2_PROC=~a | |
295 | JAVA_HOME=~a | |
296 | " | |
297 | out engine engine libadapter libadapter | |
298 | (which "yml2proc") openjdk))) | |
299 | (substitute* "src/Makefile" ;; suppress some warnings | |
300 | (("^\\s+OLD_JAVA=") " xxx_OLD_JAVA=")) | |
301 | #t))) | |
c85edf2c HG |
302 | (add-before 'build 'build-codegen |
303 | ;; run codegen first to allow parallel build of other parts | |
304 | (lambda _ | |
305 | (invoke "make" "-C" "src" "create-dirs" "codegen"))) | |
3cf7088f HG |
306 | (replace 'install |
307 | (lambda* (#:key outputs #:allow-other-keys) | |
308 | (let* ((out (assoc-ref outputs "out")) | |
309 | (libout (string-append out "/lib/")) | |
310 | (javaout (string-append out "/share/java/"))) | |
c85edf2c HG |
311 | (install-file "dist/libpEpJNI.a" libout) |
312 | (install-file "dist/libpEpJNI.so" libout) | |
313 | (install-file "dist/pEp.jar" javaout) | |
3cf7088f HG |
314 | #t))) |
315 | (add-after 'install 'install-docs | |
316 | (lambda* (#:key outputs #:allow-other-keys) | |
317 | (let* ((out (assoc-ref outputs "doc")) | |
318 | (docout (string-append out "/share/doc/pEp-JNI-adapter")) | |
319 | (cxxout (string-append docout "/cxx")) | |
320 | (javaout (string-append docout "/java"))) | |
321 | (mkdir-p cxxout) | |
322 | (mkdir-p javaout) | |
323 | (copy-recursively "doc/doxygen/cxx/html" cxxout) | |
324 | (copy-recursively "doc/doxygen/java/html" javaout) | |
325 | #t)))))) | |
326 | (native-inputs | |
8394619b LC |
327 | (list doxygen graphviz |
328 | `(,openjdk9 "jdk") which yml2)) | |
3cf7088f | 329 | (inputs |
8394619b LC |
330 | (list libpepadapter pep-engine |
331 | `(,util-linux "lib"))) ;; uuid.h | |
3cf7088f HG |
332 | (home-page "https://pep.foundation/") |
333 | (synopsis "Java adapter for p≡p (pretty Easy Privacy)") | |
334 | (description "The p≡p JNI adapter is a Java adapter interface to the p≡p | |
335 | (pretty Easy privacy) engine.") | |
336 | (license license:gpl3))) |