-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdefault.nix
61 lines (55 loc) · 1.62 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
58
59
60
61
with import <nixpkgs> {};
let
sdl_gpu = stdenv.mkDerivation rec {
name = "sdl_gpu-${version}";
version = "2018-07-28";
src = fetchFromGitHub {
owner = "grimfang4";
repo = "sdl-gpu";
rev = "dd982b9c7af9f9f7c8806d20cf29ff348f8ab937";
sha256 = "0xs72r26r4z8k2fxmk0na75zqr5z7a3mx1hsaz0qw81fpq3ad70j";
};
buildInputs = [ SDL2 libGL cmake libGLU ];
enableParallelBuilding = true;
};
libcurlpp = stdenv.mkDerivation rec {
name = "libcurlpp-${version}";
version = "2018-06-15";
src = fetchFromGitHub {
owner = "jpbarrette";
repo = "curlpp";
rev = "8810334c830faa3b38bcd94f5b1ab695a4f05eb9";
sha256 = "11yrsjcxdcana5pwx5sqc9k2gwr3v1li9bapc940cj83mg8fw0iy";
};
buildInputs = [ curl cmake ];
enableParallelBuilding = true;
};
in
stdenv.mkDerivation rec {
name = "riko4-${version}";
version = "2018-11-03";
src = ./.;
buildInputs = [ SDL2 luajit cmake curl sdl_gpu libcurlpp ];
hardeningDisable = [ "fortify" ];
cmakeFlags = [ "-DSDL2_gpu_INCLUDE_DIR=\"${sdl_gpu}/include\"" ];
makeFlags = [ "CXX_FLAGS+=-g" ];
dontStrip = true;
installPhase = ''
install -Dm0755 riko4 $out/bin/.riko4-unwrapped
mkdir -p $out/lib/riko4
cp -r ../data $out/lib/riko4
cp -r ../scripts $out/lib/riko4
cat > $out/bin/riko4 <<EOF
#!/bin/sh
pushd $out/lib/riko4 > /dev/null
../../bin/.riko4-unwrapped "\$@"
popd > /dev/null
EOF
chmod +x $out/bin/riko4
'';
enableParallelBuilding = true;
meta = with stdenv.lib; {
description = "Fantasy console for pixel art game development";
license = licenses.mit;
};
}