gnu: sequoia: Change into a meta-package and update to 1.6.0.

* gnu/packages/sequoia.scm (sequoia): Update to 1.6.0.
  Change into a meta-package for all sequoia related binaries.
  [source, native-inputs]: Remove.
  [build-system]: Use trivial-build-system.
  [inputs]: Replace with list of packages to be merged.
  [arguments]: Replace by a trivial build step.
  [synopsis, description]: Adopt to being a meta-package.
  [license]: Adjust to license change of project.
This commit is contained in:
Hartmut Goebel 2021-06-17 09:34:26 +02:00
parent e057383848
commit 73168dbdea
No known key found for this signature in database
GPG key ID: 634A8DFFD3F631DF

View file

@ -19,6 +19,7 @@
(define-module (gnu packages sequoia)
#:use-module (guix build-system cargo)
#:use-module (guix build-system trivial)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module ((guix licenses) #:prefix license:)
@ -26,6 +27,7 @@ (define-module (gnu packages sequoia)
#:use-module (guix gexp)
#:use-module (guix utils)
#:use-module (gnu packages)
#:use-module (gnu packages base) ; glibc
#:use-module (gnu packages check) ;; python-pytest
#:use-module (gnu packages crates-io)
#:use-module (gnu packages libffi) ;; python-cffi
@ -36,8 +38,6 @@ (define-module (gnu packages sequoia)
#:use-module (gnu packages python)
#:use-module (gnu packages python-xyz) ;; python-setuptools
#:use-module (gnu packages rust)
#:use-module (gnu packages serialization)
#:use-module (gnu packages sqlite)
#:use-module (gnu packages tls))
(define-public rust-sequoia-autocrypt-0.23
@ -456,176 +456,40 @@ (define-public libsequoia
(define-public sequoia
(package
(name "sequoia")
(version "1.1.0")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://gitlab.com/sequoia-pgp/sequoia.git")
(commit (string-append "openpgp/v" version))))
(sha256
(base32 "0knkm0nw1h4ww51vks4jnnp1yc45llfi7j0i70f6vf2bcknnbmci"))
(file-name (git-file-name name version))))
(build-system cargo-build-system)
(version "1.6.0")
(source #f)
(build-system trivial-build-system)
(outputs '("out" "python"))
(native-inputs
(list clang pkg-config python-pytest python-pytest-runner
python-wrapper))
(inputs
(list capnproto
gmp
nettle
openssl
python
python-cffi
sqlite))
(list glibc ;; for ldconfig in make-dynamic-linker-cache
libsequoia
`(,libsequoia "python")
sequoia-sq
sequoia-sqv))
(arguments
`(#:tests? #f ;; building the tests requires 9.7GB total
#:rust ,rust
#:cargo-inputs
(("rust-anyhow" ,rust-anyhow-1)
("rust-backtrace" ,rust-backtrace-0.3)
("rust-base64" ,rust-base64-0.13)
;;("rust-buffered-reader" included
("rust-bzip2" ,rust-bzip2-0.4)
("rust-capnp" ,rust-capnp-0.13)
("rust-capnp-rpc" ,rust-capnp-rpc-0.13)
("rust-capnpc" ,rust-capnpc-0.13)
("rust-chrono" ,rust-chrono-0.4) ;; for sqv, sop
("rust-clap" ,rust-clap-2) ;; for sqv
("rust-colored" ,rust-colored-1.9.1)
("rust-crossterm" ,rust-crossterm-0.13)
("rust-ctor" ,rust-ctor-0.1)
("rust-dirs" ,rust-dirs-2)
("rust-dyn-clone" ,rust-dyn-clone-1)
("rust-ed25519-dalek" ,rust-ed25519-dalek-1)
("rust-eax" ,rust-eax-0.3)
;;("rust-failure" included
("rust-filetime" ,rust-filetime-0.2)
("rust-flate2" ,rust-flate2-1)
("rust-fs2" ,rust-fs2-0.4)
("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)
("rust-idna" ,rust-idna-0.2)
("rust-itertools" ,rust-itertools-0.9) ;; for sq
("rust-lalrpop" ,rust-lalrpop-0.19)
("rust-lalrpop-util" ,rust-lalrpop-util-0.19)
("rust-lazy-static" ,rust-lazy-static-1)
("rust-libc" ,rust-libc-0.2)
("rust-memsec" ,rust-memsec-0.6)
("rust-native-tls" ,rust-native-tls-0.2)
("rust-nettle" ,rust-nettle-7)
("rust-num-bigint-dig" ,rust-num-bigint-dig-0.6)
("rust-parity-tokio-ipc" ,rust-parity-tokio-ipc-0.4)
("rust-percent-encoding" ,rust-percent-encoding-2)
("rust-prettytable-rs" ,rust-prettytable-rs-0.8) ;; for sq
("rust-proc-macro2" ,rust-proc-macro2-1)
("rust-quickcheck" ,rust-quickcheck-0.9)
("rust-rand" ,rust-rand-0.7)
("rust-regex" ,rust-regex-1)
("rust-rusqlite" ,rust-rusqlite-0.24)
("rust-sha1collisiondetection" ,rust-sha1collisiondetection-0.2)
("rust-socket2", rust-socket2-0.3)
("rust-structopt" ,rust-structopt-0.3) ;; for sop
("rust-tempfile" ,rust-tempfile-3) ;; for sq
("rust-thiserror" ,rust-thiserror-1)
("rust-tokio" ,rust-tokio-0.2)
("rust-tokio-core" ,rust-tokio-core-0.1)
("rust-unicode-normalization" ,rust-unicode-normalization-0.1)
("rust-url" ,rust-url-2)
("rust-win-crypto-ng" ,rust-win-crypto-ng-0.4)
("rust-winapi" ,rust-winapi-0.3)
("rust-zbase32" ,rust-zbase32-0.1))
#:cargo-development-inputs
(("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))
#: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))
(delete 'package) ;; cargo can't package a multi-crate workspace
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(if tests?
(invoke "make" "check")
#t)))
(replace 'install (lambda _ (invoke "make" "install") #t))
(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))
(add-after 'unpack 'fix-environment
(lambda* (#:key outputs #:allow-other-keys)
;; adjust prefix
(setenv "PREFIX" (assoc-ref outputs "out"))
;; fix install script detection
(setenv "INSTALL" "install")
#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)))
(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)))
(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))
(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"))
#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
(substitute* '("openpgp/Cargo.toml" "sq/Cargo.toml")
(("= \"=") "= \""))
#t)))))
(list
#:modules '((guix build utils) (guix build gnu-build-system)
(guix build gremlin) (guix elf))
#:builder
#~(begin
(use-modules (guix build utils) (guix build gnu-build-system))
(let ((make-dynamic-linker-cache
(assoc-ref %standard-phases 'make-dynamic-linker-cache))
(ld.so.cache
(string-append #$output "/etc/ld.so.cache")))
(copy-recursively #$libsequoia #$output)
(copy-recursively #$sequoia-sq #$output)
(delete-file ld.so.cache)
(copy-recursively #$sequoia-sqv #$output)
(delete-file ld.so.cache)
(copy-recursively #$libsequoia:python #$output:python)
(setenv "PATH"
(string-append (getenv "PATH") ":" #$glibc "/sbin"))
(make-dynamic-linker-cache #:outputs %outputs)))))
(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+)))
(synopsis "New OpenPGP implementation (meta-package)")
(description "Sequoia is a new OpenPGP implementation, written in Rust,
consisting of several Rust crates/packages. This Guix meta-package combines
these packages into a single one for convenience. Anyhow, you should not
depend other packages on this one avoid excessive compile-times for users.")
(license license:lgpl2.0+)))