1 { lib, stdenv, fetchurl, fetchFromGitHub, fetchpatch, cmake, unzip, zip, file
2 , curl, glew , libGL, SDL2, SDL2_image, zlib, freetype, imagemagick
3 , openal , opusfile, libogg
7 stdenv.mkDerivation rec {
12 src = fetchFromGitHub {
16 sha256 = "1fvmqbif9fbipd0vphp57pk6blb4yp8xvqlc2ppipk5pjv6a3d2h";
19 nativeBuildInputs = [ cmake imagemagick unzip zip file ];
22 freetype SDL2 SDL2_image libGL zlib curl glew opusfile openal libogg libXext
23 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
28 # https://github.com/yvt/openspades/pull/793 fix Darwin build
30 url = "https://github.com/yvt/openspades/commit/2d13704fefc475b279337e89057b117f711a35d4.diff";
31 sha256 = "1i7rcpjzkjhbv5pp6byzrxv7sb1iamqq5k1vyqlvkbr38k2dz0rv";
36 "-DOPENSPADES_INSTALL_BINARY=bin"
40 url = "https://github.com/yvt/openspades-paks/releases/download/r${devPakVersion}/OpenSpadesDevPackage-r${devPakVersion}.zip";
41 sha256 = "1bd2fyn7mlxa3xnsvzj08xjzw02baimqvmnix07blfhb78rdq9q9";
45 url = "https://github.com/yvt/openspades/releases/download/v0.1.1b/NotoFonts.pak";
46 sha256 = "0kaz8j85wjjnf18z0lz69xr1z8makg30jn2dzdyicd1asrj0q1jm";
50 sed -i 's,^wget .*,cp $devPak "$PAK_NAME",' Resources/downloadpak.sh
51 patchShebangs Resources
55 cp $notoFont $out/share/games/openspades/Resources/
58 NIX_CFLAGS_LINK = "-lopenal";
61 description = "Compatible client of Ace of Spades 0.75";
62 mainProgram = "openspades";
63 homepage = "https://github.com/yvt/openspades/";
64 license = licenses.gpl3;
65 platforms = platforms.all;
66 maintainers = with maintainers; [ abbradar azahi ];
67 # never built on aarch64-linux since first introduction in nixpkgs
68 broken = stdenv.hostPlatform.isDarwin || (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);