3
0
Fork 0
forked from mirrors/nixpkgs

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