A Guix channel providing pretty Easy privacy ( p≡p)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

455 lines
18 KiB

  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2016, 2020, 2021 Hartmut Goebel <h.goebel@crazy-compilers.com>
  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. (define-module (pEp nightly)
  19. #:use-module ((guix licenses) #:prefix license:)
  20. #:use-module (guix packages)
  21. #:use-module (guix download)
  22. #:use-module (guix git-download)
  23. #:use-module (guix build-system gnu)
  24. #:use-module (guix build-system python)
  25. #:use-module (gnu packages)
  26. #:use-module (gnu packages base)
  27. #:use-module (gnu packages boost)
  28. #:use-module (gnu packages autotools)
  29. #:use-module (gnu packages check)
  30. #:use-module (gnu packages documentation)
  31. #:use-module (gnu packages java)
  32. #:use-module (gnu packages libevent)
  33. #:use-module (gnu packages linux)
  34. #:use-module (gnu packages mail) ; for libetpan
  35. #:use-module (gnu packages rust)
  36. #:use-module (gnu packages crates-io)
  37. #:use-module (gnu packages python)
  38. #:use-module (gnu packages python-build) ; for wheel
  39. #:use-module (gnu packages python-xyz)
  40. #:use-module (gnu packages nettle)
  41. #:use-module (gnu packages pkg-config)
  42. #:use-module (gnu packages sequoia)
  43. #:use-module (gnu packages sqlite)
  44. #:use-module (gnu packages tls)
  45. #:use-module (gnu packages version-control)
  46. #:use-module (gnu packages xml))
  47. (define-public yml2
  48. (package
  49. (name "yml2")
  50. (version "2.7.1")
  51. (source
  52. (origin
  53. (method git-fetch)
  54. (uri (git-reference
  55. (url "https://gitea.pep.foundation/fdik/yml2")
  56. (commit version)))
  57. (file-name (git-file-name name version))
  58. (sha256
  59. (base32 "0qcxhmzbz4wmvldlx9k1g6570jgp60cq9lpzxhy46iycmndhnn5p"))))
  60. (build-system python-build-system)
  61. (propagated-inputs
  62. `(("python-lxml" ,python-lxml)))
  63. (home-page "https://fdik.org/yml/")
  64. (synopsis "Use a Domain Specific Language for XML without defining
  65. a grammar")
  66. (description "The YML compiler is a small Python script. It
  67. provides the command line front end yml2c. As default, it compiles
  68. your script and outputs to stdout, that usually is the terminal. Your
  69. shell provides options to redirect the output into a pipe or a file.")
  70. (license license:gpl2)))
  71. (define fdik-libetpan
  72. ;; pEp Engine requires libetpan with a set of patches that have not been
  73. ;; upstreamed yet.
  74. (let ((commit "bf4f79ef0e94a96a695ad13fc369277ee91a8b25") ; 2021-09-09
  75. (checksum "0926ik5756pixx3h9h0iyj4r3g05lgmr5wk6lcwrdx1nshklyl6z")
  76. (revision "7"))
  77. (package
  78. (inherit libetpan)
  79. (name "fdik-libetpan")
  80. (version (string-append "1.6-" revision "pEp." (string-take commit 8)))
  81. (source
  82. (origin
  83. (inherit (package-source libetpan))
  84. (method git-fetch)
  85. (uri (git-reference
  86. (url "https://gitea.pep.foundation/pEp.foundation/libetpan")
  87. (commit commit)))
  88. (file-name (string-append name "-" version))
  89. (sha256 (base32 checksum)))))))
  90. (define-public pep-engine
  91. (package
  92. (name "pep-engine")
  93. (version "2.1.50")
  94. (source
  95. (origin
  96. (method git-fetch)
  97. (uri (git-reference
  98. (url "https://gitea.pep.foundation/pEp.foundation/pEpEngine")
  99. (commit (string-append "Release_" version))))
  100. ;;(patches ; required up to 2.1.30
  101. ;; (search-patches "Fix-pgp_sequoia-for-sequoia-v1.0.0.patch"))
  102. (file-name (git-file-name name version))
  103. (sha256
  104. ;; 34: fail
  105. ;; 30: fail
  106. ;; 27: fail
  107. (base32
  108. "060scbdknadd3way1c1jaf0rqw6h0kqhwhh536xxr49mb5fdbpw0" ; 2.1.50
  109. ;;"1khy5a291i7ixznw79dv4z1pmv7iq38ix176jbm5bnpnwivqzj5s" ; 2.1.42
  110. ;;"05k831ib182z2hf95drnaw94w85dhna1qflddrh8gfyny0j2fly8" ; 2.1.41
  111. ;;"0qhzglhilp3hfki10mn2804gcpbp51wgr9v99x4xr5m35dk5lpsi" ; 2.1.39
  112. ;;"00q96y9j985qfa382acsz02i0zf6ayq2gmg8z70jzl04isg1h3cn" ; 2.1.34
  113. ;;"0z9k0i2zplnc48r7jn4xknv17hg0z0m6dp0fj93pdwmpa4hsgr5h" ; 2.1.31
  114. ;;"17f5j46bwjih0r5qymmf49nrh2h3wk0l37fiwim0l818kd57qjr4" ; 2.1.30
  115. ;;"0k3b3hn636bvdcl6lp6v7dc4jiz3pvbyd8c7806xifq5nf8sracx" ; 2.1.28
  116. ;;"02grqnqxfmv70cacqqy9sh71znzb5n3hjpfj2f4klywnmgk1xd2l" ; 2.1.27
  117. ;;"0r4s4vxy3cwxpfajvcpb0dbq744fp3hlkwg4jbshs2cvdf3y8qlh" ; 2.1.26
  118. ;;"07xj9mb764hs86ls9lh3xf0imv39g4baiafiaicb9x9dxyawa98w" ; 2.1.23
  119. ))))
  120. (build-system gnu-build-system)
  121. (arguments
  122. '(#:parallel-build? #f
  123. #:phases
  124. (modify-phases %standard-phases
  125. (replace 'configure
  126. ;; pEpEngine does not use autotools and configure,
  127. ;; but a local.conf. We need to tweak the values there.
  128. (lambda* (#:key inputs outputs #:allow-other-keys)
  129. (let ((out (assoc-ref outputs "out"))
  130. (yml2 (assoc-ref inputs "yml2")))
  131. (with-output-to-file "local.conf"
  132. (lambda ()
  133. (format #t "
  134. PREFIX=~a
  135. PER_MACHINE_DIRECTORY=${PREFIX}/share/pEp
  136. SYSTEM_DB=~a/share/pEp/system.db
  137. ASN1C=~a
  138. YML2_PATH=~a
  139. OPENPGP=SEQUOIA
  140. "
  141. out out (which "asn1c")
  142. (string-append yml2 "/bin"))))
  143. ;; To actually disable debug build, be need to tweak another
  144. ;; file.
  145. (substitute* "Makefile.conf"
  146. (("^DEBUG=.*" _) "DEBUG="))
  147. #t)))
  148. (delete 'check)
  149. (add-after 'install 'install-db
  150. (lambda _
  151. (invoke "make" "-C" "db" "install"))))))
  152. (native-inputs
  153. `(("asn1c" ,asn1c) ; >= 0.9.27
  154. ("pkg-config" ,pkg-config)
  155. ("yml2" ,yml2)))
  156. (inputs
  157. `(("libetpan" ,fdik-libetpan)
  158. ("libiconv" ,libiconv)
  159. ("nettle" ,nettle)
  160. ("openssl" ,openssl)
  161. ("libsequoia" ,libsequoia)
  162. ("sqlite3" ,sqlite)
  163. ("util-linux" ,util-linux "lib"))) ;; uuid.h
  164. (home-page "https://pep.foundation/")
  165. (synopsis "Library for automatic key management and encryption of
  166. messages")
  167. (description "The pp engine is the core part of pp (pretty Easy
  168. privacy).")
  169. (license ;; code: GPL 3, docs: CC-BY-SA
  170. (list license:gpl3 license:cc-by-sa3.0))))
  171. (define-public libpepadapter
  172. (package
  173. (name "libpepadapter")
  174. (version "2.1.22")
  175. (source
  176. (origin
  177. (method git-fetch)
  178. (uri (git-reference
  179. (url "https://gitea.pep.foundation/pEp.foundation/libpEpAdapter")
  180. (commit (string-append "Release_" version))))
  181. (file-name (git-file-name name version))
  182. (sha256
  183. (base32 "1s4v5sq8dcfh90vaxh34v7z4bxazpwwxaj7a3zj2shrb1l98m377"))))
  184. (build-system gnu-build-system)
  185. (arguments
  186. '(#:test-target "test"
  187. #:tests? #f ;; building the tests fails
  188. #:phases
  189. (modify-phases %standard-phases
  190. (replace 'configure
  191. ;; libpEpAdapter does not use autotools and configure,
  192. ;; but a local.conf. We need to tweak the values there.
  193. (lambda* (#:key inputs outputs #:allow-other-keys)
  194. (let ((out (assoc-ref outputs "out"))
  195. (engine (assoc-ref inputs "pep-engine")))
  196. (with-output-to-file "local.conf"
  197. (lambda _
  198. (format #t "
  199. PREFIX=~a
  200. ENGINE_LIB_PATH=~a/lib
  201. ENGINE_INC_PATH=~a/include
  202. " out engine engine)))
  203. ;; To actually disable debug build, be need to tweak another
  204. ;; file.
  205. (substitute* "Makefile.conf"
  206. (("^DEBUG=.*" _) "DEBUG="))
  207. #t))))))
  208. (inputs
  209. `(("pep-engine" ,pep-engine)
  210. ("util-linux" ,util-linux "lib"))) ;; uuid.h
  211. (home-page "https://pep.foundation/")
  212. (synopsis "Library for building p≡p adapters")
  213. (description "This C++ library provides common structures used in pp
  214. (pretty Easy privacy) adapters.")
  215. (license license:bsd-3)))
  216. (define-public python-pep-adapter
  217. (package
  218. (name "python-pep-adapter")
  219. (version "2.1.10-p1")
  220. (source
  221. (origin
  222. (method git-fetch)
  223. (uri (git-reference
  224. (url
  225. "https://gitea.pep.foundation/pEp.foundation/pEpPythonAdapter")
  226. (commit "731a78ba6101fff31b508516feab8756c3d12c63")))
  227. (file-name (git-file-name name version))
  228. (sha256
  229. (base32 "0mih29aj8g6nn25vzzxrjkv80fl6g49na2kl7in75j158m1zxqyd"))))
  230. (build-system python-build-system)
  231. (arguments
  232. `(;; Adding configure-flags does not work, running `build_ext`
  233. ;; with these flags, neither does adding the options to
  234. ;; `setup.cfg`: Either `build` or `install` fails (since
  235. ;; flags are given or missing), or "command 'BuildExtCommand'
  236. ;; has no such option 'pep_engine"
  237. ;; '(#:configure-flags
  238. ;; (list (string-append "--with-pEp-engine="
  239. ;; (assoc-ref inputs "pEpEngine"))
  240. ;; (string-append "--with-pEp-libadapter="
  241. ;; (assoc-ref inputs "libpEpAdapter"))
  242. ;; ;;(string-append "--boost="
  243. ;; (assoc-ref inputs "boost")) not supported
  244. ;; (string-append "--with-asn1c-share="
  245. ;; (assoc-ref inputs "asn1c") "/share"))
  246. #:phases
  247. (modify-phases %standard-phases
  248. (add-before 'build 'fix-permissions
  249. (lambda _
  250. (when (file-exists? "src/pEp/__version__.py")
  251. (chmod "src/pEp/__version__.py" #o644))))
  252. (add-before 'build 'remove-wheel-requirement
  253. ;; we dont't build a wheel
  254. (lambda _
  255. (substitute* "setup.cfg"
  256. ((" wheel( *>= [0-9.]*)?") ""))
  257. (substitute* "pyproject.toml"
  258. (("\"wheel( *>=.*)?\",?") ""))
  259. #t))
  260. (add-before 'check 'set-HOME
  261. (lambda _
  262. (setenv "HOME" "/tmp"))))))
  263. (native-inputs
  264. `(("git", git) ;; due to setuptools_scm
  265. ("python-pytest" ,python-pytest)
  266. ("python-pytest-forked" ,python-pytest-forked)))
  267. (inputs
  268. `(("boost-python" ,boost-with-python3)
  269. ("libpepadapter" ,libpepadapter)
  270. ("pep-engine" ,pep-engine)
  271. ("python-setuptools-scm" ,python-setuptools-scm)
  272. ("util-linux" ,util-linux "lib"))) ;; uuid.h
  273. (home-page "https://pep.foundation/")
  274. (synopsis "Python adapter for p≡p (pretty Easy Privacy)")
  275. (description "The pp Python adapter is an adaptor interface to the pp
  276. (pretty Easy privacy) engine.")
  277. (license license:gpl3)))
  278. (define-public java-pep-adapter
  279. (package
  280. (name "java-pep-adapter")
  281. (version "2.1.23")
  282. (source
  283. (origin
  284. (method git-fetch)
  285. (uri (git-reference
  286. (url "https://gitea.pep.foundation/pEp.foundation/pEpJNIAdapter")
  287. (commit (string-append "Release_" version))))
  288. (file-name (git-file-name name version))
  289. (sha256
  290. (base32 "1sw3a5ggxcrkghvpp0a6h2lz461x55ldgfw5y4pw7c3gk5wynvjk"))))
  291. (build-system gnu-build-system)
  292. (outputs '("out" "doc"))
  293. (arguments
  294. `(#:test-target "test"
  295. #:make-flags '("NDEBUG=1" "all" "doc") ; release build
  296. #:phases
  297. (modify-phases %standard-phases
  298. (add-before 'configure 'pin-shared-lib-path
  299. (lambda* (#:key outputs #:allow-other-keys)
  300. (substitute* "src/java/foundation/pEp/jniadapter/AbstractEngine.java"
  301. (("System.loadLibrary\\(\"pEpJNI\"\\);")
  302. (string-append "System.load(\""
  303. (assoc-ref outputs "out")
  304. "/lib/libpEpJNI.so" "\");")))
  305. #t))
  306. (replace 'configure
  307. ;; pEpJNIAdapter does not use autotools and configure,
  308. ;; but a local.conf. We need to tweak the values there.
  309. (lambda* (#:key inputs outputs #:allow-other-keys)
  310. (let ((out (assoc-ref outputs "out"))
  311. (engine (assoc-ref inputs "pep-engine"))
  312. (libadapter (assoc-ref inputs "libpepadapter"))
  313. (openjdk (assoc-ref inputs "openjdk")))
  314. (with-output-to-file "local.conf"
  315. (lambda _
  316. (format #t "
  317. PREFIX=~a
  318. ENGINE_LIB_PATH=~a/lib
  319. ENGINE_INC_PATH=~a/include
  320. AD_LIB_PATH=~a/lib
  321. AD_INC_PATH=~a/include
  322. YML2_PROC=~a
  323. JAVA_HOME=~a
  324. "
  325. out engine engine libadapter libadapter
  326. (which "yml2proc") openjdk)))
  327. (substitute* "src/Makefile" ;; suppress some warnings
  328. (("^\\s+OLD_JAVA=") " xxx_OLD_JAVA="))
  329. #t)))
  330. (add-before 'build 'build-codegen
  331. ;; run codegen first to allow parallel build of other parts
  332. (lambda _
  333. (invoke "make" "-C" "src" "create-dirs" "codegen")))
  334. (replace 'install
  335. (lambda* (#:key outputs #:allow-other-keys)
  336. (let* ((out (assoc-ref outputs "out"))
  337. (libout (string-append out "/lib/"))
  338. (javaout (string-append out "/share/java/")))
  339. (install-file "dist/libpEpJNI.a" libout)
  340. (install-file "dist/libpEpJNI.so" libout)
  341. (install-file "dist/pEp.jar" javaout)
  342. #t)))
  343. (add-after 'install 'install-docs
  344. (lambda* (#:key outputs #:allow-other-keys)
  345. (let* ((out (assoc-ref outputs "doc"))
  346. (docout (string-append out "/share/doc/pEp-JNI-adapter"))
  347. (cxxout (string-append docout "/cxx"))
  348. (javaout (string-append docout "/java")))
  349. (mkdir-p cxxout)
  350. (mkdir-p javaout)
  351. (copy-recursively "doc/doxygen/cxx/html" cxxout)
  352. (copy-recursively "doc/doxygen/java/html" javaout)
  353. #t))))))
  354. (native-inputs
  355. `(("doxygen" ,doxygen)
  356. ("graphviz" ,graphviz)
  357. ("openjdk" ,openjdk9 "jdk")
  358. ("which" ,which)
  359. ("yml2" ,yml2)))
  360. (inputs
  361. `(("libpepadapter" ,libpepadapter)
  362. ("pep-engine" ,pep-engine)
  363. ("util-linux" ,util-linux "lib"))) ;; uuid.h
  364. (home-page "https://pep.foundation/")
  365. (synopsis "Java adapter for p≡p (pretty Easy Privacy)")
  366. (description "The pp JNI adapter is a Java adapter interface to the pp
  367. (pretty Easy privacy) engine.")
  368. (license license:gpl3)))
  369. (define-public pep-json-adapter
  370. (package
  371. (name "pep-json-adapter")
  372. (version "2.1.0-RC19")
  373. (source
  374. (origin
  375. (method git-fetch)
  376. (uri (git-reference
  377. (url "https://gitea.pep.foundation/pEp.foundation/pEpJSONServerAdapter")
  378. (commit (string-append "Release_" version))))
  379. (file-name (git-file-name name version))
  380. (sha256
  381. (base32 "0x7xaahifm0kczm0im02ihfjjgzrhxlwbg6ndl044jd4s5riawfd"))))
  382. (build-system gnu-build-system)
  383. (arguments
  384. `(#:test-target "test"
  385. #:phases
  386. (modify-phases %standard-phases
  387. (add-after 'unpack 'unpack-googletest
  388. ;; Copy the googletest sources
  389. (lambda* (#:key inputs #:allow-other-keys)
  390. (let ((source (assoc-ref inputs "googletest-source"))
  391. (target "googletest"))
  392. (mkdir-p target)
  393. (copy-recursively source target)
  394. #t)))
  395. (add-before 'configure 'chdir
  396. (lambda _
  397. (chdir "server")
  398. #t))
  399. (delete 'check)
  400. (add-after 'install 'check
  401. (lambda* (#:key inputs outputs #:allow-other-keys)
  402. (let ((out (assoc-ref outputs "out")))
  403. ;; The adapter must be installed for trunning the tests
  404. (invoke "make" "test")
  405. ;; uninstall the unittest file
  406. (delete-file (string-append out "/bin/unittests"))
  407. #t)))
  408. (replace 'configure
  409. ;; pEpJSONAdapter does not use autotools and configure,
  410. ;; but a local.conf. We need to tweak the values there.
  411. (lambda* (#:key inputs outputs #:allow-other-keys)
  412. (let ((out (assoc-ref outputs "out"))
  413. (googletest (string-append (getcwd) "/../googletest"))
  414. )
  415. (with-output-to-file "local.conf"
  416. (lambda ()
  417. (format #t "
  418. PREFIX=~a
  419. HTML_DIRECTORY=$(PREFIX)/share/pEp/json-adapter/html
  420. GTEST_DIR=~a/googletest
  421. # these are found automatically by gcc
  422. ENGINE_LIB=
  423. ENGINE_INC=
  424. ETPAN_INC=
  425. ETPAN_LIB=
  426. EVENT_INC=
  427. EVENT_LIB=
  428. "
  429. out googletest)))
  430. #t))))))
  431. (native-inputs
  432. `(("pkg-config" ,pkg-config)))
  433. (inputs
  434. `(("boost" ,boost)
  435. ("libpepadapter" ,libpepadapter)
  436. ("googletest-source" ,(package-source googletest))
  437. ("libetpan" ,fdik-libetpan)
  438. ("libevent" ,libevent)
  439. ("pep-engine" ,pep-engine)
  440. ("util-linux" ,util-linux "lib"))) ;; uuid.h
  441. (home-page "https://pep.foundation/")
  442. (synopsis "p≡p JSON adapter")
  443. (description "The pp JSON adapter is an adaptor interface to the pp
  444. (pretty Easy privacy) Engine.")
  445. (license license:gpl3)))