forked from nvmd/libkdtree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
46 lines (36 loc) · 973 Bytes
/
default.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
{ pkgs ? import <nixpkgs> {} }:
pkgs.stdenv.mkDerivation rec {
name = "libkdtree++";
# version = "0.7.2";
src = builtins.path { name = "libkdtree++"; path = ./.; };
nativeBuildInputs = with pkgs; [
cmake
doxygen
];
configurePhase = ''
mkdir -p build && cd build
cmake ..
'';
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
'';
}