about summary refs log tree commit diff
path: root/nixpkgs/pkgs/games/teeworlds
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-02-07 15:19:21 +0000
committerAlyssa Ross <hi@alyssa.is>2019-02-07 23:35:47 +0000
commite5013c05a2f845255debf94318ab38ecef1c186b (patch)
treebec11a0bd31d3432a16899e5539f1098f1c168a4 /nixpkgs/pkgs/games/teeworlds
parent4fc07c92ec07cafcf6d56143ea7334693143ef88 (diff)
parent2d2f10475138b7206572dc3ec288184df2be022e (diff)
downloadnixlib-e5013c05a2f845255debf94318ab38ecef1c186b.tar
nixlib-e5013c05a2f845255debf94318ab38ecef1c186b.tar.gz
nixlib-e5013c05a2f845255debf94318ab38ecef1c186b.tar.bz2
nixlib-e5013c05a2f845255debf94318ab38ecef1c186b.tar.lz
nixlib-e5013c05a2f845255debf94318ab38ecef1c186b.tar.xz
nixlib-e5013c05a2f845255debf94318ab38ecef1c186b.tar.zst
nixlib-e5013c05a2f845255debf94318ab38ecef1c186b.zip
Merge commit '2d2f10475138b7206572dc3ec288184df2be022e'
Diffstat (limited to 'nixpkgs/pkgs/games/teeworlds')
-rw-r--r--nixpkgs/pkgs/games/teeworlds/default.nix36
1 files changed, 24 insertions, 12 deletions
diff --git a/nixpkgs/pkgs/games/teeworlds/default.nix b/nixpkgs/pkgs/games/teeworlds/default.nix
index 58b04821e129..846054765e00 100644
--- a/nixpkgs/pkgs/games/teeworlds/default.nix
+++ b/nixpkgs/pkgs/games/teeworlds/default.nix
@@ -1,30 +1,42 @@
-{ fetchurl, stdenv, cmake, pkgconfig, makeWrapper, python, alsaLib
-, libX11, libGLU, SDL, lua5, zlib, freetype, wavpack
+{ fetchFromGitHub, fetchurl, stdenv, bam, pkgconfig, makeWrapper, python, alsaLib
+, libX11, libGLU, SDL2, lua5_3, zlib, freetype, wavpack
 }:
 
 stdenv.mkDerivation rec {
-  name = "teeworlds-0.6.5";
+  name = "teeworlds-0.7.2";
 
-  src = fetchurl {
-    url = "https://downloads.teeworlds.com/teeworlds-0.6.5-src.tar.gz";
-    sha256 = "07llxjc47d1gd9jqj3vf08cmw26ha6189mwcix1khwa3frfbilqb";
+  src = fetchFromGitHub {
+    owner = "teeworlds";
+    repo = "teeworlds";
+    rev = "0.7.2";
+    sha256 = "15l988qcsqgb6rjais0qd5sd2rjanm2708jmzvkariqzz0d6pb93";
   };
 
   postPatch = ''
-    # we always want to use system libs instead of these
-    rm -r other/{freetype,sdl}/{include,mac,windows}
-
     # 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"'
   '';
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ bam pkgconfig ];
+
+  configurePhase = ''
+    bam config
+  '';
+
+  buildPhase = ''
+    bam conf=release
+  '';
 
+  installPhase = ''
+    mkdir -p $out/bin $out/share/teeworlds
+    cp build/x86_64/release/teeworlds{,_srv} $out/bin
+    cp -r build/x86_64/release/data $out/share/teeworlds
+  '';
 
   buildInputs = [
-    python alsaLib libX11 libGLU SDL lua5 zlib freetype wavpack
+    python alsaLib libX11 libGLU SDL2 lua5_3 zlib freetype wavpack
   ];
 
   postInstall = ''
@@ -45,6 +57,6 @@ stdenv.mkDerivation rec {
     homepage = https://teeworlds.com/;
     license = "BSD-style, see `license.txt'";
     maintainers = with stdenv.lib.maintainers; [ astsmtl ];
-    platforms = with stdenv.lib.platforms; linux;
+    platforms = ["x86_64-linux" "i686-linux"];
   };
 }