blob: ead9fe2b09e01e35c92e3fb7c5265ba38a3b5daf (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
{
lib,
stdenv,
fetchFromGitHub,
cmake,
fixDarwinDylibNames,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "libspatialindex";
version = "2.0.0";
src = fetchFromGitHub {
owner = "libspatialindex";
repo = "libspatialindex";
rev = finalAttrs.version;
hash = "sha256-hZyAXz1ddRStjZeqDf4lYkV/g0JLqLy7+GrSUh75k20=";
};
postPatch = ''
patchShebangs test/
'';
nativeBuildInputs = [ cmake ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
cmakeFlags = [
(lib.cmakeBool "BUILD_TESTING" finalAttrs.finalPackage.doCheck)
# The cmake package does not handle absolute CMAKE_INSTALL_INCLUDEDIR
# correctly (setting it to an absolute path causes include files to go to
# $out/$out/include, because the absolute path is interpreted with root
# at $out).
# See: https://github.com/NixOS/nixpkgs/issues/144170
"-DCMAKE_INSTALL_INCLUDEDIR=include"
"-DCMAKE_INSTALL_LIBDIR=lib"
];
doCheck = true;
postFixup = lib.optionalString stdenv.isDarwin ''
install_name_tool -change "@rpath/libspatialindex.7.dylib" "$out/lib/libspatialindex.7.dylib" $out/lib/libspatialindex_c.dylib
'';
meta = {
description = "Extensible spatial index library in C++";
homepage = "https://libspatialindex.org";
license = lib.licenses.mit;
maintainers = lib.teams.geospatial.members;
platforms = lib.platforms.unix;
};
})
|