summary refs log tree commit diff
path: root/pkgs/development/libraries/openssl
diff options
context:
space:
mode:
authorNiklas Hambüchen <mail@nh2.me>2018-07-21 04:41:01 +0200
committerNiklas Hambüchen <mail@nh2.me>2018-07-21 04:43:50 +0200
commit479dcc3b549dc7378cdb570bf3cb9fba7b9a4d2a (patch)
tree7f3e8945627d8989f8ba5bf19413d3b1d6968454 /pkgs/development/libraries/openssl
parentbc6cfb47500c56bb1c59462e6b6ccb4fb0ba8486 (diff)
downloadnixlib-479dcc3b549dc7378cdb570bf3cb9fba7b9a4d2a.tar
nixlib-479dcc3b549dc7378cdb570bf3cb9fba7b9a4d2a.tar.gz
nixlib-479dcc3b549dc7378cdb570bf3cb9fba7b9a4d2a.tar.bz2
nixlib-479dcc3b549dc7378cdb570bf3cb9fba7b9a4d2a.tar.lz
nixlib-479dcc3b549dc7378cdb570bf3cb9fba7b9a4d2a.tar.xz
nixlib-479dcc3b549dc7378cdb570bf3cb9fba7b9a4d2a.tar.zst
nixlib-479dcc3b549dc7378cdb570bf3cb9fba7b9a4d2a.zip
openssl: Add `static` flag.
Its effect on `postInstall` is carefully written to not
cause recompilation in the default case.
Diffstat (limited to 'pkgs/development/libraries/openssl')
-rw-r--r--pkgs/development/libraries/openssl/default.nix8
1 files 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/