14 stdenv.mkDerivation rec {
18 src = fetchFromGitHub {
22 sha256 = "sha256-zMP+WzC65BFz8g8mF5t7toqxmxCJePysd6WJuqpe8yg=";
25 # https://github.com/OSGeo/PROJ/issues/3206
27 # NB will not apply once https://github.com/OSGeo/PROJ/pull/3150 is released
28 substituteInPlace cmake/ProjUtilities.cmake \
29 --replace '$\{exec_prefix\}/$'{PROJ_LIB_SUBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \
30 --replace '$\{prefix\}/$'{PROJ_INCLUDE_SUBDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR} \
31 --replace '$\{prefix\}/$'{CMAKE_INSTALL_DATAROOTDIR} '$'{CMAKE_INSTALL_FULL_DATAROOTDIR}
32 substituteInPlace cmake/project-config.cmake.in \
33 --replace '$'{_ROOT}/@INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ \
34 --replace '$'{_ROOT}/@LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \
35 --replace '$'{_ROOT}/@BINDIR@ @CMAKE_INSTALL_FULL_BINDIR@
38 outputs = [ "out" "dev" ];
40 nativeBuildInputs = [ cmake pkg-config ];
42 buildInputs = [ sqlite libtiff curl nlohmann_json ];
44 checkInputs = [ gtest ];
47 "-DUSE_EXTERNAL_GTEST=ON"
48 "-DRUN_NETWORK_DEPENDENT_TESTS=OFF"
49 "-DNLOHMANN_JSON_ORIGIN=external"
50 "-DEXE_SQLITE3=${buildPackages.sqlite}/bin/sqlite3"
55 libPathEnvVar = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH";
60 export ${libPathEnvVar}=$PWD/lib
66 description = "Cartographic Projections Library";
67 homepage = "https://proj.org/";
68 license = licenses.mit;
69 platforms = platforms.unix;
70 maintainers = with maintainers; [ dotlambda ];