2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, fetchurl, fetchFromGitHub, fetchpatch, cmake, unzip, zip, file
|
2018-02-24 13:06:44 +01:00
|
|
|
, curl, glew , libGL, SDL2, SDL2_image, zlib, freetype, imagemagick
|
2017-03-02 22:20:19 +01:00
|
|
|
, openal , opusfile, libogg
|
2022-09-04 00:22:11 +02:00
|
|
|
, Cocoa, libXext
|
2017-03-02 22:20:19 +01:00
|
|
|
}:
|
2014-06-27 18:21:17 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "openspades";
|
2019-06-03 17:30:20 +02:00
|
|
|
version = "0.1.3";
|
2017-03-02 22:20:19 +01:00
|
|
|
devPakVersion = "33";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "yvt";
|
|
|
|
repo = "openspades";
|
|
|
|
rev = "v${version}";
|
2019-06-03 17:30:20 +02:00
|
|
|
sha256 = "1fvmqbif9fbipd0vphp57pk6blb4yp8xvqlc2ppipk5pjv6a3d2h";
|
2014-06-27 18:21:17 +02:00
|
|
|
};
|
|
|
|
|
2017-03-02 22:20:19 +01:00
|
|
|
nativeBuildInputs = [ cmake imagemagick unzip zip file ];
|
2016-03-01 14:31:33 +01:00
|
|
|
|
2017-03-02 22:20:19 +01:00
|
|
|
buildInputs = [
|
2022-09-04 00:22:11 +02:00
|
|
|
freetype SDL2 SDL2_image libGL zlib curl glew opusfile openal libogg libXext
|
2021-01-15 05:31:39 +01:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2018-12-20 10:38:17 +01:00
|
|
|
Cocoa
|
|
|
|
];
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# https://github.com/yvt/openspades/pull/793 fix Darwin build
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/yvt/openspades/commit/2d13704fefc475b279337e89057b117f711a35d4.diff";
|
|
|
|
sha256 = "1i7rcpjzkjhbv5pp6byzrxv7sb1iamqq5k1vyqlvkbr38k2dz0rv";
|
|
|
|
})
|
2017-03-02 22:20:19 +01:00
|
|
|
];
|
2014-06-27 18:21:17 +02:00
|
|
|
|
2016-08-25 23:11:27 +02:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DOPENSPADES_INSTALL_BINARY=bin"
|
|
|
|
];
|
2014-06-27 18:21:17 +02:00
|
|
|
|
2017-03-02 22:20:19 +01:00
|
|
|
devPak = fetchurl {
|
|
|
|
url = "https://github.com/yvt/openspades-paks/releases/download/r${devPakVersion}/OpenSpadesDevPackage-r${devPakVersion}.zip";
|
|
|
|
sha256 = "1bd2fyn7mlxa3xnsvzj08xjzw02baimqvmnix07blfhb78rdq9q9";
|
2014-08-26 11:48:02 +02:00
|
|
|
};
|
|
|
|
|
2019-06-03 17:30:20 +02:00
|
|
|
notoFont = fetchurl {
|
|
|
|
url = "https://github.com/yvt/openspades/releases/download/v0.1.1b/NotoFonts.pak";
|
|
|
|
sha256 = "0kaz8j85wjjnf18z0lz69xr1z8makg30jn2dzdyicd1asrj0q1jm";
|
|
|
|
};
|
|
|
|
|
2017-03-02 22:20:19 +01:00
|
|
|
postPatch = ''
|
|
|
|
sed -i 's,^wget .*,cp $devPak "$PAK_NAME",' Resources/downloadpak.sh
|
|
|
|
patchShebangs Resources
|
2014-08-26 11:48:02 +02:00
|
|
|
'';
|
|
|
|
|
2019-06-03 17:30:20 +02:00
|
|
|
postInstall = ''
|
|
|
|
cp $notoFont $out/share/games/openspades/Resources/
|
|
|
|
'';
|
|
|
|
|
2019-10-30 12:34:47 +01:00
|
|
|
NIX_CFLAGS_LINK = "-lopenal";
|
2014-06-27 18:21:17 +02:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2014-08-24 16:21:08 +02:00
|
|
|
description = "A compatible client of Ace of Spades 0.75";
|
2014-06-27 18:21:17 +02:00
|
|
|
homepage = "https://github.com/yvt/openspades/";
|
|
|
|
license = licenses.gpl3;
|
2018-12-20 10:38:17 +01:00
|
|
|
platforms = platforms.all;
|
2022-09-04 00:22:11 +02:00
|
|
|
maintainers = with maintainers; [ abbradar azahi ];
|
2022-12-06 21:47:40 +01:00
|
|
|
# never built on aarch64-linux since first introduction in nixpkgs
|
|
|
|
broken = stdenv.isDarwin || (stdenv.isLinux && stdenv.isAarch64);
|
2014-06-27 18:21:17 +02:00
|
|
|
};
|
|
|
|
}
|