diff options
author | Astro <astro@spaceboyz.net> | 2022-01-23 21:34:52 +0100 |
---|---|---|
committer | Astro <astro@spaceboyz.net> | 2022-01-28 20:37:58 +0100 |
commit | d0b90bd181c45ac2ec34124b1389ccf90f6a989d (patch) | |
tree | b0994232f1bfd0fb1d3c3a4adba57da1986e68a7 /pkgs/games/quake2 | |
parent | 8aeb279701fe867dc728e8dabab0a28a062ace84 (diff) |
yquake2: migrate from cmake to gnumake
See: https://github.com/yquake2/yquake2/commit/fb1a2b0ce7b249cd50990225cc484dc2a9f965de
Diffstat (limited to 'pkgs/games/quake2')
-rw-r--r-- | pkgs/games/quake2/yquake2/default.nix | 42 | ||||
-rw-r--r-- | pkgs/games/quake2/yquake2/games.nix | 6 |
2 files changed, 19 insertions, 29 deletions
diff --git a/pkgs/games/quake2/yquake2/default.nix b/pkgs/games/quake2/yquake2/default.nix index 3f758fbc8ea04..7d75b4cc1d8ec 100644 --- a/pkgs/games/quake2/yquake2/default.nix +++ b/pkgs/games/quake2/yquake2/default.nix @@ -1,15 +1,13 @@ -{ stdenv, lib, fetchFromGitHub, buildEnv, cmake, makeWrapper +{ stdenv, lib, fetchFromGitHub, buildEnv, makeWrapper , SDL2, libGL, curl -, oggSupport ? true, libogg, libvorbis , openalSupport ? true, openal -, zipSupport ? true, zlib , Cocoa, OpenAL }: let - mkFlag = b: if b then "ON" else "OFF"; + mkFlag = b: if b then "yes" else "no"; - games = import ./games.nix { inherit stdenv lib fetchFromGitHub cmake; }; + games = import ./games.nix { inherit stdenv lib fetchFromGitHub; }; wrapper = import ./wrapper.nix { inherit stdenv lib buildEnv makeWrapper yquake2; }; @@ -25,39 +23,33 @@ let }; postPatch = '' - substituteInPlace src/common/filesystem.c \ - --replace /usr/share/games/quake2 $out/share/games/quake2 + substituteInPlace src/client/curl/qcurl.c \ + --replace "\"libcurl.so.3\", \"libcurl.so.4\"" "\"${curl.out}/lib/libcurl.so\", \"libcurl.so.3\", \"libcurl.so.4\"" + '' + lib.optionalString (openalSupport && !stdenv.isDarwin) '' + substituteInPlace Makefile \ + --replace "\"libopenal.so.1\"" "\"${openal}/lib/libopenal.so.1\"" ''; - nativeBuildInputs = [ cmake ]; - buildInputs = [ SDL2 libGL curl ] ++ lib.optionals stdenv.isDarwin [ Cocoa OpenAL ] - ++ lib.optionals oggSupport [ libogg libvorbis ] - ++ lib.optional openalSupport openal - ++ lib.optional zipSupport zlib; - - cmakeFlags = [ - "-DCMAKE_BUILD_TYPE=Release" - "-DOGG_SUPPORT=${mkFlag oggSupport}" - "-DOPENAL_SUPPORT=${mkFlag openalSupport}" - "-DZIP_SUPPORT=${mkFlag zipSupport}" - "-DSYSTEMWIDE_SUPPORT=ON" + ++ lib.optional openalSupport openal; + + makeFlags = [ + "WITH_OPENAL=${mkFlag openalSupport}" + "WITH_SYSTEMWIDE=yes" + "WITH_SYSTEMDIR=$\{out}/share/games/quake2" ]; - preConfigure = '' - # Since we can't expand $out in `cmakeFlags` - cmakeFlags="$cmakeFlags -DSYSTEMDIR=$out/share/games/quake2" - ''; + enableParallelBuilding = true; installPhase = '' # Yamagi Quake II expects all binaries (executables and libs) to be in the # same directory. - mkdir -p $out/bin $out/lib/yquake2 $out/share/games/quake2 + mkdir -p $out/bin $out/lib/yquake2 $out/share/games/quake2/baseq2 cp -r release/* $out/lib/yquake2 ln -s $out/lib/yquake2/quake2 $out/bin/yquake2 ln -s $out/lib/yquake2/q2ded $out/bin/yq2ded - cp $src/stuff/yq2.cfg $out/share/games/quake2 + cp $src/stuff/yq2.cfg $out/share/games/quake2/baseq2 ''; meta = with lib; { diff --git a/pkgs/games/quake2/yquake2/games.nix b/pkgs/games/quake2/yquake2/games.nix index 0c9b24963ba7e..c78689971a63e 100644 --- a/pkgs/games/quake2/yquake2/games.nix +++ b/pkgs/games/quake2/yquake2/games.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchFromGitHub, cmake }: +{ stdenv, lib, fetchFromGitHub }: let games = { @@ -37,11 +37,9 @@ let rev = "${lib.toUpper id}_${builtins.replaceStrings ["."] ["_"] version}"; }; - nativeBuildInputs = [ cmake ]; - installPhase = '' mkdir -p $out/lib/yquake2/${id} - cp Release/* $out/lib/yquake2/${id} + cp release/* $out/lib/yquake2/${id} ''; meta = with lib; { |