lol
1{ lib
2, stdenv
3, fetchFromGitHub
4, fixDarwinDylibNames
5, pkgsStatic
6, cmake
7, testers
8}:
9
10stdenv.mkDerivation (finalAttrs: {
11 pname = "libdeflate";
12 version = "1.20";
13
14 src = fetchFromGitHub {
15 owner = "ebiggers";
16 repo = "libdeflate";
17 rev = "v${finalAttrs.version}";
18 sha256 = "sha256-kHLdu/Pb94+arj98Jjp57FpvWbAXW49s9cxCA1cf898=";
19 };
20
21 cmakeFlags = lib.optionals stdenv.hostPlatform.isStatic [ "-DLIBDEFLATE_BUILD_SHARED_LIB=OFF" ];
22
23 nativeBuildInputs = [ cmake ]
24 ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
25
26 passthru.tests = {
27 static = pkgsStatic.libdeflate;
28 pkg-config = testers.hasPkgConfigModules {
29 package = finalAttrs.finalPackage;
30 };
31 };
32
33 meta = with lib; {
34 description = "Fast DEFLATE/zlib/gzip compressor and decompressor";
35 license = licenses.mit;
36 homepage = "https://github.com/ebiggers/libdeflate";
37 changelog = "https://github.com/ebiggers/libdeflate/blob/v${finalAttrs.version}/NEWS.md";
38 platforms = platforms.unix ++ platforms.windows;
39 maintainers = with maintainers; [ orivej kaction ];
40 pkgConfigModules = [ "libdeflate" ];
41 };
42})