mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-24 14:43:37 +00:00
ac0a7e8e05
Add a cmakeFlag to point to a sqlite3 binary that can be run at build time
60 lines
1.2 KiB
Nix
60 lines
1.2 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchFromGitHub
|
|
, cmake
|
|
, pkg-config
|
|
, buildPackages
|
|
, sqlite
|
|
, libtiff
|
|
, curl
|
|
, gtest
|
|
, nlohmann_json
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "proj";
|
|
version = "9.0.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "OSGeo";
|
|
repo = "PROJ";
|
|
rev = version;
|
|
sha256 = "sha256-zMP+WzC65BFz8g8mF5t7toqxmxCJePysd6WJuqpe8yg=";
|
|
};
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
|
|
|
buildInputs = [ sqlite libtiff curl nlohmann_json ];
|
|
|
|
checkInputs = [ gtest ];
|
|
|
|
cmakeFlags = [
|
|
"-DUSE_EXTERNAL_GTEST=ON"
|
|
"-DRUN_NETWORK_DEPENDENT_TESTS=OFF"
|
|
"-DNLOHMANN_JSON_ORIGIN=external"
|
|
"-DEXE_SQLITE3=${buildPackages.sqlite}/bin/sqlite3"
|
|
];
|
|
|
|
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
|
|
'';
|
|
|
|
doCheck = true;
|
|
|
|
meta = with lib; {
|
|
description = "Cartographic Projections Library";
|
|
homepage = "https://proj.org/";
|
|
license = licenses.mit;
|
|
platforms = platforms.unix;
|
|
maintainers = with maintainers; [ vbgl dotlambda ];
|
|
};
|
|
}
|