Merge pull request #42380 from nlewo/pr-libxml2Static

libxml2: add enableStatic argument
This commit is contained in:
xeji 2018-06-24 18:52:00 +02:00 committed by GitHub
commit b98f20caea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@
, buildPlatform, hostPlatform , buildPlatform, hostPlatform
, pythonSupport ? buildPlatform == hostPlatform , pythonSupport ? buildPlatform == hostPlatform
, icuSupport ? false, icu ? null , icuSupport ? false, icu ? null
, enableStatic ? false
}: }:
let let
@ -18,7 +19,8 @@ in stdenv.mkDerivation rec {
}; };
outputs = [ "bin" "dev" "out" "man" "doc" ] outputs = [ "bin" "dev" "out" "man" "doc" ]
++ lib.optional pythonSupport "py"; ++ lib.optional pythonSupport "py"
++ lib.optional enableStatic "static";
propagatedBuildOutputs = "out bin" + lib.optionalString pythonSupport " py"; propagatedBuildOutputs = "out bin" + lib.optionalString pythonSupport " py";
buildInputs = lib.optional pythonSupport python buildInputs = lib.optional pythonSupport python
@ -32,7 +34,8 @@ in stdenv.mkDerivation rec {
configureFlags = configureFlags =
lib.optional pythonSupport "--with-python=${python}" lib.optional pythonSupport "--with-python=${python}"
++ lib.optional icuSupport "--with-icu" ++ lib.optional icuSupport "--with-icu"
++ [ "--exec_prefix=$dev" ]; ++ [ "--exec_prefix=$dev" ]
++ lib.optional enableStatic "--enable-static";
enableParallelBuilding = true; enableParallelBuilding = true;
@ -57,6 +60,8 @@ in stdenv.mkDerivation rec {
moveToOutput bin/xml2-config "$dev" moveToOutput bin/xml2-config "$dev"
moveToOutput lib/xml2Conf.sh "$dev" moveToOutput lib/xml2Conf.sh "$dev"
moveToOutput share/man/man1 "$bin" moveToOutput share/man/man1 "$bin"
'' + lib.optionalString enableStatic ''
moveToOutput lib/libxml2.a "$static"
''; '';
passthru = { inherit version; pythonSupport = pythonSupport; }; passthru = { inherit version; pythonSupport = pythonSupport; };