ps3-disc-dumper: 3.2.3 -> 4.2.5, .NET 6 -> 9 (#361506)
[NixPkgs.git] / pkgs / development / libraries / proj / default.nix
blobe9a9caff159f117c84498573ef9453e973d1b6a2
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   cmake,
6   pkg-config,
7   buildPackages,
8   callPackage,
9   sqlite,
10   libtiff,
11   curl,
12   gtest,
13   nlohmann_json,
14   python3,
15   cacert,
18 stdenv.mkDerivation (finalAttrs: {
19   pname = "proj";
20   version = "9.5.1";
22   src = fetchFromGitHub {
23     owner = "OSGeo";
24     repo = "PROJ";
25     rev = finalAttrs.version;
26     hash = "sha256-gKfsuznAhq29sOw78gpQ7TNZ6xCgmDBad3TcqFzoWVc=";
27   };
29   patches = [
30     # https://github.com/OSGeo/PROJ/pull/3252
31     ./only-add-curl-for-static-builds.patch
32   ];
34   outputs = [
35     "out"
36     "dev"
37   ];
39   nativeBuildInputs = [
40     cmake
41     pkg-config
42   ];
44   buildInputs = [
45     sqlite
46     libtiff
47     curl
48     nlohmann_json
49   ];
51   nativeCheckInputs = [
52     cacert
53     gtest
54   ];
56   cmakeFlags = [
57     "-DUSE_EXTERNAL_GTEST=ON"
58     "-DRUN_NETWORK_DEPENDENT_TESTS=OFF"
59     "-DNLOHMANN_JSON_ORIGIN=external"
60     "-DEXE_SQLITE3=${buildPackages.sqlite}/bin/sqlite3"
61   ];
62   CXXFLAGS = [
63     # GCC 13: error: 'int64_t' in namespace 'std' does not name a type
64     "-include cstdint"
65   ];
67   preCheck =
68     let
69       libPathEnvVar = if stdenv.hostPlatform.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH";
70     in
71     ''
72       export HOME=$TMPDIR
73       export TMP=$TMPDIR
74       export ${libPathEnvVar}=$PWD/lib
75     '';
77   doCheck = true;
79   passthru.tests = {
80     python = python3.pkgs.pyproj;
81     proj = callPackage ./tests.nix { proj = finalAttrs.finalPackage; };
82   };
84   meta = with lib; {
85     changelog = "https://github.com/OSGeo/PROJ/blob/${finalAttrs.src.rev}/NEWS";
86     description = "Cartographic Projections Library";
87     homepage = "https://proj.org/";
88     license = licenses.mit;
89     maintainers = with maintainers; teams.geospatial.members ++ [ dotlambda ];
90     platforms = platforms.unix;
91   };