2023-03-04 12:14:45 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fixDarwinDylibNames
|
|
|
|
, pkgsStatic
|
|
|
|
, cmake
|
2024-02-29 20:09:43 +00:00
|
|
|
, testers
|
2023-03-04 12:14:45 +00:00
|
|
|
}:
|
2024-02-29 20:09:43 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "libdeflate";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "1.20";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ebiggers";
|
|
|
|
repo = "libdeflate";
|
2024-02-29 20:09:43 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
sha256 = "sha256-kHLdu/Pb94+arj98Jjp57FpvWbAXW49s9cxCA1cf898=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
cmakeFlags = lib.optionals stdenv.hostPlatform.isStatic [ "-DLIBDEFLATE_BUILD_SHARED_LIB=OFF" ];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
nativeBuildInputs = [ cmake ]
|
|
|
|
++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
passthru.tests = {
|
|
|
|
static = pkgsStatic.libdeflate;
|
|
|
|
pkg-config = testers.hasPkgConfigModules {
|
|
|
|
package = finalAttrs.finalPackage;
|
|
|
|
};
|
|
|
|
};
|
2023-03-04 12:14:45 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Fast DEFLATE/zlib/gzip compressor and decompressor";
|
|
|
|
license = licenses.mit;
|
|
|
|
homepage = "https://github.com/ebiggers/libdeflate";
|
2024-02-29 20:09:43 +00:00
|
|
|
changelog = "https://github.com/ebiggers/libdeflate/blob/v${finalAttrs.version}/NEWS.md";
|
2024-04-21 15:54:59 +00:00
|
|
|
platforms = platforms.unix ++ platforms.windows;
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ orivej kaction ];
|
2024-02-29 20:09:43 +00:00
|
|
|
pkgConfigModules = [ "libdeflate" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2024-02-29 20:09:43 +00:00
|
|
|
})
|