path: root/gnu/packages/valgrind.scm
blob: b50dabf9ca9986f996205e0409ae4091e862a83e (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2022 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2016, 2020, 2022, 2023 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
;;; Copyright © 2022 Denis Carikli <GNUtoo@cyberdimension.org>
;;; Copyright © 2023 Simon Tournier <zimon.toutoune@gmail.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 (gnu packages valgrind)
  #:use-module (srfi srfi-1)
  #:use-module (guix build-system gnu)
  #:use-module (guix download)
  #:use-module (guix gexp)
  #:use-module (guix licenses)
  #:use-module (guix packages)
  #:use-module (guix utils)
  #:use-module (gnu packages)
  #:use-module (gnu packages base)
  #:use-module (gnu packages gdb)
  #:use-module (gnu packages perl))

(define-public valgrind
  (package
    (name "valgrind")
    (version "3.22.0")
    (source (origin
              (method url-fetch)
              (uri (list (string-append "https://sourceware.org/pub/valgrind"
                                        "/valgrind-" version ".tar.bz2")
                         (string-append "ftp://sourceware.org/pub/valgrind"
                                        "/valgrind-" version ".tar.bz2")))
              (sha256
               (base32
                "0k1ddnzxfpbng2sp5r31jjxsmp35g977rx6a8jcp4prcvmddn4f8"))))
    (build-system gnu-build-system)
    (outputs '("doc"                              ;16 MB
               "out"))
    (arguments
     `(,@(if (string-prefix? "powerpc" (or (%current-target-system)
                                           (%current-system)))
           `(#:make-flags '("CFLAGS+=-maltivec"))
           '())
       #:phases
       (modify-phases %standard-phases
         (add-after 'install 'patch-suppression-files
           (lambda* (#:key outputs #:allow-other-keys)
             ;; Don't assume the FHS.
             (let* ((out (assoc-ref outputs "out"))
                    (dir (string-append out "/lib/valgrind")))
               (substitute* (find-files dir "\\.supp$")
                 (("obj:/lib") "obj:*/lib")
                 (("obj:/usr/X11R6/lib") "obj:*/lib")
                 (("obj:/usr/lib") "obj:*/lib")))))
         (add-after 'install 'install-doc
           (lambda* (#:key outputs #:allow-other-keys)
             (let ((orig (format #f "~a/share/doc" (assoc-ref outputs "out")))
                   (dest (format #f "~a/share" (assoc-ref outputs "doc"))))
               (mkdir-p dest)
               (rename-file orig dest)))))))
    (native-inputs
     (list perl))
    (home-page "https://www.valgrind.org/")
    (synopsis "Debugging and profiling tool suite")
    (description
     "Valgrind is an instrumentation framework for building dynamic analysis
tools.  There are Valgrind tools that can automatically detect many memory
management and threading bugs, and profile your programs in detail.  You can
also use Valgrind to build new tools.")
    ;; https://valgrind.org/info/platforms.html
    (supported-systems (fold delete %supported-systems
                             '("i586-gnu" "armhf-linux" "riscv64-linux")))
    (license gpl2+)

    ;; Hide this variant so end users get the "interactive" Valgrind below.
    (properties '((hidden? . #t)))))

(define-public valgrind/interactive
  (package/inherit
   valgrind
   (inputs
    ;; GDB is needed to provide a sane default for `--db-command'.
    (list gdb `(,(canonical-package (libc-for-target)) "debug")))
   (properties '())))
> 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2019, 2020, 2021 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;; Copyright © 2021, 2023 Efraim Flashner <efraim@flashner.co.il>
;;;
;;; 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 build-system trivial)
  #:use-module (guix download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix gexp)
  #:use-module (guix utils)
  #:use-module (gnu packages)
  #:use-module (gnu packages base)  ; glibc
  #:use-module (gnu packages crates-crypto)
  #:use-module (gnu packages crates-io)
  #:use-module (gnu packages crates-tls)
  #:use-module (gnu packages crates-web)
  #:use-module (gnu packages crates-windows)
  #: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 sqlite)
  #:use-module (gnu packages tls))

(define-public rust-sequoia-autocrypt-0.25
  (package
    (name "rust-sequoia-autocrypt")
    (version "0.25.0")
    (source (origin
              (method url-fetch)
              (uri (crate-uri "sequoia-autocrypt" version))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "0796mn8kwrpfc8qzliwyyy62mrg2w0j6ax8929jwrkibvwy2axi2"))))
    (build-system cargo-build-system)
    (arguments
     `(#:features '("sequoia-openpgp/crypto-nettle")
       #:cargo-inputs
       (("rust-base64" ,rust-base64-0.13)
        ("rust-sequoia-openpgp" ,rust-sequoia-openpgp-1))
       #:cargo-development-inputs
       (("rust-sequoia-openpgp" ,rust-sequoia-openpgp-1))))
    (native-inputs
     (list clang pkg-config))
    (inputs
     (list gmp nettle))
    (home-page "https://sequoia-pgp.org/")
    (synopsis "Deal with Autocrypt encoded data")
    (description "This crate implements low-level functionality like encoding
and decoding of Autocrypt headers and setup messages.  Note: Autocrypt is more
than just headers; it requires tight integration with the MUA.")
    (license license:lgpl2.0+)))

(define-public rust-sequoia-cert-store-0.3
  (package
    (name "rust-sequoia-cert-store")
    (version "0.3.2")
    (source (origin
              (method url-fetch)
              (uri (crate-uri "sequoia-cert-store" version))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "0gmkqn2f23i2xwjwmnaj3dx9l4ir74dyylkw1qsxawxd95i8dk02"))))
    (build-system cargo-build-system)
    (arguments
     `(#:features '("sequoia-openpgp/crypto-nettle")
       #:cargo-inputs
       (("rust-anyhow" ,rust-anyhow-1)
        ("rust-crossbeam" ,rust-crossbeam-0.8)
        ("rust-dirs" ,rust-dirs-5)
        ("rust-num-cpus" ,rust-num-cpus-1)
        ("rust-once-cell" ,rust-once-cell-1)
        ("rust-openpgp-cert-d" ,rust-openpgp-cert-d-0.1)
        ("rust-rayon" ,rust-rayon-1)
        ("rust-rusqlite" ,rust-rusqlite-0.29)
        ("rust-sequoia-net" ,rust-sequoia-net-0.27)
        ("rust-sequoia-openpgp" ,rust-sequoia-openpgp-1)
        ("rust-smallvec" ,rust-smallvec-1)
        ("rust-thiserror" ,rust-thiserror-1)
        ("rust-tokio" ,rust-tokio-1))
       #:cargo-development-inputs
       (("rust-sequoia-openpgp" ,rust-sequoia-openpgp-1)
        ("rust-tempfile" ,rust-tempfile-3))))
    (native-inputs
     (list clang pkg-config))
    (inputs
     (list gmp nettle openssl sqlite))
    (home-page "https://sequoia-pgp.org/")
    (synopsis "Certificate database interface")
    (description "This package provides a certificate database interface.")
    (license license:lgpl2.0+)))

(define-public rust-sequoia-ipc-0.30
  (package
    (name "rust-sequoia-ipc")
    (version "0.30.1")
    (source
      (origin
        (method url-fetch)
        (uri (crate-uri "sequoia-ipc" version))
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
          (base32 "1fgqjwaw9rz74y394i3n2a6y2vvy0214daamzswn5ahidhycm3x3"))))
    (build-system cargo-build-system)
    (arguments
     `(#:features '("sequoia-openpgp/crypto-nettle")
       #:cargo-inputs
       (("rust-anyhow" ,rust-anyhow-1)
        ("rust-buffered-reader" ,rust-buffered-reader-1)
        ("rust-capnp-rpc" ,rust-capnp-rpc-0.14)
        ("rust-crossbeam-utils" ,rust-crossbeam-utils-0.8)
        ("rust-ctor" ,rust-ctor-0.1)
        ("rust-dirs" ,rust-dirs-4)
        ("rust-fs2" ,rust-fs2-0.4)
        ("rust-futures" ,rust-futures-0.3)
        ("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-rand" ,rust-rand-0.8)
        ("rust-sequoia-openpgp" ,rust-sequoia-openpgp-1)
        ("rust-socket2" ,rust-socket2-0.4)
        ("rust-tempfile" ,rust-tempfile-3)
        ("rust-thiserror" ,rust-thiserror-1)
        ("rust-tokio" ,rust-tokio-1)
        ("rust-tokio-util" ,rust-tokio-util-0.7)
        ("rust-winapi" ,rust-winapi-0.3))
       #:cargo-development-inputs
       (("rust-clap" ,rust-clap-3)
        ("rust-quickcheck" ,rust-quickcheck-1)
        ("rust-sequoia-openpgp" ,rust-sequoia-openpgp-1)
        ("rust-tokio" ,rust-tokio-1))))
    (native-inputs
     (list clang pkg-config))
    (inputs
     (list nettle))
    (home-page "https://sequoia-pgp.org/")
    (synopsis "Interprocess communication infrastructure for Sequoia")
    (description "Interprocess communication infrastructure for Sequoia")
    (license license:lgpl2.0+)))

(define-public rust-sequoia-net-0.27
  (package
    (name "rust-sequoia-net")
    (version "0.27.0")
    (source (origin
              (method url-fetch)
              (uri (crate-uri "sequoia-net" version))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "0gyk5765hi3s05l64a744f9a4vynfisja92l51az9dpqgfkiw3wn"))))
    (build-system cargo-build-system)
    (arguments
     `(#:features '("sequoia-openpgp/crypto-nettle")
       #:cargo-inputs
       (("rust-anyhow" ,rust-anyhow-1)
        ("rust-base64" ,rust-base64-0.13)
        ("rust-futures-util" ,rust-futures-util-0.3)
        ("rust-http" ,rust-http-0.2)
        ("rust-hyper" ,rust-hyper-0.14)
        ("rust-hyper-tls" ,rust-hyper-tls-0.5)
        ("rust-libc" ,rust-libc-0.2)
        ("rust-native-tls" ,rust-native-tls-0.2)
        ("rust-percent-encoding" ,rust-percent-encoding-2)
        ("rust-sequoia-openpgp" ,rust-sequoia-openpgp-1)
        ("rust-tempfile" ,rust-tempfile-3)
        ("rust-thiserror" ,rust-thiserror-1)
        ("rust-tokio" ,rust-tokio-1)
        ("rust-trust-dns-client" ,rust-trust-dns-client-0.22)
        ("rust-trust-dns-resolver" ,rust-trust-dns-resolver-0.22)
        ("rust-url" ,rust-url-2)
        ("rust-zbase32" ,rust-zbase32-0.1))
       #:cargo-development-inputs
       (("rust-hyper" ,rust-hyper-0.14)
        ("rust-rand" ,rust-rand-0.8)
        ("rust-sequoia-openpgp" ,rust-sequoia-openpgp-1))))
    (native-inputs
     (list clang pkg-config))
    (inputs
     (list gmp nettle openssl))
    (home-page "https://sequoia-pgp.org/")
    (synopsis "Discover and publish OpenPGP certificates over the network")
    (description "This package provides a crate to access keyservers using the
HKP protocol, and searching and publishing Web Key Directories.")
    (license license:lgpl2.0+)))

(define-public rust-sequoia-openpgp-1
  (package
    (name "rust-sequoia-openpgp")
    (version "1.16.0")
    (source
      (origin
        (method url-fetch)
        (uri (crate-uri "sequoia-openpgp" version))
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
         (base32 "1z0xl7hnm1p51pyhwdqyzcnl2dhzfjnvssz7hi15ps1hk4zzzvrh"))))
    (build-system cargo-build-system)
    (native-inputs
     (list clang pkg-config))
    (inputs
     (list gmp nettle))
    (arguments
     `(#:features '("crypto-nettle")
       #:cargo-test-flags
       (list "--release" "--"
             ;; TODO: Figure out how this test is supposed to fail.
             "--skip=parse::test::panic_on_short_zip")
       #:cargo-inputs
       (("rust-aes" ,rust-aes-0.8)
        ("rust-anyhow" ,rust-anyhow-1)
        ("rust-base64" ,rust-base64-0.21)
        ("rust-block-padding" ,rust-block-padding-0.3)
        ("rust-blowfish" ,rust-blowfish-0.9)
        ("rust-botan" ,rust-botan-0.10)
        ("rust-buffered-reader" ,rust-buffered-reader-1)
        ("rust-bzip2" ,rust-bzip2-0.4)
        ("rust-cast5" ,rust-cast5-0.11)
        ("rust-cfb-mode" ,rust-cfb-mode-0.8)
        ("rust-chrono" ,rust-chrono-0.4)
        ("rust-cipher" ,rust-cipher-0.4)
        ("rust-des" ,rust-des-0.8)
        ("rust-digest" ,rust-digest-0.10)
        ("rust-dyn-clone" ,rust-dyn-clone-1)
        ("rust-eax" ,rust-eax-0.5)
        ("rust-ecb" ,rust-ecb-0.1)
        ("rust-ecdsa" ,rust-ecdsa-0.16)
        ("rust-ed25519" ,rust-ed25519-1)
        ("rust-ed25519-dalek" ,rust-ed25519-dalek-1)
        ("rust-flate2" ,rust-flate2-1)
        ("rust-generic-array" ,rust-generic-array-0.14)
        ("rust-getrandom" ,rust-getrandom-0.2)
        ("rust-idea" ,rust-idea-0.5)
        ("rust-idna" ,rust-idna-0.3)
        ("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-md-5" ,rust-md-5-0.10)
        ("rust-memsec" ,rust-memsec-0.6)
        ("rust-nettle" ,rust-nettle-7)
        ("rust-num-bigint-dig" ,rust-num-bigint-dig-0.8)
        ("rust-once-cell" ,rust-once-cell-1)
        ("rust-openssl" ,rust-openssl-0.10)
        ("rust-openssl-sys" ,rust-openssl-sys-0.9)
        ("rust-p256" ,rust-p256-0.13)
        ("rust-rand" ,rust-rand-0.7)
        ("rust-rand" ,rust-rand-0.7)
        ("rust-rand" ,rust-rand-0.8)
        ("rust-rand-core" ,rust-rand-core-0.6)
        ("rust-regex" ,rust-regex-1)
        ("rust-regex-syntax" ,rust-regex-syntax-0.6)
        ("rust-ripemd" ,rust-ripemd-0.1)
        ("rust-rsa" ,rust-rsa-0.9)
        ("rust-sha-1" ,rust-sha-1-0.10)
        ("rust-sha1collisiondetection" ,rust-sha1collisiondetection-0.2)
        ("rust-sha2" ,rust-sha2-0.10)
        ("rust-thiserror" ,rust-thiserror-1)
        ("rust-twofish" ,rust-twofish-0.7)
        ("rust-typenum" ,rust-typenum-1)
        ("rust-win-crypto-ng" ,rust-win-crypto-ng-0.5)
        ("rust-winapi" ,rust-winapi-0.3)
        ("rust-x25519-dalek-ng" ,rust-x25519-dalek-ng-1)
        ("rust-xxhash-rust" ,rust-xxhash-rust-0.8))
       #:cargo-development-inputs
       (("rust-criterion" ,rust-criterion-0.4)
        ("rust-quickcheck" ,rust-quickcheck-1)
        ("rust-rand" ,rust-rand-0.8)
        ("rust-rpassword" ,rust-rpassword-6))))
    (home-page "https://sequoia-pgp.org/")
    (synopsis "OpenPGP data types and associated machinery")
    (description "This crate aims to provide a complete implementation of
OpenPGP as defined by RFC 4880 as well as some extensions (e.g., RFC 6637,
which describes ECC cryptography) for OpenPGP.  This includes support for
unbuffered message processing.

A few features that the OpenPGP community considers to be deprecated (e.g.,
version 3 compatibility) have been left out.  The developers have also updated
some OpenPGP defaults to avoid foot guns (e.g., they selected modern algorithm
defaults).

This Guix package is built to use the nettle cryptographic library.")
    (license license:lgpl2.0+)))

(define-public rust-sequoia-openpgp-0.9
  (package
    (inherit rust-sequoia-openpgp-1)
    (name "rust-sequoia-openpgp")
    (version "0.9.0")
    (source
     (origin
       (method url-fetch)
       (uri (crate-uri "sequoia-openpgp" version))
       (file-name (string-append name "-" version ".tar.gz"))
       (sha256
        (base32 "007h2pi7lcph5jf5bxjydm7hjwjai33yk6dic3cxknki22lxlkfw"))))
    (build-system cargo-build-system)
    (arguments
     `(#:skip-build? #t
       #:cargo-inputs
       (("rust-base64" ,rust-base64-0.9)
        ("rust-buffered-reader" ,rust-buffered-reader-0.9)
        ("rust-bzip2" ,rust-bzip2-0.3)
        ("rust-failure" ,rust-failure-0.1)
        ("rust-flate2" ,rust-flate2-1)
        ("rust-idna" ,rust-idna-0.1)
        ("rust-lalrpop" ,rust-lalrpop-0.17)
        ("rust-lalrpop-util" ,rust-lalrpop-util-0.17)
        ("rust-lazy-static" ,rust-lazy-static-1)
        ("rust-memsec" ,rust-memsec-0.5)
        ("rust-nettle" ,rust-nettle-5)
        ("rust-quickcheck" ,rust-quickcheck-0.8)
        ("rust-rand" ,rust-rand-0.6)
        ("rust-sequoia-rfc2822" ,rust-sequoia-rfc2822-0.9)
        ("rust-time" ,rust-time-0.1))))))

(define-public rust-sequoia-policy-config-0.6
  (package
    (name "rust-sequoia-policy-config")
    (version "0.6.0")
    (source (origin
              (method url-fetch)
              (uri (crate-uri "sequoia-policy-config" version))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "0x42h22kng4dsbfr0a6zdf2j9bcq14r0yr6xdw6rrggj139lazbm"))))
    (build-system cargo-build-system)
    (arguments
     `(#:features '("sequoia-openpgp/crypto-nettle")
       #:cargo-inputs
       (("rust-anyhow" ,rust-anyhow-1)
        ("rust-chrono" ,rust-chrono-0.4)
        ("rust-sequoia-openpgp" ,rust-sequoia-openpgp-1)
        ("rust-serde" ,rust-serde-1)
        ("rust-thiserror" ,rust-thiserror-1)
        ("rust-toml" ,rust-toml-0.5))
       #:cargo-development-inputs
       (("rust-assert-cmd" ,rust-assert-cmd-2)
        ("rust-lazy-static" ,rust-lazy-static-1)
        ("rust-sequoia-openpgp" ,rust-sequoia-openpgp-1))))
    (native-inputs
     (list clang pkg-config))
    (inputs
     (list gmp nettle))
    (home-page "https://sequoia-pgp.org/")
    (synopsis "Configure Sequoia using a configuration file")
    (description "Configure Sequoia using a configuration file.")
    (license license:lgpl2.0+)))

(define-public rust-sequoia-rfc2822-0.9
  (package
    (name "rust-sequoia-rfc2822")
    (version "0.9.0")
    (source
     (origin
       (method url-fetch)
       (uri (crate-uri "sequoia-rfc2822" version))
       (file-name (string-append name "-" version ".tar.gz"))
       (sha256
        (base32 "1aj34i6862718m162rqfv69fkmvdw063s6ws7hbp42n73gb08p5c"))))
    (build-system cargo-build-system)
    (arguments
     `(#:skip-build? #t
       #:cargo-inputs
       (("rust-failure" ,rust-failure-0.1)
        ("rust-lalrpop" ,rust-lalrpop-0.17)
        ("rust-lalrpop-util" ,rust-lalrpop-util-0.17))))
    (home-page "https://sequoia-pgp.org/")
    (synopsis "RFC 2822 name-addr parser")
    (description "Currently, this crate only recognizes the RFC 2822 name-addr
and addr-spec productions, i.e., things of the form: @code{Name (Comment)
<email@@example.org>} and @code{email@@example.org}

Although the above appear simple to parse, RFC 2822's whitespace and comment
rules are rather complex.  This crate implements the whole grammar." )
    (license license:gpl3)))

(define-public rust-sequoia-wot-0.8
  (package
    (name "rust-sequoia-wot")
    (version "0.8.1")
    (source (origin
              (method url-fetch)
              (uri (crate-uri "sequoia-wot" version))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "0rcp7ndjpdd4dkryhkkhakc8axbj93c1gr9qxxksdvrik803alfg"))))
    (build-system cargo-build-system)
    (arguments
     `(#:features '("sequoia-openpgp/crypto-nettle")
       #:cargo-test-flags
       (list "--release" "--"
             ;; Not all files included.
             "--skip=gpg_trust_roots")
       #:cargo-inputs
       (("rust-anyhow" ,rust-anyhow-1)
        ("rust-chrono" ,rust-chrono-0.4)
        ("rust-clap" ,rust-clap-4)
        ("rust-clap-complete" ,rust-clap-complete-4)
        ("rust-clap-mangen" ,rust-clap-mangen-0.2)
        ("rust-crossbeam" ,rust-crossbeam-0.8)
        ("rust-dot-writer" ,rust-dot-writer-0.1)
        ("rust-enumber" ,rust-enumber-0.3)
        ("rust-lazy-static" ,rust-lazy-static-1)
        ("rust-num-cpus" ,rust-num-cpus-1)
        ("rust-openpgp-cert-d" ,rust-openpgp-cert-d-0.1)
        ("rust-sequoia-cert-store" ,rust-sequoia-cert-store-0.3)
        ("rust-sequoia-openpgp" ,rust-sequoia-openpgp-1)
        ("rust-sequoia-policy-config" ,rust-sequoia-policy-config-0.6)
        ("rust-thiserror" ,rust-thiserror-1)
        ("rust-tokio" ,rust-tokio-1))
       #:cargo-development-inputs
       (("rust-assert-cmd" ,rust-assert-cmd-2)
        ("rust-predicates" ,rust-predicates-2)
        ("rust-quickcheck" ,rust-quickcheck-1)
        ("rust-sequoia-openpgp" ,rust-sequoia-openpgp-1)
        ("rust-tempfile" ,rust-tempfile-3))))
    (inputs
     (list nettle openssl sqlite))
    (native-inputs
     (list clang pkg-config))
    (home-page "https://sequoia-pgp.org/")
    (synopsis "Implementation of OpenPGP's web of trust")
    (description "An implementation of OpenPGP's web of trust.")
    (license license:lgpl2.0+)))

(define-public sequoia-sq
  (package
    (name "sequoia-sq")
    (version "0.30.0")
    (source
      (origin
        (method url-fetch)
        (uri (crate-uri "sequoia-sq" version))
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
          (base32 "0l3mlhvh93b8s1853gyzzfh1dznjdhbsbyxxcm3bbyxmkyr74wkd"))))
    (build-system cargo-build-system)
    (inputs
     (list nettle openssl sqlite))
    (native-inputs
     (list clang pkg-config))
    (arguments
     `(#:tests? #f  ; `(dyn std::fmt::Display + 'static)` cannot be sent between threads safely
       #:install-source? #f
       #:cargo-inputs
       (("rust-anyhow" ,rust-anyhow-1)
        ("rust-buffered-reader" ,rust-buffered-reader-1)
        ("rust-cfg-if" ,rust-cfg-if-1)
        ("rust-chrono" ,rust-chrono-0.4)
        ("rust-clap" ,rust-clap-4)
        ("rust-clap-complete" ,rust-clap-complete-4)
        ("rust-clap-mangen" ,rust-clap-mangen-0.2)
        ("rust-dirs" ,rust-dirs-5)
        ("rust-dot-writer" ,rust-dot-writer-0.1)
        ("rust-itertools" ,rust-itertools-0.10)
        ("rust-rpassword" ,rust-rpassword-6)
        ("rust-sequoia-autocrypt" ,rust-sequoia-autocrypt-0.25)
        ("rust-sequoia-cert-store" ,rust-sequoia-cert-store-0.3)
        ("rust-sequoia-net" ,rust-sequoia-net-0.27)
        ("rust-sequoia-openpgp" ,rust-sequoia-openpgp-1)
        ("rust-sequoia-wot" ,rust-sequoia-wot-0.8)
        ("rust-serde" ,rust-serde-1)
        ("rust-serde-json" ,rust-serde-json-1)
        ("rust-subplot-build" ,rust-subplot-build-0.7)
        ("rust-tempfile" ,rust-tempfile-3)
        ("rust-term-size" ,rust-term-size-0.3)
        ("rust-tokio" ,rust-tokio-1))
       #:cargo-development-inputs
       (("rust-assert-cmd" ,rust-assert-cmd-2)
        ("rust-fehler" ,rust-fehler-1)
        ("rust-predicates" ,rust-predicates-2)
        ("rust-subplotlib" ,rust-subplotlib-0.7))))
    (home-page "https://sequoia-pgp.org/")
    (synopsis "Command-line frontend for Sequoia OpenPGP")
    (description "This package provides the command-line frontend for Sequoia
OpenPGP.

This Guix package is built to use the nettle cryptographic library.")
    (license license:lgpl2.0+)))

(define-public sequoia-sqv
  (package
    (name "sequoia-sqv")
    (version "1.1.0")
    (source
      (origin
        (method url-fetch)
        (uri (crate-uri "sequoia-sqv" version))
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
          (base32 "0vzqahx7dk1wh2vp7lbzjgah8v7fqpvdf0dq0dydi9695ffm99lc"))))
    (build-system cargo-build-system)
    (inputs
     (list nettle openssl))
    (native-inputs
     (list clang pkg-config))
    (arguments
     `(#:install-source? #f
       #:cargo-inputs
       (("rust-anyhow" ,rust-anyhow-1)
        ("rust-chrono" ,rust-chrono-0.4)
        ("rust-clap" ,rust-clap-2)
        ("rust-sequoia-openpgp" ,rust-sequoia-openpgp-1))
       #:cargo-development-inputs
       (("rust-assert-cli" ,rust-assert-cli-0.6))))
    (home-page "https://sequoia-pgp.org/")
    (synopsis "Simple OpenPGP signature verification program")
    (description "@code{sqv} verifies detached OpenPGP signatures.  It is a
replacement for @code{gpgv}.  Unlike @code{gpgv}, it can take additional
constraints on the signature into account.

This Guix package is built to use the nettle cryptographic library.")
    (license license:lgpl2.0+)))

(define-public sequoia-wot
  (package
    (inherit rust-sequoia-wot-0.8)
    (name "sequoia-wot")
    (arguments
     (substitute-keyword-arguments (package-arguments rust-sequoia-wot-0.8)
       ((#:install-source? _ #t) #f)
       ((#:phases phases '%standard-phases)
        `(modify-phases ,phases
           (add-after 'install 'install-more
             (lambda* (#:key outputs #:allow-other-keys)
               (let* ((out   (assoc-ref outputs "out"))
                      (share (string-append out "/share"))
                      (man1  (string-append share "/man/man1")))
                 (for-each (lambda (file)
                             (install-file file man1))
                           (find-files "target/release" "\\.1$"))
                 ;; TODO: Install _sq-wot.ps1, sq-wot.elv
                 (mkdir-p (string-append out "/etc/bash_completion.d"))
                 (mkdir-p (string-append share "/fish/vendor_completions.d"))
                 (copy-file (car (find-files "target/release" "sq-wot.bash"))
                            (string-append out "/etc/bash_completion.d/sq-wot"))
                 (copy-file (car (find-files "target/release" "sq-wot.fish"))
                            (string-append
                              share "/fish/vendor_completions.d/sq-wot.fish"))
                 (install-file (car (find-files "target/release" "_sq-wot"))
                               (string-append
                                 share "/zsh/site-functions")))))))))
    (description "An implementation of OpenPGP's web of trust.

This Guix package is built to use the nettle cryptographic library.")))

;;

(define-public sequoia
  (package
    (name "sequoia")
    (version "1.16.0")
    (source #f)
    (build-system trivial-build-system)
    (arguments
     (list
      #:modules '((guix build utils)
                  (guix build union)
                  (guix build gnu-build-system)
                  (guix build gremlin)
                  (guix elf))
      #:builder
      #~(begin
          (use-modules (guix build utils)
                       (guix build union)
                       (guix build gnu-build-system)
                       (ice-9 match))
          (let ((make-dynamic-linker-cache
                 (assoc-ref %standard-phases 'make-dynamic-linker-cache))
                (ld.so.cache
                 (string-append #$output "/etc/ld.so.cache")))
            (match %build-inputs
                   (((names . directories) ...)
                    (union-build #$output directories)))
            (delete-file ld.so.cache)
            (setenv "PATH"
                    (string-append (getenv "PATH") ":" #$glibc "/sbin"))
            (make-dynamic-linker-cache #:outputs %outputs)))))
    (inputs
     (list ;glibc ;; for ldconfig in make-dynamic-linker-cache
           sequoia-sq
           sequoia-sqv
           sequoia-wot))
    (home-page "https://sequoia-pgp.org")
    (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+)))