19 mkFlag = b: if b then "yes" else "no";
21 games = import ./games.nix { inherit stdenv lib fetchFromGitHub; };
23 wrapper = import ./wrapper.nix {
35 yquake2 = stdenv.mkDerivation rec {
39 src = fetchFromGitHub {
42 rev = "QUAKE2_${builtins.replaceStrings [ "." ] [ "_" ] version}";
43 sha256 = "sha256-8xvY8XYZJa/gAVcxR+ffpE8naUTbGyM8AyAdpG6nKtA=";
48 substituteInPlace src/client/curl/qcurl.c \
49 --replace "\"libcurl.so.3\", \"libcurl.so.4\"" "\"${curl.out}/lib/libcurl.so\", \"libcurl.so.3\", \"libcurl.so.4\""
51 + lib.optionalString (openalSupport && !stdenv.hostPlatform.isDarwin) ''
52 substituteInPlace Makefile \
53 --replace "\"libopenal.so.1\"" "\"${openal}/lib/libopenal.so.1\""
62 ++ lib.optionals stdenv.hostPlatform.isDarwin [
66 ++ lib.optional openalSupport openal;
69 "WITH_OPENAL=${mkFlag openalSupport}"
71 "WITH_SYSTEMDIR=$\{out}/share/games/quake2"
74 nativeBuildInputs = [ copyDesktopItems ];
76 enableParallelBuilding = true;
80 # Yamagi Quake II expects all binaries (executables and libs) to be in the
82 mkdir -p $out/bin $out/lib/yquake2 $out/share/games/quake2/baseq2
83 cp -r release/* $out/lib/yquake2
84 ln -s $out/lib/yquake2/quake2 $out/bin/yquake2
85 ln -s $out/lib/yquake2/q2ded $out/bin/yq2ded
86 cp $src/stuff/yq2.cfg $out/share/games/quake2/baseq2
87 install -Dm644 stuff/icon/Quake2.png $out/share/pixmaps/yamagi-quake2.png;
95 icon = "yamagi-quake2";
96 desktopName = "yquake2";
97 comment = "Yamagi Quake II client";
106 description = "Yamagi Quake II client";
107 homepage = "https://www.yamagi.org/quake2/";
108 license = licenses.gpl2Plus;
109 platforms = platforms.unix;
110 maintainers = with maintainers; [ tadfisher ];
118 yquake2-ctf = wrapper {
119 games = [ games.ctf ];
120 name = "yquake2-ctf";
121 inherit (games.ctf) description;
124 yquake2-ground-zero = wrapper {
125 games = [ games.ground-zero ];
126 name = "yquake2-ground-zero";
127 inherit (games.ground-zero) description;
130 yquake2-the-reckoning = wrapper {
131 games = [ games.the-reckoning ];
132 name = "yquake2-the-reckoning";
133 inherit (games.the-reckoning) description;
136 yquake2-all-games = wrapper {
137 games = lib.attrValues games;
138 name = "yquake2-all-games";
139 description = "Yamagi Quake II with all add-on games";