forked from Grumbel/sdl-jstest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sdl-jstest.nix
62 lines (51 loc) · 1.09 KB
/
sdl-jstest.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
62
{ self
, stdenv
, lib
, SDL
, SDL2
, ncurses
, cmake
, pkg-config
, appstream-glib
, mcfgthreads
, tinycmmc
, sdl_gamecontrollerdb
}:
stdenv.mkDerivation {
pname = "sdl-jstest";
version = "0.2.2";
src = ./.;
doCheck = true;
cmakeFlags = [
"-DWARNINGS=ON"
"-DWERROR=ON"
"-DBUILD_TESTS=ON"
];
patchPhase = ''
# Nix behaves differently on a dirty git repository than on a clean one,
# so we have to check.
if [ -d external/sdl_gamecontrollerdb ]; then
rmdir external/sdl_gamecontrollerdb
fi
ln -s "${sdl_gamecontrollerdb}" external/sdl_gamecontrollerdb
'';
postFixup = ''
'' + (lib.optionalString stdenv.targetPlatform.isWindows ''
mkdir -p $out/bin/
find ${stdenv.cc.cc} -iname "*.dll" -exec ln -sfv {} $out/bin/ \;
find ${mcfgthreads} -iname "*.dll" -exec ln -sfv {} $out/bin/ \;
ln -sfv ${SDL2}/bin/*.dll $out/bin/
ln -sfv ${SDL}/bin/*.dll $out/bin/
ln -sfv ${ncurses.dev}/bin/*.dll $out/bin/
'');
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
SDL
SDL2
ncurses
tinycmmc
];
}