[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
06/13: search-paths: Define $SSL_CERT_DIR and $SSL_CERT_FILE.
From: |
guix-commits |
Subject: |
06/13: search-paths: Define $SSL_CERT_DIR and $SSL_CERT_FILE. |
Date: |
Fri, 13 May 2022 11:52:21 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 89a2eb25c3e9809eb58ce48d4f36bf06bad338dc
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Sat May 7 08:37:31 2022 +0000
search-paths: Define $SSL_CERT_DIR and $SSL_CERT_FILE.
For the ‘why’, see the docstring next to $SSL_CERT_DIR. In later commits,
packages will be changed to use these variables and the variables will be
added to more packages.
* guix/search-paths.scm ($SSL_CERT_DIR, $SSL_CERT_FILE): New variables.
* doc/guix.texi (Search Paths): Document them.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
doc/guix.texi | 21 ++++++++++++++++++++-
guix/search-paths.scm | 26 ++++++++++++++++++++++++++
2 files changed, 46 insertions(+), 1 deletion(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 30cd56fcf3..e1fb50a634 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -88,7 +88,7 @@ Copyright @copyright{} 2020 Daniel Brooks@*
Copyright @copyright{} 2020 John Soo@*
Copyright @copyright{} 2020 Jonathan Brielmaier@*
Copyright @copyright{} 2020 Edgar Vincent@*
-Copyright @copyright{} 2021 Maxime Devos@*
+Copyright @copyright{} 2021, 2022 Maxime Devos@*
Copyright @copyright{} 2021 B. Wilson@*
Copyright @copyright{} 2021 Xinglu Chen@*
Copyright @copyright{} 2021 Raghav Gururajan@*
@@ -10127,6 +10127,25 @@ Again, the libxml2 example shows a situation where
this is needed.
@end table
@end deftp
+Some search paths are not tied by a single package but to many packages.
+To reduce duplications, some of them are pre-defined in @code{(guix
+search-paths)}.
+
+@defvr {Scheme Variable} $SSL_CERT_DIR
+@defvrx {Scheme Variable} $SSL_CERT_FILE
+These two search paths indicate where X.509 certificates can be found
+(@pxref{X.509 Certificates}).
+@end defvr
+
+These pre-defined search paths can be used as in the following example:
+
+@lisp
+(package
+ (name "curl")
+ ;; some fields omitted ...
+ (native-search-paths (list $SSL_CERT_DIR $SSL_CERT_FILE)))
+@end lisp
+
How do you turn search path specifications on one hand and a bunch of
directories on the other hand in a set of environment variable
definitions? That's the job of @code{evaluate-search-paths}.
diff --git a/guix/search-paths.scm b/guix/search-paths.scm
index 002e6342bb..6b13a98946 100644
--- a/guix/search-paths.scm
+++ b/guix/search-paths.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -32,6 +33,8 @@
search-path-specification-file-pattern
$PATH
+ $SSL_CERT_DIR
+ $SSL_CERT_FILE
search-path-specification->sexp
sexp->search-path-specification
@@ -70,6 +73,29 @@
(variable "PATH")
(files '("bin" "sbin"))))
+;; Two variables for certificates (see (guix)X.509 Certificates),
+;; respected by 'openssl', possibly GnuTLS in the future
+;; (https://gitlab.com/gnutls/gnutls/-/merge_requests/1541)
+;; and many of their dependents -- even some GnuTLS depepdents
+;; like Guile. As they are not tied to a single package, define
+;; them here to avoid duplication.
+;;
+;; Additionally, the 'native-search-paths' field is not thunked,
+;; so doing (package-native-search-paths openssl)
+;; could cause import cycle issues.
+(define-public $SSL_CERT_DIR
+ (search-path-specification
+ (variable "SSL_CERT_DIR")
+ (separator #f) ;single entry
+ (files '("etc/ssl/certs"))))
+
+(define-public $SSL_CERT_FILE
+ (search-path-specification
+ (variable "SSL_CERT_FILE")
+ (file-type 'regular)
+ (separator #f) ;single entry
+ (files '("etc/ssl/certs/ca-certificates.crt"))))
+
(define (search-path-specification->sexp spec)
"Return an sexp representing SPEC, a <search-path-specification>. The sexp
corresponds to the arguments expected by `set-path-environment-variable'."
- branch master updated (7f7cc04208 -> 2e6f4220cf), guix-commits, 2022/05/13
- 01/13: doc: Add "Writing Manifests" node., guix-commits, 2022/05/13
- 04/13: gnu: artanis: Remove input labels., guix-commits, 2022/05/13
- 02/13: gnu: guile-ics: Update to 0.2.1, guix-commits, 2022/05/13
- 07/13: gnu: openssl: Use $SSL_CERT_DIR/$SSL_CERT_FILE., guix-commits, 2022/05/13
- 12/13: gnu: poke: Update to 2.3., guix-commits, 2022/05/13
- 13/13: gnu: xonsh: Update to 0.12.4., guix-commits, 2022/05/13
- 06/13: search-paths: Define $SSL_CERT_DIR and $SSL_CERT_FILE.,
guix-commits <=
- 08/13: gnu: cuirass: Use $SSL_CERT_DIR., guix-commits, 2022/05/13
- 05/13: gnu: pipe-viewer: Update to 0.2.0, guix-commits, 2022/05/13
- 03/13: gnu: artanis: Update to 0.5.1., guix-commits, 2022/05/13
- 10/13: gnu: curl: Use $SSL_CERT_DIR/$SSL_CERT_FILE., guix-commits, 2022/05/13
- 09/13: gnu: cmake-bootstrap: Use $SSL_CERT_DIR/$SSL_CERT_FILE., guix-commits, 2022/05/13
- 11/13: gnu: guix: Use $SSL_CERT_DIR., guix-commits, 2022/05/13