2021-05-25 20:21:41 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, sqlite
|
|
|
|
, libtiff
|
|
|
|
, curl
|
|
|
|
, gtest
|
2021-07-20 09:24:28 +00:00
|
|
|
, fetchpatch
|
2021-05-25 20:21:41 +00:00
|
|
|
}:
|
2010-07-28 11:55:54 +00:00
|
|
|
|
2019-07-10 00:39:33 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-03-27 23:49:34 +00:00
|
|
|
pname = "proj";
|
2021-07-20 09:24:28 +00:00
|
|
|
version = "7.2.1";
|
2007-12-05 21:25:47 +00:00
|
|
|
|
2019-07-10 00:39:33 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OSGeo";
|
|
|
|
repo = "PROJ";
|
|
|
|
rev = version;
|
2021-07-20 09:24:28 +00:00
|
|
|
sha256 = "0mymvfvs8xggl4axvlj7kc1ksd9g94kaz6w1vdv0x2y5mqk93gx9";
|
2007-12-05 21:25:47 +00:00
|
|
|
};
|
|
|
|
|
2021-07-20 09:24:28 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch { # https://github.com/OSGeo/PROJ/issues/2557
|
|
|
|
name = "gie_self_tests-fail.diff"; # included in >= 8.0.1
|
|
|
|
url = "https://github.com/OSGeo/PROJ/commit/6f1a3c4648bf06862dca0b3725cbb3b7ee0284e3.diff";
|
|
|
|
sha256 = "0gapny0a9c3r0x9szjgn86sspjrrf4vwbija77b17w6ci5cq4pdf";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-05-25 20:21:41 +00:00
|
|
|
postPatch = lib.optionalString (version == "7.2.1") ''
|
|
|
|
substituteInPlace CMakeLists.txt \
|
|
|
|
--replace "MAJOR 7 MINOR 2 PATCH 0" "MAJOR 7 MINOR 2 PATCH 1"
|
|
|
|
'';
|
|
|
|
|
2019-07-10 00:39:33 +00:00
|
|
|
outputs = [ "out" "dev"];
|
|
|
|
|
2021-05-25 20:21:41 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2019-07-10 00:39:33 +00:00
|
|
|
|
2021-04-11 15:26:22 +00:00
|
|
|
buildInputs = [ sqlite libtiff curl ];
|
2019-07-10 00:39:33 +00:00
|
|
|
|
2021-05-25 20:21:41 +00:00
|
|
|
checkInputs = [ gtest ];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DUSE_EXTERNAL_GTEST=ON"
|
|
|
|
];
|
|
|
|
|
2017-02-12 09:59:23 +00:00
|
|
|
doCheck = stdenv.is64bit;
|
2016-02-22 18:05:17 +00:00
|
|
|
|
2021-05-25 20:21:41 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
'';
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2010-07-28 11:55:54 +00:00
|
|
|
description = "Cartographic Projections Library";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://proj4.org";
|
2014-11-08 20:15:46 +00:00
|
|
|
license = licenses.mit;
|
2021-05-25 20:21:41 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ vbgl dotlambda ];
|
2007-12-05 21:25:47 +00:00
|
|
|
};
|
|
|
|
}
|