Commit | Line | Data |
---|---|---|
4c4ae8b5 HG |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2019, 2020 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 | ||
19 | (define-module (gnu packages sequoia) | |
20 | #:use-module (guix build-system cargo) | |
21 | #:use-module (guix download) | |
22 | #:use-module (guix git-download) | |
23 | #:use-module ((guix licenses) #:prefix license:) | |
24 | #:use-module (guix packages) | |
25 | #:use-module (gnu packages) | |
26 | #:use-module (gnu packages check) ;; python-pytest | |
27 | #:use-module (gnu packages crates-io) | |
28 | #:use-module (gnu packages libffi) ;; python-cffi | |
29 | #:use-module (gnu packages llvm) | |
30 | #:use-module (gnu packages multiprecision) | |
31 | #:use-module (gnu packages nettle) | |
32 | #:use-module (gnu packages pkg-config) | |
33 | #:use-module (gnu packages python) | |
34 | #:use-module (gnu packages python-xyz) ;; python-setuptools | |
35 | #:use-module (gnu packages serialization) | |
36 | #:use-module (gnu packages sqlite) | |
37 | #:use-module (gnu packages tls)) | |
38 | ||
39 | (define-public sequoia | |
40 | (package | |
41 | (name "sequoia") | |
42 | (version "0.16.0") | |
43 | (source | |
44 | (origin | |
45 | (method git-fetch) | |
46 | (uri (git-reference | |
47 | (url "https://gitlab.com/sequoia-pgp/sequoia.git") | |
48 | (commit (string-append "v" version)))) | |
49 | (sha256 | |
50 | (base32 "0iwzi2ylrwz56s77cd4vcf89ig6ipy4w6kp2pfwqvd2d00x54dhk")) | |
51 | (file-name (git-file-name name version)))) | |
52 | (build-system cargo-build-system) | |
53 | (outputs '("out" "python")) | |
54 | (native-inputs | |
55 | `(("clang" ,clang) | |
56 | ("pkg-config" ,pkg-config) | |
57 | ("python-pytest" ,python-pytest) | |
58 | ("python-pytest-runner" ,python-pytest-runner))) | |
59 | (inputs | |
60 | `(("capnproto" ,capnproto) | |
61 | ("gmp" ,gmp) | |
62 | ("nettle" ,nettle) | |
63 | ("openssl" ,openssl) | |
64 | ("python" ,python) | |
65 | ("python-cffi" ,python-cffi) | |
66 | ("sqlite" ,sqlite))) | |
67 | (arguments | |
68 | `(#:tests? #f ;; building the tests requires 9.7GB total | |
69 | #:cargo-inputs | |
70 | (("rust-assert-cli" ,rust-assert-cli-0.6) | |
71 | ("rust-anyhow" ,rust-anyhow-1.0) | |
72 | ("rust-base64", rust-base64-0.11) | |
73 | ;;("rust-buffered-reader" included | |
74 | ("rust-bzip2", rust-bzip2-0.3) | |
75 | ("rust-capnp" ,rust-capnp-0.10) | |
76 | ("rust-capnp-rpc" ,rust-capnp-rpc-0.10) | |
77 | ("rust-capnpc" ,rust-capnpc-0.10) | |
78 | ("rust-chrono" ,rust-chrono-0.4) | |
79 | ("rust-clap" ,rust-clap-2) | |
80 | ("rust-clap" ,rust-clap-2) | |
81 | ("rust-colored" ,rust-colored-1.9.1) | |
82 | ("rust-crossterm" ,rust-crossterm-0.13) | |
83 | ("rust-ctor", rust-ctor-0.1) | |
84 | ("rust-dirs" ,rust-dirs-2.0) | |
85 | ;;("rust-failure" included | |
86 | ("rust-filetime" ,rust-filetime-0.2) | |
87 | ("rust-flate2", rust-flate2-1.0) | |
88 | ("rust-fs2" ,rust-fs2-0.4) | |
89 | ("rust-futures" ,rust-futures-0.1) | |
90 | ("rust-http" ,rust-http-0.1) | |
91 | ("rust-hyper" ,rust-hyper-0.12) | |
92 | ("rust-hyper-tls" ,rust-hyper-tls-0.3) | |
93 | ("rust-idna", rust-idna-0.2) | |
94 | ("rust-itertools" ,rust-itertools-0.8) | |
95 | ("rust-lalrpop-util", rust-lalrpop-util-0.17) | |
96 | ("rust-lazy-static", rust-lazy-static-1.3) | |
97 | ("rust-libc" ,rust-libc-0.2) | |
98 | ("rust-memsec", rust-memsec-0.5) | |
99 | ("rust-native-tls" ,rust-native-tls-0.2) | |
100 | ("rust-nettle", rust-nettle-7) | |
101 | ("rust-parity-tokio-ipc" ,rust-parity-tokio-ipc-0.4) | |
102 | ("rust-percent-encoding" ,rust-percent-encoding-2.1) | |
103 | ("rust-prettytable-rs" ,rust-prettytable-rs-0.8) | |
104 | ("rust-proc-macro2" ,rust-proc-macro2-1.0) | |
105 | ("rust-quickcheck", rust-quickcheck-0.9) | |
106 | ("rust-rand", rust-rand-0.7) | |
107 | ("rust-regex", rust-regex-1.3) | |
108 | ("rust-rusqlite" ,rust-rusqlite-0.19) | |
109 | ("rust-tempfile" ,rust-tempfile-3.1) | |
110 | ("rust-thiserror" ,rust-thiserror-1.0) | |
111 | ("rust-tokio" ,rust-tokio-0.1) | |
112 | ("rust-tokio-core" ,rust-tokio-core-0.1) | |
113 | ("rust-unicode-normalization", rust-unicode-normalization-0.1) | |
114 | ("rust-url" ,rust-url-2.1) | |
115 | ("rust-zbase32" ,rust-zbase32-0.1)) | |
116 | #:cargo-development-inputs | |
117 | (("rust-bindgen" ,rust-bindgen-0.51) ;; FIXME for nettle-sys and rusqlite | |
118 | ("rust-lalrpop" ,rust-lalrpop-0.17) | |
119 | ("rust-rpassword" ,rust-rpassword-4)) | |
120 | #:phases | |
121 | (modify-phases %standard-phases | |
122 | ;; Run make instead of using the rust build system, as | |
123 | ;; suggested by the installation instructions | |
124 | (replace 'build (lambda _ (invoke "make" "build-release") #t)) | |
125 | (replace 'check | |
126 | (lambda* (#:key tests? #:allow-other-keys) | |
127 | (if tests? | |
128 | (invoke "make" "check") | |
129 | #t))) | |
130 | (replace 'install (lambda _ (invoke "make" "install") #t)) | |
131 | (add-after 'unpack 'adjust-prefix | |
132 | (lambda* (#:key outputs #:allow-other-keys) | |
133 | (setenv "PREFIX" (assoc-ref outputs "out")) | |
134 | #t)) | |
135 | (add-after 'unpack 'fix-fo-python-output | |
136 | (lambda* (#:key outputs #:allow-other-keys) | |
137 | (let ((out (assoc-ref outputs "out")) | |
138 | (pyout (assoc-ref outputs "python"))) | |
139 | (substitute* "ffi/lang/python/Makefile" | |
140 | ;; adjust prefix for python package | |
141 | (("PREFIX\\s*\\??=.*") | |
142 | (string-append "PREFIX = " pyout "\n")) | |
143 | ;; fix rpath to include the main package | |
144 | (("\\WLDFLAGS=" text) | |
145 | (string-append text "'-Wl,-rpath=" out "/lib '")) | |
146 | ;; make setuptools install into the prefix, see | |
147 | ;; guix/build/python-build-system.scm for explanation | |
148 | (("\\ssetup.py\\s+install\\s") | |
149 | " setup.py install --root=/ --single-version-externally-managed ")) | |
150 | #t))) | |
151 | (add-after 'unpack 'set-missing-env-vars | |
152 | (lambda* (#:key inputs #:allow-other-keys) | |
153 | ;; FIXME: why do we need to set this here? | |
154 | (setenv "LIBCLANG_PATH" | |
155 | (string-append (assoc-ref inputs "clang") "/lib")) | |
156 | #t))))) | |
157 | (home-page "https://sequoia-pgp.org") | |
158 | (synopsis "New OpenPGP implementation") | |
159 | (description "Sequoia is a new OpenPGP implementation. It consists of | |
160 | several crates, providing both a low-level and a high-level API for dealing | |
161 | with OpenPGP data.") | |
162 | (license license:gpl2+))) |