From ac07727da7ec0f6bf2df832843dcaafc7dd7046a Mon Sep 17 00:00:00 2001 From: tecnovert Date: Thu, 15 Dec 2022 10:55:20 +0200 Subject: [PATCH] guix: Add SSL_CERT_DIR --- bin/basicswap_prepare.py | 5 +++++ guix.scm | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/bin/basicswap_prepare.py b/bin/basicswap_prepare.py index b33c562..1e01df8 100755 --- a/bin/basicswap_prepare.py +++ b/bin/basicswap_prepare.py @@ -61,6 +61,8 @@ DASH_VERSION_TAG = os.getenv('DASH_VERSION_TAG', '') FIRO_VERSION = os.getenv('FIRO_VERSION', '0.14.99.1') FIRO_VERSION_TAG = os.getenv('FIRO_VERSION_TAG', '') +GUIX_SSL_CERT_DIR = None + known_coins = { 'particl': (PARTICL_VERSION, PARTICL_VERSION_TAG, ('tecnovert',)), @@ -1215,6 +1217,9 @@ def main(): tor_control_password = None extra_opts = {} + if os.getenv('SSL_CERT_DIR', '') == '' and GUIX_SSL_CERT_DIR is not None: + os.environ['SSL_CERT_DIR'] = GUIX_SSL_CERT_DIR + if os.name == 'nt': # On windows sending signal.CTRL_C_EVENT to a subprocess causes it to be sent to the parent process too signal.signal(signal.SIGINT, signal_handler) diff --git a/guix.scm b/guix.scm index dfb69db..4e8111f 100644 --- a/guix.scm +++ b/guix.scm @@ -5,6 +5,7 @@ #:use-module (guix build-system gnu) #:use-module (guix git-download) #:use-module (guix download) +#:use-module (guix search-paths) #:use-module (gnu packages) #:use-module (gnu packages pkg-config) #:use-module (gnu packages autotools) @@ -21,6 +22,7 @@ #:use-module (gnu packages libffi) #:use-module (gnu packages license)) + (define libsecp256k1-anonswap (package (name "libsecp256k1-anonswap") @@ -126,7 +128,18 @@ "023yhncqhp22h7wmkmkj0wc0627vbwlbr6mp5cpjwccalvxziskv")) (file-name (git-file-name name version)))) (build-system python-build-system) - (arguments `(#:tests? #f)) ; TODO: Add coin binaries + + (native-search-paths (list $SSL_CERT_DIR $SSL_CERT_FILE)) + (arguments + '(#:tests? #f ; TODO: Add coin binaries + #:phases (modify-phases %standard-phases + (add-after 'unpack 'patch-env + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "bin/basicswap_prepare.py" + (("GUIX_SSL_CERT_DIR = None") + (string-append "GUIX_SSL_CERT_DIR = \"" (search-input-directory inputs "etc/ssl/certs") "\""))) + ) + )))) (propagated-inputs (list gnupg