anvil-editor: init at 0.4
[NixPkgs.git] / pkgs / development / libraries / libdeflate / default.nix
blob56589f8cf8df51ea68581b85fcb09802796a6647
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , fixDarwinDylibNames
5 , pkgsStatic
6 , cmake
7 , testers
8 }:
10 stdenv.mkDerivation (finalAttrs: {
11   pname = "libdeflate";
12   version = "1.22";
14   src = fetchFromGitHub {
15     owner = "ebiggers";
16     repo = "libdeflate";
17     rev = "v${finalAttrs.version}";
18     hash = "sha256-KpKY0A1cRV9XR1WrE15Eewf2fDWwIFGjQm/fFCnBDrg=";
19   };
21   cmakeFlags = lib.optionals stdenv.hostPlatform.isStatic [ "-DLIBDEFLATE_BUILD_SHARED_LIB=OFF" ];
23   nativeBuildInputs = [ cmake ]
24     ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
26   passthru.tests = {
27     static = pkgsStatic.libdeflate;
28     pkg-config = testers.hasPkgConfigModules {
29       package = finalAttrs.finalPackage;
30     };
31   };
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   };