Merge pull request #43870 from nh2/static-krb5-openssl-flags
Optional static libraries for krb5 and openssl
This commit is contained in:
@@ -3,6 +3,9 @@
|
|||||||
|
|
||||||
# Extra Arguments
|
# Extra Arguments
|
||||||
, type ? ""
|
, type ? ""
|
||||||
|
# This is called "staticOnly" because krb5 does not support
|
||||||
|
# builting both static and shared, see below.
|
||||||
|
, staticOnly ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
@@ -22,6 +25,9 @@ stdenv.mkDerivation rec {
|
|||||||
outputs = [ "out" "dev" ];
|
outputs = [ "out" "dev" ];
|
||||||
|
|
||||||
configureFlags = [ "--with-tcl=no" "--localstatedir=/var/lib"]
|
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=""''
|
++ optional stdenv.isFreeBSD ''WARN_CFLAGS=""''
|
||||||
++ optionals (stdenv.buildPlatform != stdenv.hostPlatform)
|
++ optionals (stdenv.buildPlatform != stdenv.hostPlatform)
|
||||||
[ "krb5_cv_attr_constructor_destructor=yes,yes"
|
[ "krb5_cv_attr_constructor_destructor=yes,yes"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
, buildPlatform, hostPlatform
|
, buildPlatform, hostPlatform
|
||||||
, withCryptodev ? false, cryptodevHeaders
|
, withCryptodev ? false, cryptodevHeaders
|
||||||
, enableSSL2 ? false
|
, enableSSL2 ? false
|
||||||
|
, static ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
@@ -63,7 +64,7 @@ let
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
"shared"
|
"shared" # "shared" builds both shared and static libraries
|
||||||
"--libdir=lib"
|
"--libdir=lib"
|
||||||
"--openssldir=etc/ssl"
|
"--openssldir=etc/ssl"
|
||||||
] ++ stdenv.lib.optionals withCryptodev [
|
] ++ stdenv.lib.optionals withCryptodev [
|
||||||
@@ -76,13 +77,16 @@ let
|
|||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
postInstall = ''
|
postInstall =
|
||||||
|
stdenv.lib.optionalString (!static) ''
|
||||||
# If we're building dynamic libraries, then don't install static
|
# If we're building dynamic libraries, then don't install static
|
||||||
# libraries.
|
# libraries.
|
||||||
if [ -n "$(echo $out/lib/*.so $out/lib/*.dylib $out/lib/*.dll)" ]; then
|
if [ -n "$(echo $out/lib/*.so $out/lib/*.dylib $out/lib/*.dll)" ]; then
|
||||||
rm "$out/lib/"*.a
|
rm "$out/lib/"*.a
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
'' +
|
||||||
|
''
|
||||||
mkdir -p $bin
|
mkdir -p $bin
|
||||||
mv $out/bin $bin/
|
mv $out/bin $bin/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user