summary refs log tree commit diff
path: root/gnu/packages/gnupg.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/gnupg.scm')
-rw-r--r--gnu/packages/gnupg.scm124
1 files changed, 81 insertions, 43 deletions
diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm
index 348724e8fb..ddfc6dee69 100644
--- a/gnu/packages/gnupg.scm
+++ b/gnu/packages/gnupg.scm
@@ -18,6 +18,7 @@
 ;;; Copyright © 2018 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2020 Fredrik Salomonsson <plattfot@posteo.net>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
 ;;; Copyright © 2021 Nikita Domnitskii <nikita@domnitskii.me>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -80,13 +81,14 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
+  #:use-module (ice-9 match)
   #:use-module (guix build-system meson)
   #:use-module (srfi srfi-1))
 
 (define-public libgpg-error
   (package
     (name "libgpg-error")
-    (version "1.37")
+    (version "1.42")
     (source
      (origin
       (method url-fetch)
@@ -94,32 +96,48 @@
                           version ".tar.bz2"))
       (sha256
        (base32
-        "0qwpx8mbc2l421a22l0l1hpzkip9jng06bbzgxwpkkvk5bvnybdk"))))
+        "08syj8mlarww8mh8x3s0x6hjqbnxp2lkg3hab57qqpv1dh7yf1zw"))))
     (build-system gnu-build-system)
     (arguments
      (if (%current-target-system)
-         `(#:modules ((ice-9 match)
-                      (guix build gnu-build-system)
+         `(#:modules ((guix build gnu-build-system)
                       (guix build utils))
            #:phases
            (modify-phases %standard-phases
+             ;; If this is left out, some generated header
+             ;; files will be sprinkled with ‘\c’, which
+             ;; the compiler won't like.
+             (add-after 'unpack 'fix-gen-lock-obj.sh
+               (lambda _
+                 (substitute* "src/gen-lock-obj.sh"
+                   (("if test -n `echo -n`") "if ! test -n `echo -n`"))))
              ;; When cross-compiling, some platform specific properties cannot
              ;; be detected. Create a symlink to the appropriate platform
-             ;; file. See Cross-Compiling section at:
+             ;; file if required. Note that these platform files depend on
+             ;; both the operating system and architecture!
+             ;;
+             ;; See Cross-Compiling section at:
              ;; https://github.com/gpg/libgpg-error/blob/master/README
              (add-after 'unpack 'cross-symlinks
-               (lambda* (#:key target inputs #:allow-other-keys)
-                 (let ((triplet
-                        (match (string-take target
-                                            (string-index target #\-))
-                          ("armhf" "arm-unknown-linux-gnueabi")
-                          ("mips64el" "mips-unknown-linux-gnu")
-                          (x
-                           (string-append x "-unknown-linux-gnu")))))
-                   (symlink
-                    (string-append "lock-obj-pub." triplet ".h")
-                    "src/syscfg/lock-obj-pub.linux-gnu.h"))
-                 #t))))
+               (lambda _
+                 (define (link triplet source)
+                   (symlink (string-append "lock-obj-pub." triplet ".h")
+                            (string-append "src/syscfg/lock-obj-pub."
+                                           source ".h")))
+                 ,(let* ((target (%current-target-system))
+                         (architecture
+                          (string-take target (string-index target #\-))))
+                    (cond ((target-linux? target)
+                           (match architecture
+                             ("armhf"
+                              `(link "arm-unknown-linux-gnueabi" "linux-gnu"))
+                             ("mips64el"
+                              `(link "mips-unknown-linux-gnu" "linux-gnu"))
+                             ;; Don't always link to the "linux-gnu"
+                             ;; configuration, as this is not correct for
+                             ;; all architectures.
+                             (_ #t)))
+                          (#t #t)))))))
          '()))
     (native-inputs `(("gettext" ,gettext-minimal)))
     (home-page "https://gnupg.org")
@@ -136,14 +154,14 @@ Daemon and possibly more in the future.")
 (define-public libgcrypt
   (package
     (name "libgcrypt")
-    (version "1.8.5")
+    (version "1.8.8")
     (source (origin
              (method url-fetch)
              (uri (string-append "mirror://gnupg/libgcrypt/libgcrypt-"
                                  version ".tar.bz2"))
              (sha256
               (base32
-                "1hvsazms1bfd769q0ngl0r9g5i4m9mpz9jmvvrdzyzk3rfa2ljiv"))))
+               "1xasrh9zxhgj2n5n8dvpzbwn1mzpmlzy270xhbq2gl8xk2xy4pc9"))))
     (build-system gnu-build-system)
     (propagated-inputs
      `(("libgpg-error-host" ,libgpg-error)))
@@ -175,7 +193,7 @@ generation.")
 (define-public libassuan
   (package
     (name "libassuan")
-    (version "2.5.4")
+    (version "2.5.5")
     (source
      (origin
       (method url-fetch)
@@ -183,7 +201,7 @@ generation.")
                           version ".tar.bz2"))
       (sha256
        (base32
-        "1w7vnnycq4z7gf4bk38pi4hrb8qrrzgfpz3cd7frwldxnfbfx060"))))
+        "1r1lvcp67gn5lfrj1g388sd77ca6qwnmxndirdysd71gk362z34f"))))
     (build-system gnu-build-system)
     (propagated-inputs
      `(("libgpg-error" ,libgpg-error)
@@ -203,7 +221,7 @@ provided.")
 (define-public libksba
   (package
     (name "libksba")
-    (version "1.5.0")
+    (version "1.6.0")
     (source
      (origin
       (method url-fetch)
@@ -212,7 +230,7 @@ provided.")
             version ".tar.bz2"))
       (sha256
        (base32
-        "1fm0mf3wq9fmyi1rmc1vk2fafn6liiw2mgxml3g7ybbb44lz2jmf"))))
+        "12x40y9ihs8nw2xs2y2vjfw90mhikbm5rvabma0dh5frybk87mns"))))
     (build-system gnu-build-system)
     (propagated-inputs
      `(("libgpg-error" ,libgpg-error)))
@@ -262,7 +280,7 @@ compatible to GNU Pth.")
 (define-public gnupg
   (package
     (name "gnupg")
-    (version "2.2.29")
+    (version "2.2.30")
     (source (origin
               (method url-fetch)
               (uri (string-append "mirror://gnupg/gnupg/gnupg-" version
@@ -270,7 +288,7 @@ compatible to GNU Pth.")
               (patches (search-patches "gnupg-default-pinentry.patch"))
               (sha256
                (base32
-                "1j8cpp08zlz9a9n4g9z6352m1bvl369r94p4pjg8z0948pdprl1r"))))
+                "1111ry31gaxv76miqsy6l0kwxwlx8sz0jk41jhyrjwx649p6sqyc"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("pkg-config" ,pkg-config)))
@@ -299,14 +317,12 @@ compatible to GNU Pth.")
             (substitute* "scd/scdaemon.c"
               (("\"(libpcsclite\\.so[^\"]*)\"" _ name)
                (string-append "\"" (assoc-ref inputs "pcsc-lite")
-                              "/lib/" name "\"")))
-            #t))
+                              "/lib/" name "\"")))))
         (add-after 'build 'patch-scheme-tests
           (lambda _
             (substitute* (find-files "tests" ".\\.scm$")
               (("/usr/bin/env gpgscm")
-               (string-append (getcwd) "/tests/gpgscm/gpgscm")))
-            #t))
+               (string-append (getcwd) "/tests/gpgscm/gpgscm")))))
         (add-before 'build 'patch-test-paths
           (lambda _
             (substitute* '("tests/inittests"
@@ -318,8 +334,7 @@ compatible to GNU Pth.")
             (substitute* "common/t-exectool.c"
               (("/bin/cat") (which "cat"))
               (("/bin/true") (which "true"))
-              (("/bin/false") (which "false")))
-            #t)))))
+              (("/bin/false") (which "false"))))))))
     (home-page "https://gnupg.org/")
     (synopsis "GNU Privacy Guard")
     (description
@@ -333,6 +348,25 @@ libskba (working with X.509 certificates and CMS data).")
     (properties '((ftp-server . "ftp.gnupg.org")
                   (ftp-directory . "/gcrypt/gnupg")))))
 
+(define-public gnupg-2.2.32
+  (package
+    (inherit gnupg)
+    (version "2.2.32")
+
+    ;; Hide this version because packages like 'emacs-pinentry' propagate the
+    ;; default GnuPG and "guix install gnupg emacs-pinentry" would fail with a
+    ;; collision error.
+    (properties `((hidden? . #t)
+                  ,@(package-properties gnupg)))
+
+    (source (origin
+              (inherit (package-source gnupg))
+              (uri (string-append "mirror://gnupg/gnupg/gnupg-" version
+                                  ".tar.bz2"))
+              (sha256
+               (base32
+                "0506gv54z10c96z5821z9p0ksibk1pfilsmag39ffqrcz0sinmxj"))))))
+
 (define-public gnupg-1
   (package (inherit gnupg)
     (version "1.4.23")
@@ -342,7 +376,8 @@ libskba (working with X.509 certificates and CMS data).")
                                   ".tar.bz2"))
               (sha256
                (base32
-                "1fkq4sqldvf6a25mm2qz95swv1qjg464736091w51djiwqbjyin9"))))
+                "1fkq4sqldvf6a25mm2qz95swv1qjg464736091w51djiwqbjyin9"))
+              (patches (search-patches "gnupg-1-build-with-gcc10.patch"))))
     (native-inputs '())
     (inputs
      `(("zlib" ,zlib)
@@ -410,12 +445,15 @@ and every application benefits from this.")
              (chdir "lang/qt")
              #t)))))
     (native-inputs
-     `(("pkg-config" ,pkg-config)
-       ,@(package-native-inputs gpgme)))
+     ;; Use GnuPG 2.2.32.  With 2.2.30, 'testSymmetricEncryptDecrypt' in
+     ;; t-encrypt.cpp fails because 'gpg' wrongfully ask for a passphrase do
+     ;; decrypt the cypher text.
+     (modify-inputs (package-native-inputs gpgme)
+       (replace "gnupg" gnupg-2.2.32)
+       (prepend pkg-config)))
     (inputs
-     `(("gpgme" ,gpgme)
-       ("qtbase" ,qtbase-5)
-       ,@(package-inputs gpgme)))
+     (modify-inputs (package-inputs gpgme)
+       (prepend gpgme qtbase-5)))
     (synopsis "Qt API bindings for gpgme")
     (description "QGpgme provides a very high level Qt API around GpgMEpp.
 
@@ -451,8 +489,10 @@ gpgpme starting with version 1.7.")
                ;; When cross-compiling, the bash script 'libgcrypt-config'
                ;; must be accessible during the configure phase.
                (setenv "PATH"
-                       (string-append (assoc-ref inputs "libgcrypt")
-                                      "/bin:" (getenv "PATH")))))))))
+                       (string-append
+                        (dirname
+                         (search-input-file inputs "bin/libgcrypt-config"))
+                        ":" (getenv "PATH")))))))))
     (native-inputs
      `(("pkg-config" ,pkg-config)
        ("autoconf" ,autoconf)
@@ -664,8 +704,7 @@ signing, decryption, verification, and key-listing parsing.")
         (add-before
          'build 'set-gpg-file-name
          (lambda* (#:key inputs outputs #:allow-other-keys)
-           (let* ((gpg (string-append (assoc-ref inputs "gpg")
-                                      "/bin/gpg")))
+           (let* ((gpg (search-input-file inputs "/bin/gpg")))
              (substitute* "libpius/constants.py"
                (("/usr/bin/gpg2") gpg))
              #t))))))
@@ -1193,8 +1232,7 @@ over.")
          (delete 'configure) ; no configure script
          (add-before 'install 'hardlink-gnupg
            (lambda* (#:key inputs #:allow-other-keys)
-             (let ((gpg (string-append (assoc-ref inputs "gnupg")
-                                       "/bin/gpg")))
+             (let ((gpg (search-input-file inputs "/bin/gpg")))
                (substitute* (find-files "." "jetring-[[:alpha:]]+$")
                  (("gpg -") (string-append gpg " -"))
                  (("\\\"gpg\\\"") (string-append "\"" gpg "\"")))