summary refs log tree commit diff
path: root/pkgs/games/teeworlds
diff options
context:
space:
mode:
authorWill Dietz <w@wdtz.org>2018-10-16 01:13:22 -0500
committerWill Dietz <w@wdtz.org>2018-10-16 01:42:14 -0500
commit18258bae34ad16e808a2f5447962008d082fd19f (patch)
treec4fb6f901233702b84d0b73ee25b5798d6048ab8 /pkgs/games/teeworlds
parent8a3a91f29b4a517c540bee42f01701762243f808 (diff)
downloadnixpkgs-18258bae34ad16e808a2f5447962008d082fd19f.tar
nixpkgs-18258bae34ad16e808a2f5447962008d082fd19f.tar.gz
nixpkgs-18258bae34ad16e808a2f5447962008d082fd19f.tar.bz2
nixpkgs-18258bae34ad16e808a2f5447962008d082fd19f.tar.lz
nixpkgs-18258bae34ad16e808a2f5447962008d082fd19f.tar.xz
nixpkgs-18258bae34ad16e808a2f5447962008d082fd19f.tar.zst
nixpkgs-18258bae34ad16e808a2f5447962008d082fd19f.zip
teeworlds: 0.6.4 -> 0.6.5
This release adds support for building with cmake!
So switch to that eagerly instead of fighting with bam.

(if nothing else cmake is the devil we know...)

Also:

* fixup 'DATA_DIR' so programs can find resources
  (without need for wrappers)
* install readme+license as previously done ("docs")
* don't install tools since not built or installed by default
  * esp since doesn't appear to have non-adhoc method for installation
  * other distros don't seem to include
Diffstat (limited to 'pkgs/games/teeworlds')
-rw-r--r--pkgs/games/teeworlds/default.nix57
1 files changed, 19 insertions, 38 deletions
diff --git a/pkgs/games/teeworlds/default.nix b/pkgs/games/teeworlds/default.nix
index 7c5074c0708..58b04821e12 100644
--- a/pkgs/games/teeworlds/default.nix
+++ b/pkgs/games/teeworlds/default.nix
@@ -1,54 +1,35 @@
-{ fetchurl, stdenv, makeWrapper, python, alsaLib
-, libX11, libGLU, SDL, lua5, zlib, bam, freetype
+{ fetchurl, stdenv, cmake, pkgconfig, makeWrapper, python, alsaLib
+, libX11, libGLU, SDL, lua5, zlib, freetype, wavpack
 }:
 
 stdenv.mkDerivation rec {
-  name = "teeworlds-0.6.4";
+  name = "teeworlds-0.6.5";
 
   src = fetchurl {
-    url = "https://downloads.teeworlds.com/teeworlds-0.6.4-src.tar.gz";
-    sha256 = "1qlqzp4wqh1vnip081lbsjnx5jj5m5y4msrcm8glbd80pfgd2qf2";
+    url = "https://downloads.teeworlds.com/teeworlds-0.6.5-src.tar.gz";
+    sha256 = "07llxjc47d1gd9jqj3vf08cmw26ha6189mwcix1khwa3frfbilqb";
   };
 
-  # we always want to use system libs instead of these
-  postPatch = "rm -r other/{freetype,sdl}/{include,lib32,lib64}";
+  postPatch = ''
+    # we always want to use system libs instead of these
+    rm -r other/{freetype,sdl}/{include,mac,windows}
 
-  buildInputs = [
-    python makeWrapper alsaLib libX11 libGLU SDL lua5 zlib bam freetype
-  ];
-
-  buildPhase = ''
-    bam -a -v release
+    # set compiled-in DATA_DIR so resources can be found
+    substituteInPlace src/engine/shared/storage.cpp \
+      --replace '#define DATA_DIR "data"' \
+                '#define DATA_DIR "${placeholder "out"}/share/teeworlds/data"'
   '';
 
-  installPhase = ''
-    # Copy the graphics, sounds, etc.
-    mkdir -p "$out/share/${name}"
-    cp -rv data other/icons "$out/share/${name}"
+  nativeBuildInputs = [ cmake pkgconfig ];
 
-    # Copy the executables (client, server, etc.).
-    mkdir -p "$out/bin"
-    executables=""
-    for file in *
-    do
-      if [ -f "$file" ] && [ -x "$file" ]
-      then
-          executables="$file $executables"
-      fi
-    done
-    cp -v $executables "$out/bin"
 
-    # Make sure the programs are executed from the right directory so
-    # that they can access the graphics and sounds.
-    for program in $executables
-    do
-      wrapProgram $out/bin/$program \
-        --run "cd $out/share/${name}"
-    done
+  buildInputs = [
+    python alsaLib libX11 libGLU SDL lua5 zlib freetype wavpack
+  ];
 
-    # Copy the documentation.
-    mkdir -p "$out/doc/${name}"
-    cp -v *.txt "$out/doc/${name}"
+  postInstall = ''
+    mkdir -p $out/share/doc/teeworlds
+    cp -v *.txt $out/share/doc/teeworlds/
   '';
 
   meta = {