forked from BlazingRenderer/BRender
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
57 lines (41 loc) · 1.45 KB
/
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
47
48
49
50
51
52
53
54
55
56
57
{ stdenv, version, cmake, perl, SDL2, makeBinaryWrapper }:
let
binExtension = "${stdenv.hostPlatform.extensions.executable}";
in
stdenv.mkDerivation rec {
inherit version;
pname = "brender-samples";
src = ./.;
nativeBuildInputs = [
cmake
perl
makeBinaryWrapper
];
passthru.SDL2 = SDL2; # 'cause it's so damned hard to debug with CMake
buildInputs = [
SDL2
];
installPhase = ''
mkdir -p $out/{bin,share/brender-samples/{robot,dat,tutorials}}
for i in 3ds2br dquery mkblend mkfog mkranges mkshades paljoin texconv matconv; do
cp tools/$i/$i${binExtension} $out/bin
done
for i in mkres robot cube devpmtest; do
cp examples/$i/$i${binExtension} $out/bin
done
cp ${src}/examples/robot/dat/* $out/share/brender-samples/robot
cp ${src}/examples/dat/* $out/share/brender-samples/dat
wrapProgram $out/bin/robot${binExtension} \
--chdir $out/share/brender-samples/robot
wrapProgram $out/bin/cube${binExtension} \
--set BRENDER_PATH $out/share/brender-samples/dat
wrapProgram $out/bin/devpmtest${binExtension} \
--set BRENDER_PATH $out/share/brender-samples/dat
cp ${src}/examples/tutorials/dat/* $out/share/brender-samples/tutorials
for i in {1,2,3,4,5,5b,6,6b,7,7b,8,8b,9,10}; do
cp examples/tutorials/brtutor$i${binExtension} $out/bin
wrapProgram $out/bin/brtutor$i${binExtension} \
--chdir $out/share/brender-samples/tutorials
done
'';
}