minizip-ng{-compat}: split compat, fixup cmake options, 4.1.0 -> 4.2.1, strictDeps, add kuflierl as maintainer (#506086)
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
{
|
||||
minizip-ng,
|
||||
}:
|
||||
minizip-ng.override {
|
||||
enableCompat = true;
|
||||
}
|
||||
@@ -10,23 +10,25 @@
|
||||
xz,
|
||||
zstd,
|
||||
openssl,
|
||||
enableCompat ? false,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "minizip-ng";
|
||||
version = "4.1.0";
|
||||
pname = "minizip-ng" + lib.optionalString enableCompat "-compat";
|
||||
version = "4.2.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "zlib-ng";
|
||||
repo = "minizip-ng";
|
||||
rev = finalAttrs.version;
|
||||
hash = "sha256-H6ttsVBs437lWMBsq5baVDb9e5I6Fh+xggFre/hxGKU=";
|
||||
hash = "sha256-gpjM8Cqoe4kafXgl2wXhhCRx39WC94qJ1DIDyd2n0G8=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
zlib
|
||||
bzip2
|
||||
@@ -36,45 +38,35 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DBUILD_SHARED_LIBS=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}"
|
||||
"-DMZ_OPENSSL=ON"
|
||||
"-DMZ_BUILD_TESTS=${if finalAttrs.finalPackage.doCheck then "ON" else "OFF"}"
|
||||
"-DMZ_BUILD_UNIT_TESTS=${if finalAttrs.finalPackage.doCheck then "ON" else "OFF"}"
|
||||
"-DMZ_LIB_SUFFIX='-ng'"
|
||||
(lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
|
||||
(lib.cmakeBool "MZ_OPENSSL" true)
|
||||
(lib.cmakeBool "MZ_PPMD" false) # PPMD support requres internet access to make a git clone
|
||||
(lib.cmakeBool "MZ_LIBCOMP" false) # builds only on Darwin by default where it fails due to mising headers
|
||||
(lib.cmakeBool "MZ_BUILD_TESTS" finalAttrs.doCheck)
|
||||
(lib.cmakeBool "MZ_BUILD_UNIT_TESTS" finalAttrs.doCheck)
|
||||
(lib.cmakeBool "MZ_COMPAT" enableCompat)
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isi686 [
|
||||
# tests fail
|
||||
"-DMZ_PKCRYPT=OFF"
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
# missing header file
|
||||
"-DMZ_LIBCOMP=OFF"
|
||||
(lib.cmakeBool "MZ_PKCRYPT" false)
|
||||
];
|
||||
|
||||
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-Wno-register";
|
||||
|
||||
postInstall = ''
|
||||
# make lib findable as libminizip-ng even if compat is enabled
|
||||
for ext in so dylib a ; do
|
||||
if [ -e $out/lib/libminizip.$ext ] && [ ! -e $out/lib/libminizip-ng.$ext ]; then
|
||||
ln -s $out/lib/libminizip.$ext $out/lib/libminizip-ng.$ext
|
||||
fi
|
||||
done
|
||||
if [ ! -e $out/include/minizip-ng ]; then
|
||||
ln -s $out/include $out/include/minizip-ng
|
||||
fi
|
||||
'';
|
||||
|
||||
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
||||
nativeCheckInputs = [ gtest ];
|
||||
checkInputs = [ gtest ];
|
||||
enableParallelChecking = false;
|
||||
|
||||
strictDeps = true;
|
||||
__structuredAttrs = true;
|
||||
|
||||
meta = {
|
||||
description = "Fork of the popular zip manipulation library found in the zlib distribution";
|
||||
homepage = "https://github.com/zlib-ng/minizip-ng";
|
||||
license = lib.licenses.zlib;
|
||||
maintainers = with lib.maintainers; [
|
||||
ris
|
||||
kuflierl
|
||||
];
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user