2023-07-15 17:15:38 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch
|
|
|
|
, cmake, pkg-config, gtest
|
2021-04-05 15:23:46 +00:00
|
|
|
, withZlibCompat ? false
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "zlib-ng";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "2.1.2";
|
2021-04-05 15:23:46 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "zlib-ng";
|
|
|
|
repo = "zlib-ng";
|
|
|
|
rev = version;
|
2023-07-15 17:15:38 +00:00
|
|
|
sha256 = "sha256-6IEH9IQsBiNwfAZAemmP0/p6CTOzxEKyekciuH6pLhw=";
|
2021-04-05 15:23:46 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://patch-diff.githubusercontent.com/raw/zlib-ng/zlib-ng/pull/1519.patch";
|
|
|
|
hash = "sha256-itobS8kJ2Hj3RfjslVkvEVdQ4t5eeIrsA9muRZt03pE=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
outputs = [ "out" "dev" "bin" ];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
buildInputs = [ gtest ];
|
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_INSTALL_PREFIX=/"
|
|
|
|
"-DBUILD_SHARED_LIBS=ON"
|
|
|
|
"-DINSTALL_UTILS=ON"
|
|
|
|
] ++ lib.optionals withZlibCompat [ "-DZLIB_COMPAT=ON" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "zlib data compression library for the next generation systems";
|
|
|
|
homepage = "https://github.com/zlib-ng/zlib-ng";
|
|
|
|
license = licenses.zlib;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ izorkin ];
|
|
|
|
};
|
|
|
|
}
|