2023-03-04 12:14:45 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fixDarwinDylibNames
|
|
|
|
, pkgsStatic
|
|
|
|
, cmake
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libdeflate";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "1.19";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ebiggers";
|
|
|
|
repo = "libdeflate";
|
|
|
|
rev = "v${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
sha256 = "sha256-HgZ2an1PCPhiLsd3ZA7tgZ1wVTOdHzDr8FHrqJhEbQw=";
|
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
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
passthru.tests.static = pkgsStatic.libdeflate;
|
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";
|
2023-04-12 12:48:02 +00:00
|
|
|
changelog = "https://github.com/ebiggers/libdeflate/blob/v${version}/NEWS.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ orivej kaction ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|