2020-03-05 22:59:43 +00:00
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
2021-05-01 18:31:53 +00:00
|
|
|
;;; Copyright © 2019, 2020, 2021 Hartmut Goebel <h.goebel@crazy-compilers.com>
|
2021-03-22 09:20:17 +00:00
|
|
|
;;; Copyright © 2021 Efraim Flashner <efraim@flashner.co.il>
|
2020-03-05 22:59:43 +00:00
|
|
|
;;;
|
|
|
|
;;; 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 (gnu packages sequoia)
|
|
|
|
#:use-module (guix build-system cargo)
|
|
|
|
#:use-module (guix download)
|
|
|
|
#:use-module (guix git-download)
|
|
|
|
#:use-module ((guix licenses) #:prefix license:)
|
|
|
|
#:use-module (guix packages)
|
2021-03-22 09:20:17 +00:00
|
|
|
#:use-module (guix utils)
|
2020-03-05 22:59:43 +00:00
|
|
|
#:use-module (gnu packages)
|
|
|
|
#:use-module (gnu packages check) ;; python-pytest
|
|
|
|
#:use-module (gnu packages crates-io)
|
|
|
|
#:use-module (gnu packages libffi) ;; python-cffi
|
|
|
|
#:use-module (gnu packages llvm)
|
|
|
|
#:use-module (gnu packages multiprecision)
|
|
|
|
#:use-module (gnu packages nettle)
|
|
|
|
#:use-module (gnu packages pkg-config)
|
|
|
|
#:use-module (gnu packages python)
|
|
|
|
#:use-module (gnu packages python-xyz) ;; python-setuptools
|
2020-10-17 22:03:45 +00:00
|
|
|
#:use-module (gnu packages rust)
|
2020-03-05 22:59:43 +00:00
|
|
|
#:use-module (gnu packages serialization)
|
|
|
|
#:use-module (gnu packages sqlite)
|
|
|
|
#:use-module (gnu packages tls))
|
|
|
|
|
|
|
|
(define-public sequoia
|
|
|
|
(package
|
|
|
|
(name "sequoia")
|
2021-05-01 18:31:53 +00:00
|
|
|
(version "1.1.0")
|
2020-03-05 22:59:43 +00:00
|
|
|
(source
|
|
|
|
(origin
|
|
|
|
(method git-fetch)
|
|
|
|
(uri (git-reference
|
|
|
|
(url "https://gitlab.com/sequoia-pgp/sequoia.git")
|
2021-05-01 18:31:53 +00:00
|
|
|
(commit (string-append "openpgp/v" version))))
|
2020-03-05 22:59:43 +00:00
|
|
|
(sha256
|
2021-05-01 18:31:53 +00:00
|
|
|
(base32 "0knkm0nw1h4ww51vks4jnnp1yc45llfi7j0i70f6vf2bcknnbmci"))
|
2020-03-05 22:59:43 +00:00
|
|
|
(file-name (git-file-name name version))))
|
|
|
|
(build-system cargo-build-system)
|
|
|
|
(outputs '("out" "python"))
|
|
|
|
(native-inputs
|
|
|
|
`(("clang" ,clang)
|
|
|
|
("pkg-config" ,pkg-config)
|
|
|
|
("python-pytest" ,python-pytest)
|
2020-10-17 22:03:45 +00:00
|
|
|
("python-pytest-runner" ,python-pytest-runner)
|
|
|
|
("python-wrapper" ,python-wrapper)))
|
2020-03-05 22:59:43 +00:00
|
|
|
(inputs
|
|
|
|
`(("capnproto" ,capnproto)
|
|
|
|
("gmp" ,gmp)
|
|
|
|
("nettle" ,nettle)
|
|
|
|
("openssl" ,openssl)
|
|
|
|
("python" ,python)
|
|
|
|
("python-cffi" ,python-cffi)
|
|
|
|
("sqlite" ,sqlite)))
|
|
|
|
(arguments
|
|
|
|
`(#:tests? #f ;; building the tests requires 9.7GB total
|
2020-10-17 22:03:45 +00:00
|
|
|
#:rust ,rust-1.46
|
2020-03-05 22:59:43 +00:00
|
|
|
#:cargo-inputs
|
2021-01-03 18:53:42 +00:00
|
|
|
(("rust-anyhow" ,rust-anyhow-1)
|
2020-10-17 22:03:45 +00:00
|
|
|
("rust-backtrace" ,rust-backtrace-0.3)
|
|
|
|
("rust-base64" ,rust-base64-0.13)
|
2020-03-05 22:59:43 +00:00
|
|
|
;;("rust-buffered-reader" included
|
2020-10-17 22:03:45 +00:00
|
|
|
("rust-bzip2" ,rust-bzip2-0.4)
|
gnu: sequoia: Update to 1.0.0.
* gnu/packages/sequoia.scm (sequoia): Update to 1.0.0.
[arguments]{cargo-inputs}: Add rust-eax, rust-futures-util,
rust-sha1collisiondetection, rust-socket2. Update rust-capnp, rust-capnp-rpc,
rust-capnpc, rust-futures, rust-http,rust-hyper rust-hyper-tls, rust-tokio,
rust-win-crypto-ng.
2020-12-16 19:13:42 +00:00
|
|
|
("rust-capnp" ,rust-capnp-0.13)
|
|
|
|
("rust-capnp-rpc" ,rust-capnp-rpc-0.13)
|
|
|
|
("rust-capnpc" ,rust-capnpc-0.13)
|
2020-10-17 22:03:45 +00:00
|
|
|
("rust-chrono" ,rust-chrono-0.4) ;; for sqv, sop
|
|
|
|
("rust-clap" ,rust-clap-2) ;; for sqv
|
2020-03-05 22:59:43 +00:00
|
|
|
("rust-colored" ,rust-colored-1.9.1)
|
|
|
|
("rust-crossterm" ,rust-crossterm-0.13)
|
2020-06-22 07:44:40 +00:00
|
|
|
("rust-ctor" ,rust-ctor-0.1)
|
2021-01-29 22:59:25 +00:00
|
|
|
("rust-dirs" ,rust-dirs-2)
|
2020-10-17 22:03:45 +00:00
|
|
|
("rust-dyn-clone" ,rust-dyn-clone-1)
|
|
|
|
("rust-ed25519-dalek" ,rust-ed25519-dalek-1)
|
gnu: sequoia: Update to 1.0.0.
* gnu/packages/sequoia.scm (sequoia): Update to 1.0.0.
[arguments]{cargo-inputs}: Add rust-eax, rust-futures-util,
rust-sha1collisiondetection, rust-socket2. Update rust-capnp, rust-capnp-rpc,
rust-capnpc, rust-futures, rust-http,rust-hyper rust-hyper-tls, rust-tokio,
rust-win-crypto-ng.
2020-12-16 19:13:42 +00:00
|
|
|
("rust-eax" ,rust-eax-0.3)
|
2020-03-05 22:59:43 +00:00
|
|
|
;;("rust-failure" included
|
|
|
|
("rust-filetime" ,rust-filetime-0.2)
|
2020-09-15 05:17:16 +00:00
|
|
|
("rust-flate2" ,rust-flate2-1)
|
2020-03-05 22:59:43 +00:00
|
|
|
("rust-fs2" ,rust-fs2-0.4)
|
gnu: sequoia: Update to 1.0.0.
* gnu/packages/sequoia.scm (sequoia): Update to 1.0.0.
[arguments]{cargo-inputs}: Add rust-eax, rust-futures-util,
rust-sha1collisiondetection, rust-socket2. Update rust-capnp, rust-capnp-rpc,
rust-capnpc, rust-futures, rust-http,rust-hyper rust-hyper-tls, rust-tokio,
rust-win-crypto-ng.
2020-12-16 19:13:42 +00:00
|
|
|
("rust-futures" ,rust-futures-0.3)
|
|
|
|
("rust-futures-util" ,rust-futures-util-0.3)
|
|
|
|
("rust-http" ,rust-http-0.2)
|
|
|
|
("rust-hyper" ,rust-hyper-0.13)
|
|
|
|
("rust-hyper-tls" ,rust-hyper-tls-0.4)
|
2020-06-22 07:44:40 +00:00
|
|
|
("rust-idna" ,rust-idna-0.2)
|
2020-10-17 22:03:45 +00:00
|
|
|
("rust-itertools" ,rust-itertools-0.9) ;; for sq
|
|
|
|
("rust-lalrpop" ,rust-lalrpop-0.19)
|
|
|
|
("rust-lalrpop-util" ,rust-lalrpop-util-0.19)
|
2020-06-22 07:44:40 +00:00
|
|
|
("rust-lazy-static" ,rust-lazy-static-1)
|
2020-03-05 22:59:43 +00:00
|
|
|
("rust-libc" ,rust-libc-0.2)
|
2020-10-17 22:03:45 +00:00
|
|
|
("rust-memsec" ,rust-memsec-0.6)
|
2020-03-05 22:59:43 +00:00
|
|
|
("rust-native-tls" ,rust-native-tls-0.2)
|
2020-06-22 07:44:40 +00:00
|
|
|
("rust-nettle" ,rust-nettle-7)
|
2020-10-17 22:03:45 +00:00
|
|
|
("rust-num-bigint-dig" ,rust-num-bigint-dig-0.6)
|
2020-03-05 22:59:43 +00:00
|
|
|
("rust-parity-tokio-ipc" ,rust-parity-tokio-ipc-0.4)
|
2020-09-14 18:07:34 +00:00
|
|
|
("rust-percent-encoding" ,rust-percent-encoding-2)
|
2020-10-17 22:03:45 +00:00
|
|
|
("rust-prettytable-rs" ,rust-prettytable-rs-0.8) ;; for sq
|
2020-08-03 17:57:56 +00:00
|
|
|
("rust-proc-macro2" ,rust-proc-macro2-1)
|
2020-06-22 07:44:40 +00:00
|
|
|
("rust-quickcheck" ,rust-quickcheck-0.9)
|
|
|
|
("rust-rand" ,rust-rand-0.7)
|
gnu: rust-regex-1.3: Rename to rust-regex-1.
* gnu/packages/crates-io.scm (rust-regex-1.3): Rename to rust-regex-1.
(rust-ansi-term-0.12, rust-bindgen-0.52, rust-bindgen-0.51,
rust-bindgen-0.50, rust-bindgen-0.37, rust-bindgen-0.49, rust-clap-2,
rust-compiletest-rs-0.3, rust-console-0.9, rust-console-0.7,
rust-docopt-1.1, rust-env-logger-0.7, rust-env-logger-0.6,
rust-env-logger-0.5, rust-gimli-0.18, rust-globset-0.4,
rust-grep-cli-0.1, rust-grep-matcher-0.1, rust-grep-regex-0.1,
rust-grep-searcher-0.1, rust-ignore-0.4, rust-lalrpop-0.17,
rust-lalrpop-util-0.17, rust-locale-config-0.3, rust-localeconfig-0.2,
rust-nom-5, rust-nom-4.2, rust-once-cell-1.2, rust-proptest-0.9,
rust-proptest-0.8, rust-pulldown-cmark-0.4, rust-regex-automata-0.1,
rust-rusqlite-0.19, rust-scan-fmt-0.2, rust-syn-1.0, rust-syn-0.15,
rust-ucd-parse-0.1, rust-version-sync-0.8) [arguments]: Adjust accordingly.
* gnu/packages/gnome.scm (librsvg-next)[arguments]: Same.
* gnu/packages/rust-apps.scm (fd, ripgrep, tokei, rust-cargo-c)
[arguments]: Same.
* gnu/packages/sequoia.scm (sequoia)[arguments]: Same.
2020-06-22 07:34:16 +00:00
|
|
|
("rust-regex" ,rust-regex-1)
|
2020-10-17 22:03:45 +00:00
|
|
|
("rust-rusqlite" ,rust-rusqlite-0.24)
|
gnu: sequoia: Update to 1.0.0.
* gnu/packages/sequoia.scm (sequoia): Update to 1.0.0.
[arguments]{cargo-inputs}: Add rust-eax, rust-futures-util,
rust-sha1collisiondetection, rust-socket2. Update rust-capnp, rust-capnp-rpc,
rust-capnpc, rust-futures, rust-http,rust-hyper rust-hyper-tls, rust-tokio,
rust-win-crypto-ng.
2020-12-16 19:13:42 +00:00
|
|
|
("rust-sha1collisiondetection" ,rust-sha1collisiondetection-0.2)
|
|
|
|
("rust-socket2", rust-socket2-0.3)
|
2020-10-17 22:03:45 +00:00
|
|
|
("rust-structopt" ,rust-structopt-0.3) ;; for sop
|
|
|
|
("rust-tempfile" ,rust-tempfile-3) ;; for sq
|
2020-09-14 17:46:19 +00:00
|
|
|
("rust-thiserror" ,rust-thiserror-1)
|
gnu: sequoia: Update to 1.0.0.
* gnu/packages/sequoia.scm (sequoia): Update to 1.0.0.
[arguments]{cargo-inputs}: Add rust-eax, rust-futures-util,
rust-sha1collisiondetection, rust-socket2. Update rust-capnp, rust-capnp-rpc,
rust-capnpc, rust-futures, rust-http,rust-hyper rust-hyper-tls, rust-tokio,
rust-win-crypto-ng.
2020-12-16 19:13:42 +00:00
|
|
|
("rust-tokio" ,rust-tokio-0.2)
|
2020-03-05 22:59:43 +00:00
|
|
|
("rust-tokio-core" ,rust-tokio-core-0.1)
|
2020-06-22 07:44:40 +00:00
|
|
|
("rust-unicode-normalization" ,rust-unicode-normalization-0.1)
|
2020-09-14 18:04:57 +00:00
|
|
|
("rust-url" ,rust-url-2)
|
gnu: sequoia: Update to 1.0.0.
* gnu/packages/sequoia.scm (sequoia): Update to 1.0.0.
[arguments]{cargo-inputs}: Add rust-eax, rust-futures-util,
rust-sha1collisiondetection, rust-socket2. Update rust-capnp, rust-capnp-rpc,
rust-capnpc, rust-futures, rust-http,rust-hyper rust-hyper-tls, rust-tokio,
rust-win-crypto-ng.
2020-12-16 19:13:42 +00:00
|
|
|
("rust-win-crypto-ng" ,rust-win-crypto-ng-0.4)
|
2020-10-17 22:03:45 +00:00
|
|
|
("rust-winapi" ,rust-winapi-0.3)
|
2020-03-05 22:59:43 +00:00
|
|
|
("rust-zbase32" ,rust-zbase32-0.1))
|
|
|
|
#:cargo-development-inputs
|
2020-10-17 22:03:45 +00:00
|
|
|
(("rust-assert-cli" ,rust-assert-cli-0.6) ;; dev-dep for for sq, sqv
|
|
|
|
("rust-bindgen" ,rust-bindgen-0.51) ;; FIXME for nettle-sys and rusqlite
|
|
|
|
;;("rust-lalrpop" ,rust-lalrpop-0.19)
|
|
|
|
("rust-quickcheck" ,rust-quickcheck-0.9)
|
|
|
|
("rust-rand" ,rust-rand-0.7)
|
|
|
|
("rust-rpassword" ,rust-rpassword-5))
|
2020-03-05 22:59:43 +00:00
|
|
|
#:phases
|
|
|
|
(modify-phases %standard-phases
|
|
|
|
;; Run make instead of using the rust build system, as
|
|
|
|
;; suggested by the installation instructions
|
|
|
|
(replace 'build (lambda _ (invoke "make" "build-release") #t))
|
2021-05-01 18:31:53 +00:00
|
|
|
(delete 'package) ;; cargo can't package a multi-crate workspace
|
2020-03-05 22:59:43 +00:00
|
|
|
(replace 'check
|
|
|
|
(lambda* (#:key tests? #:allow-other-keys)
|
|
|
|
(if tests?
|
|
|
|
(invoke "make" "check")
|
|
|
|
#t)))
|
|
|
|
(replace 'install (lambda _ (invoke "make" "install") #t))
|
2021-05-01 18:31:53 +00:00
|
|
|
(add-after 'unpack 'fix-rand-dependency
|
|
|
|
(lambda _
|
|
|
|
(substitute* "ipc/Cargo.toml"
|
|
|
|
;; required: enable rand::rngs::OsRng in rand >= 0.8
|
|
|
|
(("(^rand =.*,) default-features = false(.*)" _ a b)
|
|
|
|
(string-append a " features = [\"getrandom\"]" b)))
|
|
|
|
#t))
|
|
|
|
(add-after 'unpack 'fix-permissions
|
|
|
|
(lambda _
|
|
|
|
(chmod "sq/src/sq-usage.rs" #o644)
|
|
|
|
(chmod "sqv/src/sqv-usage.rs" #o644)
|
|
|
|
#t))
|
2020-10-17 22:03:45 +00:00
|
|
|
(add-after 'unpack 'fix-environment
|
2020-03-05 22:59:43 +00:00
|
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
2020-10-17 22:03:45 +00:00
|
|
|
;; adjust prefix
|
2020-03-05 22:59:43 +00:00
|
|
|
(setenv "PREFIX" (assoc-ref outputs "out"))
|
2020-10-17 22:03:45 +00:00
|
|
|
;; fix install script detection
|
|
|
|
(setenv "INSTALL" "install")
|
2020-03-05 22:59:43 +00:00
|
|
|
#t))
|
|
|
|
(add-after 'unpack 'fix-fo-python-output
|
|
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
|
|
(let ((out (assoc-ref outputs "out"))
|
|
|
|
(pyout (assoc-ref outputs "python")))
|
|
|
|
(substitute* "ffi/lang/python/Makefile"
|
|
|
|
;; adjust prefix for python package
|
|
|
|
(("PREFIX\\s*\\??=.*")
|
|
|
|
(string-append "PREFIX = " pyout "\n"))
|
|
|
|
;; fix rpath to include the main package
|
|
|
|
(("\\WLDFLAGS=" text)
|
|
|
|
(string-append text "'-Wl,-rpath=" out "/lib '"))
|
|
|
|
;; make setuptools install into the prefix, see
|
|
|
|
;; guix/build/python-build-system.scm for explanation
|
|
|
|
(("\\ssetup.py\\s+install\\s")
|
|
|
|
" setup.py install --root=/ --single-version-externally-managed "))
|
|
|
|
#t)))
|
2020-05-10 22:00:47 +00:00
|
|
|
(add-after 'unpack 'fix-pkgconfig-file-substitutes
|
|
|
|
;; preempt Makefiles replacing PREFIX by pwd
|
|
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
|
|
(let ((out (assoc-ref outputs "out")))
|
|
|
|
(substitute* "ffi/sequoia.pc.in"
|
|
|
|
(("PREFIX") out))
|
|
|
|
(substitute* "openpgp-ffi/sequoia-openpgp.pc.in"
|
|
|
|
(("PREFIX") out))
|
|
|
|
#t)))
|
2020-10-17 22:03:45 +00:00
|
|
|
(add-after 'unpack 'keep-SOURCE_DATE_EPOCH
|
|
|
|
(lambda _
|
|
|
|
;; preempt Makefiles replacing SOURCE_DATE_EPOCH
|
|
|
|
(substitute* "Makefile"
|
|
|
|
(("SOURCE_DATE_EPOCH\\s=" line)
|
|
|
|
(string-append "#" line)))
|
|
|
|
#t))
|
2020-03-05 22:59:43 +00:00
|
|
|
(add-after 'unpack 'set-missing-env-vars
|
|
|
|
(lambda* (#:key inputs #:allow-other-keys)
|
|
|
|
;; FIXME: why do we need to set this here?
|
|
|
|
(setenv "LIBCLANG_PATH"
|
|
|
|
(string-append (assoc-ref inputs "clang") "/lib"))
|
2020-06-22 16:59:39 +00:00
|
|
|
#t))
|
|
|
|
(add-after 'unpack 'unpin-deps
|
|
|
|
(lambda _
|
|
|
|
;; As the comment in that file explains, upstream encourages
|
|
|
|
;; unpinning, as the pinned version is only to make sure the crate
|
|
|
|
;; compiles on older versions of rustc
|
2020-10-17 22:03:45 +00:00
|
|
|
(substitute* '("openpgp/Cargo.toml" "sq/Cargo.toml")
|
2020-06-22 16:59:39 +00:00
|
|
|
(("= \"=") "= \""))
|
2020-03-05 22:59:43 +00:00
|
|
|
#t)))))
|
|
|
|
(home-page "https://sequoia-pgp.org")
|
|
|
|
(synopsis "New OpenPGP implementation")
|
|
|
|
(description "Sequoia is a new OpenPGP implementation. It consists of
|
|
|
|
several crates, providing both a low-level and a high-level API for dealing
|
|
|
|
with OpenPGP data.")
|
|
|
|
(license license:gpl2+)))
|