anvil-editor: init at 0.4
[NixPkgs.git] / pkgs / development / libraries / proj / 7.nix
blobcfd1156388024be89e9f3d65e864be024d70e019
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , cmake
5 , pkg-config
6 , sqlite
7 , libtiff
8 , curl
9 , gtest
10 , fetchpatch
13 stdenv.mkDerivation rec {
14   pname = "proj";
15   version = "7.2.1";
17   src = fetchFromGitHub {
18     owner = "OSGeo";
19     repo = "PROJ";
20     rev = version;
21     sha256 = "0mymvfvs8xggl4axvlj7kc1ksd9g94kaz6w1vdv0x2y5mqk93gx9";
22   };
24   patches = [
25     (fetchpatch { # https://github.com/OSGeo/PROJ/issues/2557
26       name = "gie_self_tests-fail.diff"; # included in >= 8.0.1
27       url = "https://github.com/OSGeo/PROJ/commit/6f1a3c4648bf06862dca0b3725cbb3b7ee0284e3.diff";
28       sha256 = "0gapny0a9c3r0x9szjgn86sspjrrf4vwbija77b17w6ci5cq4pdf";
29     })
30     ./tests-sqlite-3.39.patch
31   ];
33   postPatch = lib.optionalString (version == "7.2.1") ''
34     substituteInPlace CMakeLists.txt \
35       --replace "MAJOR 7 MINOR 2 PATCH 0" "MAJOR 7 MINOR 2 PATCH 1"
36   '';
38   outputs = [ "out" "dev"];
40   nativeBuildInputs = [ cmake pkg-config ];
42   buildInputs = [ sqlite libtiff curl ];
44   nativeCheckInputs = [ gtest ];
46   cmakeFlags = [
47     "-DUSE_EXTERNAL_GTEST=ON"
48   ];
49   CXXFLAGS = [
50     # GCC 13: error: 'int64_t' in namespace 'std' does not name a type
51     "-include cstdint"
52   ];
54   doCheck = true;
56   meta = with lib; {
57     description = "Cartographic Projections Library";
58     homepage = "https://proj4.org";
59     license = licenses.mit;
60     platforms = platforms.unix;
61     maintainers = with maintainers; [ dotlambda ];
62   };