2022-05-08 22:40:50 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, fetchFromGitHub
|
|
|
|
, substituteAll
|
|
|
|
, cmake
|
|
|
|
, curl
|
|
|
|
, nasm
|
|
|
|
, unzip
|
2022-07-20 14:18:25 +00:00
|
|
|
, game-music-emu
|
2022-05-08 22:40:50 +00:00
|
|
|
, libpng
|
|
|
|
, SDL2
|
|
|
|
, SDL2_mixer
|
|
|
|
, zlib
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
|
2023-05-29 04:39:41 +00:00
|
|
|
release_tag = "v1.6";
|
2022-05-08 22:40:50 +00:00
|
|
|
|
2023-05-29 04:39:41 +00:00
|
|
|
assets = fetchurl {
|
|
|
|
url = "https://github.com/STJr/Kart-Public/releases/download/${release_tag}/AssetsLinuxOnly.zip";
|
|
|
|
sha256 = "sha256-ejhPuZ1C8M9B0S4+2HN1T5pbormT1eVL3nlivqOszdE=";
|
|
|
|
};
|
2022-05-08 22:40:50 +00:00
|
|
|
|
2023-05-29 04:39:41 +00:00
|
|
|
in stdenv.mkDerivation {
|
2022-05-08 22:40:50 +00:00
|
|
|
pname = "srb2kart";
|
2023-05-29 04:39:41 +00:00
|
|
|
version = "1.6.0";
|
2022-05-08 22:40:50 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "STJr";
|
|
|
|
repo = "Kart-Public";
|
|
|
|
rev = release_tag;
|
2023-05-29 04:39:41 +00:00
|
|
|
sha256 = "sha256-5sIHdeenWZjczyYM2q+F8Y1SyLqL+y77yxYDUM3dVA0=";
|
2022-05-08 22:40:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
nasm
|
|
|
|
unzip
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
curl
|
2022-07-20 14:18:25 +00:00
|
|
|
game-music-emu
|
2022-05-08 22:40:50 +00:00
|
|
|
libpng
|
|
|
|
SDL2
|
|
|
|
SDL2_mixer
|
|
|
|
zlib
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
2022-07-20 14:18:25 +00:00
|
|
|
"-DGME_INCLUDE_DIR=${game-music-emu}/include"
|
2022-09-18 10:48:40 +00:00
|
|
|
"-DSDL2_MIXER_INCLUDE_DIR=${lib.getDev SDL2_mixer}/include/SDL2"
|
|
|
|
"-DSDL2_INCLUDE_DIR=${lib.getDev SDL2}/include/SDL2"
|
2022-05-08 22:40:50 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
./wadlocation.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/sdl/i_system.c \
|
|
|
|
--replace '@wadlocation@' $out
|
|
|
|
'';
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
mkdir assets/installer
|
|
|
|
pushd assets/installer
|
2023-05-29 04:39:41 +00:00
|
|
|
unzip ${assets} "*.kart" srb2.srb
|
2022-05-08 22:40:50 +00:00
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/bin $out/share/games/SRB2Kart
|
|
|
|
mv $out/srb2kart* $out/bin/
|
|
|
|
mv $out/*.kart $out/share/games/SRB2Kart
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "SRB2Kart is a classic styled kart racer";
|
|
|
|
homepage = "https://mb.srb2.org/threads/srb2kart.25868/";
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = with maintainers; [ viric ];
|
|
|
|
};
|
|
|
|
}
|