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

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016, 2020, 2021 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (pEp nightly)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix build-system gnu)
#:use-module (guix build-system python)
#:use-module (gnu packages)
#:use-module (gnu packages base)
#:use-module (gnu packages boost)
#:use-module (gnu packages autotools)
#:use-module (gnu packages check)
#:use-module (gnu packages documentation)
#:use-module (gnu packages java)
#:use-module (gnu packages libevent)
#:use-module (gnu packages linux)
#:use-module (gnu packages mail) ; for libetpan
#:use-module (gnu packages rust)
#:use-module (gnu packages crates-io)
#:use-module (gnu packages python)
#:use-module (gnu packages python-build) ; for wheel
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages nettle)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages sequoia)
#:use-module (gnu packages sqlite)
#:use-module (gnu packages tls)
#:use-module (gnu packages version-control)
#:use-module (gnu packages xml))
(define-public yml2
(package
(name "yml2")
(version "2.7.1")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://gitea.pep.foundation/fdik/yml2")
(commit version)))
(file-name (git-file-name name version))
(sha256
(base32 "0qcxhmzbz4wmvldlx9k1g6570jgp60cq9lpzxhy46iycmndhnn5p"))))
(build-system python-build-system)
(propagated-inputs
`(("python-lxml" ,python-lxml)))
(home-page "https://fdik.org/yml/")
(synopsis "Use a Domain Specific Language for XML without defining
a grammar")
(description "The YML compiler is a small Python script. It
provides the command line front end yml2c. As default, it compiles
your script and outputs to stdout, that usually is the terminal. Your
shell provides options to redirect the output into a pipe or a file.")
(license license:gpl2)))
(define fdik-libetpan
;; pEp Engine requires libetpan with a set of patches that have not been
;; upstreamed yet.
(let ((commit "bf4f79ef0e94a96a695ad13fc369277ee91a8b25") ; 2021-09-09
(checksum "0926ik5756pixx3h9h0iyj4r3g05lgmr5wk6lcwrdx1nshklyl6z")
(revision "7"))
(package
(inherit libetpan)
(name "fdik-libetpan")
(version (string-append "1.6-" revision "pEp." (string-take commit 8)))
(source
(origin
(inherit (package-source libetpan))
(method git-fetch)
(uri (git-reference
(url "https://gitea.pep.foundation/pEp.foundation/libetpan")
(commit commit)))
(file-name (string-append name "-" version))
(sha256 (base32 checksum)))))))
(define-public pep-engine
(package
(name "pep-engine")
(version "2.1.50")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://gitea.pep.foundation/pEp.foundation/pEpEngine")
(commit (string-append "Release_" version))))
;;(patches ; required up to 2.1.30
;; (search-patches "Fix-pgp_sequoia-for-sequoia-v1.0.0.patch"))
(file-name (git-file-name name version))
(sha256
;; 34: fail
;; 30: fail
;; 27: fail
(base32
"060scbdknadd3way1c1jaf0rqw6h0kqhwhh536xxr49mb5fdbpw0" ; 2.1.50
;;"1khy5a291i7ixznw79dv4z1pmv7iq38ix176jbm5bnpnwivqzj5s" ; 2.1.42
;;"05k831ib182z2hf95drnaw94w85dhna1qflddrh8gfyny0j2fly8" ; 2.1.41
;;"0qhzglhilp3hfki10mn2804gcpbp51wgr9v99x4xr5m35dk5lpsi" ; 2.1.39
;;"00q96y9j985qfa382acsz02i0zf6ayq2gmg8z70jzl04isg1h3cn" ; 2.1.34
;;"0z9k0i2zplnc48r7jn4xknv17hg0z0m6dp0fj93pdwmpa4hsgr5h" ; 2.1.31
;;"17f5j46bwjih0r5qymmf49nrh2h3wk0l37fiwim0l818kd57qjr4" ; 2.1.30
;;"0k3b3hn636bvdcl6lp6v7dc4jiz3pvbyd8c7806xifq5nf8sracx" ; 2.1.28
;;"02grqnqxfmv70cacqqy9sh71znzb5n3hjpfj2f4klywnmgk1xd2l" ; 2.1.27
;;"0r4s4vxy3cwxpfajvcpb0dbq744fp3hlkwg4jbshs2cvdf3y8qlh" ; 2.1.26
;;"07xj9mb764hs86ls9lh3xf0imv39g4baiafiaicb9x9dxyawa98w" ; 2.1.23
))))
(build-system gnu-build-system)
(arguments
'(#:parallel-build? #f
#:phases
(modify-phases %standard-phases
(replace 'configure
;; pEpEngine 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"))
(yml2 (assoc-ref inputs "yml2")))
(with-output-to-file "local.conf"
(lambda ()
(format #t "
PREFIX=~a
PER_MACHINE_DIRECTORY=${PREFIX}/share/pEp
SYSTEM_DB=~a/share/pEp/system.db
ASN1C=~a
YML2_PATH=~a
OPENPGP=SEQUOIA
"
out out (which "asn1c")
(string-append yml2 "/bin"))))
;; To actually disable debug build, be need to tweak another
;; file.
(substitute* "Makefile.conf"
(("^DEBUG=.*" _) "DEBUG="))
#t)))
(delete 'check)
(add-after 'install 'install-db
(lambda _
(invoke "make" "-C" "db" "install"))))))
(native-inputs
`(("asn1c" ,asn1c) ; >= 0.9.27
("pkg-config" ,pkg-config)
("yml2" ,yml2)))
(inputs
`(("libetpan" ,fdik-libetpan)
("libiconv" ,libiconv)
("nettle" ,nettle)
("openssl" ,openssl)
("libsequoia" ,libsequoia)
("sqlite3" ,sqlite)
("util-linux" ,util-linux "lib"))) ;; uuid.h
(home-page "https://pep.foundation/")
(synopsis "Library for automatic key management and encryption of
messages")
(description "The p≡p engine is the core part of p≡p (pretty Easy
privacy).")
(license ;; code: GPL 3, docs: CC-BY-SA
(list license:gpl3 license:cc-by-sa3.0))))
(define-public libpepadapter
(package
(name "libpepadapter")
(version "2.1.22")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://gitea.pep.foundation/pEp.foundation/libpEpAdapter")
(commit (string-append "Release_" version))))
(file-name (git-file-name name version))
(sha256
(base32 "1s4v5sq8dcfh90vaxh34v7z4bxazpwwxaj7a3zj2shrb1l98m377"))))
(build-system gnu-build-system)
(arguments
'(#:test-target "test"
#:tests? #f ;; building the tests fails
#:phases
(modify-phases %standard-phases
(replace 'configure
;; libpEpAdapter 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")))
(with-output-to-file "local.conf"
(lambda _
(format #t "
PREFIX=~a
ENGINE_LIB_PATH=~a/lib
ENGINE_INC_PATH=~a/include
" out engine engine)))
;; To actually disable debug build, be need to tweak another
;; file.
(substitute* "Makefile.conf"
(("^DEBUG=.*" _) "DEBUG="))
#t))))))
(inputs
`(("pep-engine" ,pep-engine)
("util-linux" ,util-linux "lib"))) ;; uuid.h
(home-page "https://pep.foundation/")
(synopsis "Library for building p≡p adapters")
(description "This C++ library provides common structures used in p≡p
(pretty Easy privacy) adapters.")
(license license:bsd-3)))
(define-public python-pep-adapter
(package
(name "python-pep-adapter")
(version "2.1.10-p1")
(source
(origin
(method git-fetch)
(uri (git-reference
(url
"https://gitea.pep.foundation/pEp.foundation/pEpPythonAdapter")
(commit "731a78ba6101fff31b508516feab8756c3d12c63")))
(file-name (git-file-name name version))
(sha256
(base32 "0mih29aj8g6nn25vzzxrjkv80fl6g49na2kl7in75j158m1zxqyd"))))
(build-system python-build-system)
(arguments
`(;; Adding configure-flags does not work, running `build_ext`
;; with these flags, neither does adding the options to
;; `setup.cfg`: Either `build` or `install` fails (since
;; flags are given or missing), or "command 'BuildExtCommand'
;; has no such option 'pep_engine"
;; '(#:configure-flags
;; (list (string-append "--with-pEp-engine="
;; (assoc-ref inputs "pEpEngine"))
;; (string-append "--with-pEp-libadapter="
;; (assoc-ref inputs "libpEpAdapter"))
;; ;;(string-append "--boost="
;; (assoc-ref inputs "boost")) not supported
;; (string-append "--with-asn1c-share="
;; (assoc-ref inputs "asn1c") "/share"))
#:phases
(modify-phases %standard-phases
(add-before 'build 'fix-permissions
(lambda _
(when (file-exists? "src/pEp/__version__.py")
(chmod "src/pEp/__version__.py" #o644))))
(add-before 'build 'remove-wheel-requirement
;; we dont't build a wheel
(lambda _
(substitute* "setup.cfg"
((" wheel( *>= [0-9.]*)?") ""))
(substitute* "pyproject.toml"
(("\"wheel( *>=.*)?\",?") ""))
#t))
(add-before 'check 'set-HOME
(lambda _
(setenv "HOME" "/tmp"))))))
(native-inputs
`(("git", git) ;; due to setuptools_scm
("python-pytest" ,python-pytest)
("python-pytest-forked" ,python-pytest-forked)))
(inputs
`(("boost-python" ,boost-with-python3)
("libpepadapter" ,libpepadapter)
("pep-engine" ,pep-engine)
("python-setuptools-scm" ,python-setuptools-scm)
("util-linux" ,util-linux "lib"))) ;; uuid.h
(home-page "https://pep.foundation/")
(synopsis "Python adapter for p≡p (pretty Easy Privacy)")
(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.1.23")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://gitea.pep.foundation/pEp.foundation/pEpJNIAdapter")
(commit (string-append "Release_" version))))
(file-name (git-file-name name version))
(sha256
(base32 "1sw3a5ggxcrkghvpp0a6h2lz461x55ldgfw5y4pw7c3gk5wynvjk"))))
(build-system gnu-build-system)
(outputs '("out" "doc"))
(arguments
`(#:test-target "test"
#:make-flags '("NDEBUG=1" "all" "doc") ; release build
#:phases
(modify-phases %standard-phases
(add-before 'configure 'pin-shared-lib-path
(lambda* (#:key outputs #:allow-other-keys)
(substitute* "src/java/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)))
(add-before 'build 'build-codegen
;; run codegen first to allow parallel build of other parts
(lambda _
(invoke "make" "-C" "src" "create-dirs" "codegen")))
(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/")))
(install-file "dist/libpEpJNI.a" libout)
(install-file "dist/libpEpJNI.so" libout)
(install-file "dist/pEp.jar" javaout)
#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)
("graphviz" ,graphviz)
("openjdk" ,openjdk9 "jdk")
("which" ,which)
("yml2" ,yml2)))
(inputs
`(("libpepadapter" ,libpepadapter)
("pep-engine" ,pep-engine)
("util-linux" ,util-linux "lib"))) ;; 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)))
(define-public pep-json-adapter
(package
(name "pep-json-adapter")
(version "2.1.0-RC19")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://gitea.pep.foundation/pEp.foundation/pEpJSONServerAdapter")
(commit (string-append "Release_" version))))
(file-name (git-file-name name version))
(sha256
(base32 "0x7xaahifm0kczm0im02ihfjjgzrhxlwbg6ndl044jd4s5riawfd"))))
(build-system gnu-build-system)
(arguments
`(#:test-target "test"
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'unpack-googletest
;; Copy the googletest sources
(lambda* (#:key inputs #:allow-other-keys)
(let ((source (assoc-ref inputs "googletest-source"))
(target "googletest"))
(mkdir-p target)
(copy-recursively source target)
#t)))
(add-before 'configure 'chdir
(lambda _
(chdir "server")
#t))
(delete 'check)
(add-after 'install 'check
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
;; The adapter must be installed for trunning the tests
(invoke "make" "test")
;; uninstall the unittest file
(delete-file (string-append out "/bin/unittests"))
#t)))
(replace 'configure
;; pEpJSONAdapter 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"))
(googletest (string-append (getcwd) "/../googletest"))
)
(with-output-to-file "local.conf"
(lambda ()
(format #t "
PREFIX=~a
HTML_DIRECTORY=$(PREFIX)/share/pEp/json-adapter/html
GTEST_DIR=~a/googletest
# these are found automatically by gcc
ENGINE_LIB=
ENGINE_INC=
ETPAN_INC=
ETPAN_LIB=
EVENT_INC=
EVENT_LIB=
"
out googletest)))
#t))))))
(native-inputs
`(("pkg-config" ,pkg-config)))
(inputs
`(("boost" ,boost)
("libpepadapter" ,libpepadapter)
("googletest-source" ,(package-source googletest))
("libetpan" ,fdik-libetpan)
("libevent" ,libevent)
("pep-engine" ,pep-engine)
("util-linux" ,util-linux "lib"))) ;; uuid.h
(home-page "https://pep.foundation/")
(synopsis "p≡p JSON adapter")
(description "The p≡p JSON adapter is an adaptor interface to the p≡p
(pretty Easy privacy) Engine.")
(license license:gpl3)))