Subject: [bug#51100] [PATCH 4/8] Update and fix Flatpak and portals

From: John Kehayias <[email-masked]>
Date: Fri, 08 Oct 2021 20:03:19 +0000

>From 71d64041fb6754a1b1cf67b0ea0e18da9b724f74 Mon Sep 17 00:00:00 2001
From: John Kehayias <[email-masked]>
Date: Fri, 8 Oct 2021 14:15:13 -0400
Subject: [PATCH 4/8] gnu: Add p11-kit-next.

* gnu/packages/tls.scm (p11-kit-next): New variable.
[source]: Update to latest version of p11-kit.
[arguments]: Configure with system-wide CA certificate store which fixes a
certificate error with Flatpak. Original patch by Andrew Whatson.
---
 gnu/packages/tls.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index 69ed9de11f..beda86e8c0 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -18,6 +18,7 @@
 ;;; Copyright © 2021 Solene Rapenne <[email-masked]>
 ;;; Copyright © 2021 Brice Waegeneire <[email-masked]>
 ;;; Copyright © 2021 Matthew James Kraai <[email-masked]>
+;;; Copyright © 2021 John Kehayias <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -165,6 +166,31 @@ coordinating the use of PKCS#11 by different components or libraries
 living in the same process.")
     (license license:bsd-3)))

+(define-public p11-kit-next
+  (package
+   (inherit p11-kit)
+   (name "p11-kit-next")
+   (version "0.24.0")
+   (source
+     (origin
+      (method url-fetch)
+      (uri (string-append "https://github.com/p11-glue/p11-kit/releases/"
+                          "download/" version "/p11-kit-" version ".tar.xz"))
+      (sha256
+       (base32 "11f6saclxsclc1f3lbavzw8kikws4cr3mfd1avly8dgnhh2i9rl1"))))
+   (arguments
+     `(#:configure-flags '("--with-trust-paths=/etc/ssl/certs/ca-certificates.crt")
+       #:phases (modify-phases %standard-phases
+                  (add-before 'check 'prepare-tests
+                    (lambda _
+                      ;; "test-runtime" expects XDG_RUNTIME_DIR to be set up
+                      ;; and looks for .cache and other directories (only).
+                      ;; For simplicity just drop it since it is irrelevant
+                      ;; in the build container.
+                      (substitute* "Makefile"
+                        (("test-runtime\\$\\(EXEEXT\\)") ""))
+                      #t)))))))
+
 (define-public gnutls
   (package
     (name "gnutls")
--
2.33.0