python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / games / srb2kart / default.nix
blobcb68125addaac9f2db9fce9a2466a8aa9adfba6c
1 { lib
2 , stdenv
3 , fetchurl
4 , fetchFromGitHub
5 , substituteAll
6 , cmake
7 , curl
8 , nasm
9 , unzip
10 , game-music-emu
11 , libpng
12 , SDL2
13 , SDL2_mixer
14 , zlib
17 let
19 release_tag = "v1.3";
21 installer = fetchurl {
22   url = "https://github.com/STJr/Kart-Public/releases/download/${release_tag}/srb2kart-v13-Installer.exe";
23   sha256 = "0bk36y7wf6xfdg6j0b8qvk8671hagikzdp5nlfqg478zrj0qf6cs";
26 in stdenv.mkDerivation rec {
27   pname = "srb2kart";
28   version = "1.3.0";
30   src = fetchFromGitHub {
31     owner = "STJr";
32     repo = "Kart-Public";
33     rev = release_tag;
34     sha256 = "131g9bmc9ihvz0klsc3yzd0pnkhx3mz1vzm8y7nrrsgdz5278y49";
35   };
37   nativeBuildInputs = [
38     cmake
39     nasm
40     unzip
41   ];
43   buildInputs = [
44     curl
45     game-music-emu
46     libpng
47     SDL2
48     SDL2_mixer
49     zlib
50   ];
52   cmakeFlags = [
53     #"-DSRB2_ASSET_DIRECTORY=/build/source/assets"
54     "-DGME_INCLUDE_DIR=${game-music-emu}/include"
55     "-DSDL2_MIXER_INCLUDE_DIR=${lib.getDev SDL2_mixer}/include/SDL2"
56     "-DSDL2_INCLUDE_DIR=${lib.getDev SDL2}/include/SDL2"
57   ];
59   patches = [
60     ./wadlocation.patch
61   ];
63   postPatch = ''
64     substituteInPlace src/sdl/i_system.c \
65         --replace '@wadlocation@' $out
66   '';
68   preConfigure = ''
69     mkdir assets/installer
70     pushd assets/installer
71     unzip ${installer} "*.kart" srb2.srb
72     popd
73   '';
75   postInstall = ''
76     mkdir -p $out/bin $out/share/games/SRB2Kart
77     mv $out/srb2kart* $out/bin/
78     mv $out/*.kart $out/share/games/SRB2Kart
79   '';
81   meta = with lib; {
82     description = "SRB2Kart is a classic styled kart racer";
83     homepage = "https://mb.srb2.org/threads/srb2kart.25868/";
84     platforms = platforms.linux;
85     license = licenses.gpl2Plus;
86     maintainers = with maintainers; [ viric ];
87   };