diff --git a/pkgs/development/libraries/kerberos/krb5.nix b/pkgs/development/libraries/kerberos/krb5.nix index d705aa3388fd4ac..8f9c75c441d1356 100644 --- a/pkgs/development/libraries/kerberos/krb5.nix +++ b/pkgs/development/libraries/kerberos/krb5.nix @@ -3,6 +3,9 @@ # Extra Arguments , type ? "" +# This is called "staticOnly" because krb5 does not support +# builting both static and shared, see below. +, staticOnly ? false }: let @@ -22,6 +25,9 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" ]; configureFlags = [ "--with-tcl=no" "--localstatedir=/var/lib"] + # krb5's ./configure does not allow passing --enable-shared and --enable-static at the same time. + # See https://bbs.archlinux.org/viewtopic.php?pid=1576737#p1576737 + ++ optional staticOnly [ "--enable-static" "--disable-shared" ] ++ optional stdenv.isFreeBSD ''WARN_CFLAGS=""'' ++ optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "krb5_cv_attr_constructor_destructor=yes,yes" diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix index b5b9ae7664650fb..4df0e08e6a7213b 100644 --- a/pkgs/development/libraries/openssl/default.nix +++ b/pkgs/development/libraries/openssl/default.nix @@ -2,6 +2,7 @@ , buildPlatform, hostPlatform , withCryptodev ? false, cryptodevHeaders , enableSSL2 ? false +, static ? false }: with stdenv.lib; @@ -63,7 +64,7 @@ let ''; configureFlags = [ - "shared" + "shared" # "shared" builds both shared and static libraries "--libdir=lib" "--openssldir=etc/ssl" ] ++ stdenv.lib.optionals withCryptodev [ @@ -76,13 +77,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/