From 4225eb11742bd2f4708edc770a5c40b34321f20d Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Sat, 11 Jan 2020 15:55:19 -0800 Subject: [PATCH 1/3] pkgsStatic: make OpenSSL 1.1 compile --- pkgs/top-level/static.nix | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/pkgs/top-level/static.nix b/pkgs/top-level/static.nix index 09ea593857d457..2ef1fba4a4527d 100644 --- a/pkgs/top-level/static.nix +++ b/pkgs/top-level/static.nix @@ -161,14 +161,11 @@ in { }; mkl = super.mkl.override { enableStatic = true; }; nix = super.nix.override { withAWS = false; }; - # openssl 1.1 doesn't compile - openssl = super.openssl_1_0_2.override { - static = true; - - # Don’t use new stdenv for openssl because it doesn’t like the - # --disable-shared flag - stdenv = super.stdenv; - }; + openssl = (super.openssl_1_1.override { static = true; }).overrideAttrs (o: { + configureFlags = (removeUnknownConfigureFlags o.configureFlags) ++ [ + "no-shared" + ]; + }); arrow-cpp = super.arrow-cpp.override { enableShared = false; python = { pkgs = { python = null; numpy = null; }; }; From 5b5b1b798b069b8d053dfd004cfd03ff52fe318a Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Sat, 11 Jan 2020 17:10:00 -0800 Subject: [PATCH 2/3] Add comments (code review) --- pkgs/top-level/static.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/top-level/static.nix b/pkgs/top-level/static.nix index 2ef1fba4a4527d..14fce178c48d5b 100644 --- a/pkgs/top-level/static.nix +++ b/pkgs/top-level/static.nix @@ -162,6 +162,10 @@ in { mkl = super.mkl.override { enableStatic = true; }; nix = super.nix.override { withAWS = false; }; openssl = (super.openssl_1_1.override { static = true; }).overrideAttrs (o: { + # OpenSSL doesn't like the `--enable-static` / `--disable-shared` flags. + # Instead, there's a specific `no-shared` configure flag. + # See https://wiki.openssl.org/index.php/Compilation_and_Installation#Configure_Options + # for a comprehensive list. configureFlags = (removeUnknownConfigureFlags o.configureFlags) ++ [ "no-shared" ]; From e15901b240c1e4b0b62e8f985652acc54ab7009d Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Sun, 12 Jan 2020 09:38:02 -0800 Subject: [PATCH 3/3] Move `no-shared` to the openssl derivation --- pkgs/development/libraries/openssl/default.nix | 6 +++++- pkgs/top-level/static.nix | 7 +------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix index 118aa984c17405..e5aa0b70209c6b 100644 --- a/pkgs/development/libraries/openssl/default.nix +++ b/pkgs/development/libraries/openssl/default.nix @@ -72,7 +72,11 @@ let "-DHAVE_CRYPTODEV" "-DUSE_CRYPTODEV_DIGESTS" ] ++ stdenv.lib.optional enableSSL2 "enable-ssl2" - ++ stdenv.lib.optional (versionAtLeast version "1.1.0" && stdenv.hostPlatform.isAarch64) "no-afalgeng"; + ++ stdenv.lib.optional (versionAtLeast version "1.1.0" && stdenv.hostPlatform.isAarch64) "no-afalgeng" + # OpenSSL needs a specific `no-shared` configure flag. + # See https://wiki.openssl.org/index.php/Compilation_and_Installation#Configure_Options + # for a comprehensive list of configuration options. + ++ stdenv.lib.optional (versionAtLeast version "1.1.0" && static) "no-shared"; makeFlags = [ "MANDIR=$(man)/share/man" diff --git a/pkgs/top-level/static.nix b/pkgs/top-level/static.nix index 14fce178c48d5b..20517e98b30fff 100644 --- a/pkgs/top-level/static.nix +++ b/pkgs/top-level/static.nix @@ -163,12 +163,7 @@ in { nix = super.nix.override { withAWS = false; }; openssl = (super.openssl_1_1.override { static = true; }).overrideAttrs (o: { # OpenSSL doesn't like the `--enable-static` / `--disable-shared` flags. - # Instead, there's a specific `no-shared` configure flag. - # See https://wiki.openssl.org/index.php/Compilation_and_Installation#Configure_Options - # for a comprehensive list. - configureFlags = (removeUnknownConfigureFlags o.configureFlags) ++ [ - "no-shared" - ]; + configureFlags = (removeUnknownConfigureFlags o.configureFlags); }); arrow-cpp = super.arrow-cpp.override { enableShared = false;