nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at netboot-syslinux-multiplatform 93 lines 2.0 kB view raw
1{ lib 2, stdenv 3, fetchurl 4, fetchFromGitHub 5, substituteAll 6, cmake 7, curl 8, nasm 9, libopenmpt 10, p7zip 11, game-music-emu 12, libpng 13, SDL2 14, SDL2_mixer 15, zlib 16}: 17 18let 19 20assets_version = "2.2.5"; 21 22assets = fetchurl { 23 url = "https://github.com/mazmazz/SRB2/releases/download/SRB2_assets_220/srb2-${assets_version}-assets.7z"; 24 sha256 = "1m9xf3vraq9nipsi09cyvvfa4i37gzfxg970rnqfswd86z9v6v00"; 25}; 26 27assets_optional = fetchurl { 28 url = "https://github.com/mazmazz/SRB2/releases/download/SRB2_assets_220/srb2-${assets_version}-optional-assets.7z"; 29 sha256 = "1j29jrd0r1k2bb11wyyl6yv9b90s2i6jhrslnh77qkrhrwnwcdz4"; 30}; 31 32in stdenv.mkDerivation rec { 33 pname = "srb2"; 34 version = "2.2.10"; 35 36 src = fetchFromGitHub { 37 owner = "STJr"; 38 repo = "SRB2"; 39 rev = "SRB2_release_${version}"; 40 sha256 = "03388n094d2yr5si6ngnggbqhm8b2l0s0qvfnkz49li9bd6a81gg"; 41 }; 42 43 nativeBuildInputs = [ 44 cmake 45 nasm 46 p7zip 47 ]; 48 49 buildInputs = [ 50 curl 51 game-music-emu 52 libpng 53 libopenmpt 54 SDL2 55 SDL2_mixer 56 zlib 57 ]; 58 59 cmakeFlags = [ 60 "-DSRB2_ASSET_DIRECTORY=/build/source/assets" 61 "-DGME_INCLUDE_DIR=${game-music-emu}/include" 62 "-DOPENMPT_INCLUDE_DIR=${libopenmpt.dev}/include" 63 "-DSDL2_MIXER_INCLUDE_DIR=${lib.getDev SDL2_mixer}/include/SDL2" 64 "-DSDL2_INCLUDE_DIR=${lib.getDev SDL2}/include/SDL2" 65 ]; 66 67 patches = [ 68 ./wadlocation.patch 69 ]; 70 71 postPatch = '' 72 substituteInPlace src/sdl/i_system.c \ 73 --replace '@wadlocation@' $out 74 ''; 75 76 preConfigure = '' 77 7z x ${assets} -o"/build/source/assets" -aos 78 7z x ${assets_optional} -o"/build/source/assets" -aos 79 ''; 80 81 postInstall = '' 82 mkdir $out/bin 83 mv $out/lsdlsrb2-${version} $out/bin/srb2 84 ''; 85 86 meta = with lib; { 87 description = "Sonic Robo Blast 2 is a 3D Sonic the Hedgehog fangame based on a modified version of Doom Legacy"; 88 homepage = "https://www.srb2.org/"; 89 platforms = platforms.linux; 90 license = licenses.gpl2Plus; 91 maintainers = with maintainers; [ zeratax ]; 92 }; 93}