1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 opusfile,
6 libogg,
7 SDL2,
8 openal,
9 freetype,
10 libjpeg,
11 curl,
12 makeWrapper,
13}:
14
15stdenv.mkDerivation rec {
16 pname = "iortcw-sp";
17 version = "1.51c";
18
19 src = fetchFromGitHub {
20 owner = "iortcw";
21 repo = "iortcw";
22 rev = version;
23 sha256 = "0g5wgqb1gm34pd05dj2i8nj3qhsz0831p3m7bsgxpjcg9c00jpyw";
24 };
25
26 enableParallelBuilding = true;
27
28 sourceRoot = "${src.name}/SP";
29
30 makeFlags = [
31 "USE_INTERNAL_LIBS=0"
32 "COPYDIR=${placeholder "out"}/opt/iortcw"
33 "USE_OPENAL_DLOPEN=0"
34 "USE_CURL_DLOPEN=0"
35 ];
36
37 installTargets = [ "copyfiles" ];
38
39 buildInputs = [
40 opusfile
41 libogg
42 SDL2
43 freetype
44 libjpeg
45 openal
46 curl
47 ];
48 nativeBuildInputs = [ makeWrapper ];
49
50 env.NIX_CFLAGS_COMPILE = toString [
51 "-I${lib.getInclude SDL2}/include/SDL2"
52 "-I${opusfile.dev}/include/opus"
53 ];
54 NIX_CFLAGS_LINK = [ "-lSDL2" ];
55
56 postInstall = ''
57 for i in `find $out/opt/iortcw -maxdepth 1 -type f -executable`; do
58 makeWrapper $i $out/bin/`basename $i` --chdir "$out/opt/iortcw"
59 done
60 '';
61
62 meta = with lib; {
63 description = "Single player version of game engine for Return to Castle Wolfenstein";
64 homepage = src.meta.homepage;
65 license = licenses.gpl3;
66 platforms = platforms.linux;
67 maintainers = with maintainers; [ rjpcasalino ];
68 };
69}