summary refs log tree commit diff
path: root/pkgs/games/openspades
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2017-03-03 00:20:19 +0300
committerNikolay Amiantov <ab@fmap.me>2017-03-03 00:34:36 +0300
commitcb13a8c5f839da09c67020b346f899d762d4c75e (patch)
tree37286809c6d0022f573467abc252ebc1366cc47c /pkgs/games/openspades
parentb923fd5253d797b95b2ce617217954416d827d66 (diff)
downloadnixpkgs-cb13a8c5f839da09c67020b346f899d762d4c75e.tar
nixpkgs-cb13a8c5f839da09c67020b346f899d762d4c75e.tar.gz
nixpkgs-cb13a8c5f839da09c67020b346f899d762d4c75e.tar.bz2
nixpkgs-cb13a8c5f839da09c67020b346f899d762d4c75e.tar.lz
nixpkgs-cb13a8c5f839da09c67020b346f899d762d4c75e.tar.xz
nixpkgs-cb13a8c5f839da09c67020b346f899d762d4c75e.tar.zst
nixpkgs-cb13a8c5f839da09c67020b346f899d762d4c75e.zip
openspades: 0.0.12 -> 0.1.1b
Remove openspades-git, it's not needed now that there was a release.
Diffstat (limited to 'pkgs/games/openspades')
-rw-r--r--pkgs/games/openspades/default.nix56
-rw-r--r--pkgs/games/openspades/git.nix48
2 files changed, 25 insertions, 79 deletions
diff --git a/pkgs/games/openspades/default.nix b/pkgs/games/openspades/default.nix
index 0438b687a1b..02e4e9c608f 100644
--- a/pkgs/games/openspades/default.nix
+++ b/pkgs/games/openspades/default.nix
@@ -1,49 +1,43 @@
-{ stdenv, lib, fetchurl, cmake, curl, glew, makeWrapper, mesa, SDL2,
-  SDL2_image, unzip, wget, zlib, withOpenal ? true, openal ? null }:
-
-assert withOpenal -> openal != null;
+{ stdenv, lib, fetchurl, fetchFromGitHub, cmake, unzip, zip, file
+, curl, glew , mesa_noglu, SDL2, SDL2_image, zlib, freetype, imagemagick
+, openal , opusfile, libogg
+}:
 
 stdenv.mkDerivation rec {
   name = "openspades-${version}";
-  version = "0.0.12";
-
-  src = fetchurl {
-    url = "https://github.com/yvt/openspades/archive/v${version}.tar.gz";
-    sha256 = "1aa848cck8qrp67ha9vrkzm3k24r2aiv1v4dxla6pi22rw98yxzm";
+  version = "0.1.1b";
+  devPakVersion = "33";
+
+  src = fetchFromGitHub {
+    owner = "yvt";
+    repo = "openspades";
+    rev = "v${version}";
+    sha256 = "1xk3il5ykxg68hvwb42kpspcxppdib7y3ysaxb8anmmcsk1m3drn";
   };
 
-  # https://github.com/yvt/openspades/issues/354
-  postPatch = ''
-    substituteInPlace Sources/Client/Client_Input.cpp --replace "isnan(" "std::isnan("
-    substituteInPlace Sources/Client/Corpse.cpp --replace "isnan(" "std::isnan("
-    substituteInPlace Sources/Draw/SWMapRenderer.cpp \
-      --replace "isnan(" "std::isnan(" --replace "isinf(" "std::isinf("
-    sed '1i#include <cmath>' -i Sources/Client/{Player,Client_Input,Corpse}.cpp \
-      -i Sources/Draw/SWMapRenderer.cpp
-    sed '1i#include <math.h>' -i Sources/Draw/SWFeatureLevel.h
-  '';
+  nativeBuildInputs = [ cmake imagemagick unzip zip file ];
 
-  nativeBuildInputs =
-    [ cmake curl glew makeWrapper mesa SDL2 SDL2_image unzip wget zlib ]
-    ++ lib.optional withOpenal openal;
+  buildInputs = [
+    freetype SDL2 SDL2_image mesa_noglu zlib curl glew opusfile openal libogg
+  ];
 
   cmakeFlags = [
     "-DOPENSPADES_INSTALL_BINARY=bin"
-    "-DOPENSPADES_RESOURCES=NO"
   ];
 
-  enableParallelBuilding = true;
-
-  devPack = fetchurl {
-    url = "http://yvt.jp/files/programs/osppaks/DevPaks27.zip";
-    sha256 = "05y7wldg70v5ys41fm0c8kipyspn524z4pglwr3p8h0gfz9n52v6";
+  devPak = fetchurl {
+    url = "https://github.com/yvt/openspades-paks/releases/download/r${devPakVersion}/OpenSpadesDevPackage-r${devPakVersion}.zip";
+    sha256 = "1bd2fyn7mlxa3xnsvzj08xjzw02baimqvmnix07blfhb78rdq9q9";
   };
 
-  preBuild = ''
-    unzip -u -o $devPack -d Resources/DevPak
+  postPatch = ''
+    sed -i 's,^wget .*,cp $devPak "$PAK_NAME",' Resources/downloadpak.sh
+    patchShebangs Resources
   '';
 
-  NIX_CFLAGS_LINK = lib.optional withOpenal "-lopenal";
+  enableParallelBuilding = true;
+
+  NIX_CFLAGS_LINK = [ "-lopenal" ];
 
   meta = with stdenv.lib; {
     description = "A compatible client of Ace of Spades 0.75";
diff --git a/pkgs/games/openspades/git.nix b/pkgs/games/openspades/git.nix
deleted file mode 100644
index 9e3d4ac5b64..00000000000
--- a/pkgs/games/openspades/git.nix
+++ /dev/null
@@ -1,48 +0,0 @@
-{ stdenv, lib, fetchurl, fetchFromGitHub, cmake, curl, glew, makeWrapper, mesa, SDL2,
-  SDL2_image, unzip, wget, zlib, withOpenal ? true, openal ? null }:
-
-assert withOpenal -> openal != null;
-
-stdenv.mkDerivation rec {
-  name = "openspades-${version}";
-  version = "2016-04-17";
-
-  src = fetchFromGitHub {
-    owner = "yvt";
-    repo = "openspades";
-    rev = "cadc0b6a57fbee05abcaf42d15664502c94b58cf";
-    sha256 = "0vyvmgim03q8pcmfa1i0njr4w1lpjq5g3b47f67v9b5c5jcjycwn";
-  };
-
-  postPatch = "sed '1i#include <cmath>' -i Sources/Client/{,Client}Player.cpp";
-
-  nativeBuildInputs =
-    with stdenv.lib;
-    [ cmake curl glew makeWrapper mesa SDL2 SDL2_image unzip wget zlib ]
-    ++ lib.optional withOpenal openal;
-
-  cmakeFlags = [
-    "-DOPENSPADES_INSTALL_BINARY=bin"
-    "-DOPENSPADES_RESOURCES=NO"
-  ];
-
-  #enableParallelBuilding = true;
-
-  devPack = fetchurl {
-    url = "http://yvt.jp/files/programs/osppaks/DevPaks29.zip";
-    sha256 = "1fhwxm6wifg0l3ykmiiqa1h4ch5ika2kw2j0v9xnrz24cabsi6cc";
-  };
-
-  preBuild = ''
-    unzip -u -o $devPack -d Resources/DevPak
-  '';
-
-  NIX_CFLAGS_LINK = lib.optional withOpenal "-lopenal";
-
-  meta = with stdenv.lib; {
-    description = "A compatible client of Ace of Spades 0.75";
-    homepage    = "https://github.com/yvt/openspades/";
-    license     = licenses.gpl3;
-    platforms   = platforms.linux;
-  };
-}