2021-05-29 03:34:57 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
2022-04-27 09:35:20 +00:00
|
|
|
, buildPackages
|
2021-05-29 03:34:57 +00:00
|
|
|
, sqlite
|
|
|
|
, libtiff
|
|
|
|
, curl
|
|
|
|
, gtest
|
2022-04-27 09:35:20 +00:00
|
|
|
, nlohmann_json
|
2021-05-29 03:34:57 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "proj";
|
2022-04-27 09:35:20 +00:00
|
|
|
version = "9.0.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OSGeo";
|
|
|
|
repo = "PROJ";
|
|
|
|
rev = version;
|
2022-04-27 09:35:20 +00:00
|
|
|
sha256 = "sha256-zMP+WzC65BFz8g8mF5t7toqxmxCJePysd6WJuqpe8yg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-29 03:34:57 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
buildInputs = [ sqlite libtiff curl nlohmann_json ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-29 03:34:57 +00:00
|
|
|
checkInputs = [ gtest ];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DUSE_EXTERNAL_GTEST=ON"
|
2021-09-28 08:13:01 +00:00
|
|
|
"-DRUN_NETWORK_DEPENDENT_TESTS=OFF"
|
2022-04-27 09:35:20 +00:00
|
|
|
"-DNLOHMANN_JSON_ORIGIN=external"
|
|
|
|
"-DEXE_SQLITE3=${buildPackages.sqlite}/bin/sqlite3"
|
2021-05-29 03:34:57 +00:00
|
|
|
];
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
preCheck =
|
|
|
|
let
|
|
|
|
libPathEnvVar = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH";
|
|
|
|
in
|
|
|
|
''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
export TMP=$TMPDIR
|
|
|
|
export ${libPathEnvVar}=$PWD/lib
|
|
|
|
'';
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2021-09-28 08:13:01 +00:00
|
|
|
doCheck = true;
|
2021-05-29 03:34:57 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Cartographic Projections Library";
|
2021-09-28 08:13:01 +00:00
|
|
|
homepage = "https://proj.org/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2021-05-29 03:34:57 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ vbgl dotlambda ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|