From 628c8e89950bc493d5002794323d074dab8e79d2 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Sat, 7 May 2016 11:58:46 +0300 Subject: [PATCH] openspades-git: init at 2016-04-17 --- pkgs/games/openspades/git.nix | 44 +++++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 46 insertions(+) create mode 100644 pkgs/games/openspades/git.nix diff --git a/pkgs/games/openspades/git.nix b/pkgs/games/openspades/git.nix new file mode 100644 index 000000000000..aeddbf43cdea --- /dev/null +++ b/pkgs/games/openspades/git.nix @@ -0,0 +1,44 @@ +{ 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"; + }; + + nativeBuildInputs = + with stdenv.lib; + [ cmake curl glew makeWrapper mesa SDL2 SDL2_image unzip wget zlib ] + ++ lib.optional withOpenal openal; + + cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" "-DOPENSPADES_INSTALL_BINARY=bin" "-DOPENSPADES_RESOURCES=NO" ]; + + #enableParallelBuilding = true; + + devPack = fetchurl { + url = "http://yvt.jp/files/programs/osppaks/DevPaks29.zip"; + sha256 = "1fhwxm6wifg0l3ykmiiqa1h4ch5ika2kw2j0v9xnrz24cabsi6cc"; + }; + + preBuild = '' + cat > Resources/downloadpak.sh + 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; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a318b982f271..bf4101c25482 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15047,6 +15047,8 @@ in openspades = callPackage ../games/openspades {}; + openspades-git = lowPrio (callPackage ../games/openspades/git.nix {}); + openttd = callPackage ../games/openttd { zlib = zlibStatic; };