From 479dcc3b549dc7378cdb570bf3cb9fba7b9a4d2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= Date: Sat, 21 Jul 2018 04:41:01 +0200 Subject: [PATCH] openssl: Add `static` flag. Its effect on `postInstall` is carefully written to not cause recompilation in the default case. --- pkgs/development/libraries/openssl/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix index 0251de77d03e..746a4445ddbc 100644 --- a/pkgs/development/libraries/openssl/default.nix +++ b/pkgs/development/libraries/openssl/default.nix @@ -3,6 +3,7 @@ , fetchpatch , withCryptodev ? false, cryptodevHeaders , enableSSL2 ? false +, static ? false }: with stdenv.lib; @@ -62,7 +63,7 @@ let ''; configureFlags = [ - "shared" + "shared" # "shared" builds both shared and static libraries "--libdir=lib" "--openssldir=etc/ssl" ] ++ stdenv.lib.optionals withCryptodev [ @@ -75,13 +76,16 @@ let enableParallelBuilding = true; - postInstall = '' + postInstall = + stdenv.lib.optionalString (!static) '' # If we're building dynamic libraries, then don't install static # libraries. if [ -n "$(echo $out/lib/*.so $out/lib/*.dylib $out/lib/*.dll)" ]; then rm "$out/lib/"*.a fi + '' + + '' mkdir -p $bin mv $out/bin $bin/