1{ lib
2, stdenv
3, fetchFromGitHub
4, fetchpatch
5, cmake
6, testers
7}:
8
9stdenv.mkDerivation (finalAttrs: {
10 pname = "lerc";
11 version = "4.0.0";
12
13 outputs = [ "out" "dev" ];
14
15 src = fetchFromGitHub {
16 owner = "esri";
17 repo = "lerc";
18 rev = "v${finalAttrs.version}";
19 hash = "sha256-IHY9QtNYsxPz/ksxRMZGHleT+/bawfTYNVRSTAuYQ7Y=";
20 };
21
22 patches = [
23 # https://github.com/Esri/lerc/pull/227
24 (fetchpatch {
25 name = "use-cmake-install-full-dir.patch";
26 url = "https://github.com/Esri/lerc/commit/5462ca7f7dfb38c65e16f5abfd96873af177a0f8.patch";
27 hash = "sha256-qaNR3QwLe0AB6vu1nXOh9KhlPdWM3DmgCJj4d0VdOUk=";
28 })
29 ];
30
31 nativeBuildInputs = [
32 cmake
33 ];
34
35 passthru.tests.pkg-config = testers.hasPkgConfigModules {
36 package = finalAttrs.finalPackage;
37 };
38
39 meta = {
40 description = "C++ library for Limited Error Raster Compression";
41 homepage = "https://github.com/esri/lerc";
42 license = lib.licenses.asl20;
43 maintainers = with lib.maintainers; [ dotlambda ];
44 pkgConfigModules = [ "Lerc" ];
45 };
46})