-
Notifications
You must be signed in to change notification settings - Fork 27
/
libkdtree.nix
59 lines (49 loc) · 1.42 KB
/
libkdtree.nix
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
52
53
54
55
56
57
58
59
{ lib
, stdenv
, cmake
, doxygen
}:
stdenv.mkDerivation (finalAttrs: {
name = "libkdtree++";
version = "0.7.3";
src = builtins.path { name = "libkdtree++"; path = ./.; };
nativeBuildInputs = [
cmake
doxygen
];
buildPhase = ''
make
doxygen ../doc/Doxyfile
'';
doCheck = true;
checkPhase = ''
echo Test test_kdtree
./examples/test_kdtree
echo Test test_hayne
./examples/test_hayne
echo Test test_find_within_range
./examples/test_find_within_range
'';
installPhase = ''
mkdir -p $out/include/kdtree++
cp -r $src/kdtree++/*.hpp $out/include/kdtree++/
mkdir -p $out/share/doc/libkdtree++
cp $src/doc/index.txt $out/share/doc/libkdtree++
cp -r documentation $out/share/doc/libkdtree++/
mkdir -p $out/share/doc/libkdtree++/examples
cp -r $src/examples/*.cpp $out/share/doc/libkdtree++/examples
'';
meta = with lib; {
description = "STL-like C++ template container implementatin of a kd-tree.";
longDescription = ''
STL-like C++ template container implementation of k-dimensional space
sorting, using a kd-tree.
It sports a theoretically unlimited number of dimensions, and can store
any data structure.
Fork of the project once available from http://libkdtree.alioth.debian.org/
'';
homepage = "https://github.com/nvmd/libkdtree/";
license = licenses.artistic2;
platforms = platforms.all;
};
})