nixpkgs/pkgs/games/openspades/default.nix

60 lines
1.6 KiB
Nix
Raw Normal View History

2018-12-20 09:38:17 +00:00
{ stdenv, fetchurl, fetchFromGitHub, fetchpatch, cmake, unzip, zip, file
, curl, glew , libGL, SDL2, SDL2_image, zlib, freetype, imagemagick
, openal , opusfile, libogg
2018-12-20 09:38:17 +00:00
, Cocoa
}:
2014-06-27 17:21:17 +01:00
stdenv.mkDerivation rec {
name = "openspades-${version}";
version = "0.1.2";
devPakVersion = "33";
src = fetchFromGitHub {
owner = "yvt";
repo = "openspades";
rev = "v${version}";
sha256 = "1mfj46c3pnn1f6awy3b6faxs26i93a5jsrvkdlr12ndsykvi6ng6";
2014-06-27 17:21:17 +01:00
};
nativeBuildInputs = [ cmake imagemagick unzip zip file ];
2016-03-01 13:31:33 +00:00
buildInputs = [
freetype SDL2 SDL2_image libGL zlib curl glew opusfile openal libogg
2018-12-20 09:38:17 +00:00
] ++ stdenv.lib.optionals stdenv.hostPlatform.isDarwin [
Cocoa
];
patches = [
# https://github.com/yvt/openspades/pull/793 fix Darwin build
(fetchpatch {
url = "https://github.com/yvt/openspades/commit/2d13704fefc475b279337e89057b117f711a35d4.diff";
sha256 = "1i7rcpjzkjhbv5pp6byzrxv7sb1iamqq5k1vyqlvkbr38k2dz0rv";
})
];
2014-06-27 17:21:17 +01:00
cmakeFlags = [
"-DOPENSPADES_INSTALL_BINARY=bin"
];
2014-06-27 17:21:17 +01:00
devPak = fetchurl {
url = "https://github.com/yvt/openspades-paks/releases/download/r${devPakVersion}/OpenSpadesDevPackage-r${devPakVersion}.zip";
sha256 = "1bd2fyn7mlxa3xnsvzj08xjzw02baimqvmnix07blfhb78rdq9q9";
};
postPatch = ''
sed -i 's,^wget .*,cp $devPak "$PAK_NAME",' Resources/downloadpak.sh
patchShebangs Resources
'';
enableParallelBuilding = true;
NIX_CFLAGS_LINK = [ "-lopenal" ];
2014-06-27 17:21:17 +01:00
meta = with stdenv.lib; {
description = "A compatible client of Ace of Spades 0.75";
2014-06-27 17:21:17 +01:00
homepage = "https://github.com/yvt/openspades/";
license = licenses.gpl3;
2018-12-20 09:38:17 +00:00
platforms = platforms.all;
2014-06-27 17:21:17 +01:00
};
}