zlib: cleanup

This commit is contained in:
Sandro Jäckel
2022-10-21 22:40:49 +02:00
parent dd2351ee2f
commit 401544bcac
+8 -12
View File
@@ -21,7 +21,7 @@ assert shared || static;
assert splitStaticOutput -> static;
stdenv.mkDerivation (rec {
stdenv.mkDerivation rec {
pname = "zlib";
version = "1.2.12";
@@ -57,6 +57,12 @@ stdenv.mkDerivation (rec {
setOutputFlags = false;
outputDoc = "dev"; # single tiny man3 page
dontConfigure = stdenv.hostPlatform.libc == "msvcrt";
preConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
export CHOST=${stdenv.hostPlatform.config}
'';
# For zlib's ./configure (as of verion 1.2.11), the order
# of --static/--shared flags matters!
# `--shared --static` builds only static libs, while
@@ -128,20 +134,10 @@ stdenv.mkDerivation (rec {
"SHARED_MODE=1"
];
passthru = {
inherit version;
};
meta = with lib; {
homepage = "https://zlib.net";
description = "Lossless data-compression library";
license = licenses.zlib;
platforms = platforms.all;
};
} // lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) {
preConfigure = ''
export CHOST=${stdenv.hostPlatform.config}
'';
} // lib.optionalAttrs (stdenv.hostPlatform.libc == "msvcrt") {
dontConfigure = true;
})
}