Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / brunsli / default.nix
blob03c9b02f7f9ffd801d1dff53a927db148aea0562
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , fetchpatch
5 , cmake
6 , brotli
7 }:
9 stdenv.mkDerivation rec {
10   pname = "brunsli";
11   version = "0.1";
13   outputs = [ "out" "dev" ];
15   src = fetchFromGitHub {
16     owner = "google";
17     repo = "brunsli";
18     rev = "v${version}";
19     hash = "sha256-ZcrRz2xSoRepgG8KZYY/JzgONerItW0e6mH1PYsko98=";
20   };
22   patches = [
23     # unvendor brotli
24     (fetchpatch {
25       url = "https://cgit.freebsd.org/ports/plain/graphics/brunsli/files/patch-CMakeLists.txt";
26       extraPrefix = "";
27       hash = "sha256-/WPOG9OcEDj9ObBSXEM8Luq4Rix+PS2MvsYyHhK5mns=";
28     })
29     (fetchpatch {
30       url = "https://cgit.freebsd.org/ports/plain/graphics/brunsli/files/patch-brunsli.cmake";
31       extraPrefix = "";
32       hash = "sha256-+HXA9Tin+l2St7rRUEBM0AfhAjSoFxz8UX7hsg12aFg=";
33     })
34   ];
36   postPatch = ''
37     rm -r third_party
38   '' + lib.optionalString stdenv.isDarwin ''
39     rm -r build
40   '';
42   nativeBuildInputs = [
43     cmake
44   ];
46   buildInputs = [
47     brotli
48   ];
50   meta = {
51     description = "Lossless JPEG repacking library";
52     homepage = "https://github.com/google/brunsli";
53     license = lib.licenses.mit;
54     maintainers = with lib.maintainers; [ dotlambda ];
55   };