srb2: init at 2.2.8

authored by ZerataX and committed by Lluís Batlle i Rossell e8e144a2 b3f1be78

+167
+93
pkgs/games/srb2/default.nix
··· 1 + { lib 2 + , stdenv 3 + , fetchurl 4 + , fetchFromGitHub 5 + , substituteAll 6 + , cmake 7 + , curl 8 + , nasm 9 + , openmpt123 10 + , p7zip 11 + , libgme 12 + , libpng 13 + , SDL2 14 + , SDL2_mixer 15 + , zlib 16 + }: 17 + 18 + let 19 + 20 + assets_version = "2.2.5"; 21 + 22 + assets = fetchurl { 23 + url = "https://github.com/mazmazz/SRB2/releases/download/SRB2_assets_220/srb2-${assets_version}-assets.7z"; 24 + sha256 = "1m9xf3vraq9nipsi09cyvvfa4i37gzfxg970rnqfswd86z9v6v00"; 25 + }; 26 + 27 + assets_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 + 32 + in stdenv.mkDerivation rec { 33 + pname = "srb2"; 34 + version = "2.2.8"; 35 + 36 + src = fetchFromGitHub { 37 + owner = "STJr"; 38 + repo = "SRB2"; 39 + rev = "SRB2_release_${version}"; 40 + sha256 = "10prk617pbxkpiyybwwjzv425pkjczfqdb8pxwfyq91aa2rg0kl8"; 41 + }; 42 + 43 + nativeBuildInputs = [ 44 + cmake 45 + nasm 46 + p7zip 47 + ]; 48 + 49 + buildInputs = [ 50 + curl 51 + libgme 52 + libpng 53 + openmpt123 54 + SDL2 55 + SDL2_mixer 56 + zlib 57 + ]; 58 + 59 + cmakeFlags = [ 60 + "-DSRB2_ASSET_DIRECTORY=/build/source/assets" 61 + "-DGME_INCLUDE_DIR=${libgme}/include" 62 + "-DOPENMPT_INCLUDE_DIR=${openmpt123}/include" 63 + "-DSDL2_MIXER_INCLUDE_DIR=${SDL2_mixer}/include/SDL2" 64 + "-DSDL2_INCLUDE_DIR=${SDL2.dev}/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 + }
+72
pkgs/games/srb2/wadlocation.patch
··· 1 + diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c 2 + index 10c0747bf..861f00728 100644 3 + --- a/src/sdl/i_system.c 4 + +++ b/src/sdl/i_system.c 5 + @@ -145,13 +145,7 @@ int TimeFunction(int requested_frequency); 6 + 7 + // Locations for searching the srb2.pk3 8 + #if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON) 9 + -#define DEFAULTWADLOCATION1 "/usr/local/share/games/SRB2" 10 + -#define DEFAULTWADLOCATION2 "/usr/local/games/SRB2" 11 + -#define DEFAULTWADLOCATION3 "/usr/share/games/SRB2" 12 + -#define DEFAULTWADLOCATION4 "/usr/games/SRB2" 13 + -#define DEFAULTSEARCHPATH1 "/usr/local/games" 14 + -#define DEFAULTSEARCHPATH2 "/usr/games" 15 + -#define DEFAULTSEARCHPATH3 "/usr/local" 16 + +#define DEFAULTWADLOCATION1 "@wadlocation@" 17 + #elif defined (_WIN32) 18 + #define DEFAULTWADLOCATION1 "c:\\games\\srb2" 19 + #define DEFAULTWADLOCATION2 "\\games\\srb2" 20 + @@ -2812,34 +2806,6 @@ static const char *locateWad(void) 21 + if (((envstr = I_GetEnv("SRB2WADDIR")) != NULL) && isWadPathOk(envstr)) 22 + return envstr; 23 + 24 + -#ifndef NOCWD 25 + - I_OutputMsg(",."); 26 + - // examine current dir 27 + - strcpy(returnWadPath, "."); 28 + - if (isWadPathOk(returnWadPath)) 29 + - return NULL; 30 + -#endif 31 + - 32 + - 33 + -#ifdef CMAKECONFIG 34 + -#ifndef NDEBUG 35 + - I_OutputMsg(","CMAKE_ASSETS_DIR); 36 + - strcpy(returnWadPath, CMAKE_ASSETS_DIR); 37 + - if (isWadPathOk(returnWadPath)) 38 + - { 39 + - return returnWadPath; 40 + - } 41 + -#endif 42 + -#endif 43 + - 44 + -#ifdef __APPLE__ 45 + - OSX_GetResourcesPath(returnWadPath); 46 + - I_OutputMsg(",%s", returnWadPath); 47 + - if (isWadPathOk(returnWadPath)) 48 + - { 49 + - return returnWadPath; 50 + - } 51 + -#endif 52 + 53 + // examine default dirs 54 + #ifdef DEFAULTWADLOCATION1 55 + @@ -2884,16 +2850,7 @@ static const char *locateWad(void) 56 + if (isWadPathOk(returnWadPath)) 57 + return returnWadPath; 58 + #endif 59 + -#ifndef NOHOME 60 + - // find in $HOME 61 + - I_OutputMsg(",HOME"); 62 + - if ((envstr = I_GetEnv("HOME")) != NULL) 63 + - { 64 + - WadPath = searchWad(envstr); 65 + - if (WadPath) 66 + - return WadPath; 67 + - } 68 + -#endif 69 + + 70 + #ifdef DEFAULTSEARCHPATH1 71 + // find in /usr/local 72 + I_OutputMsg(", in:"DEFAULTSEARCHPATH1);
+2
pkgs/top-level/all-packages.nix
··· 32158 32158 32159 32159 springLobby = callPackage ../games/spring/springlobby.nix { }; 32160 32160 32161 + srb2 = callPackage ../games/srb2 { }; 32162 + 32161 32163 ssl-cert-check = callPackage ../tools/admin/ssl-cert-check { }; 32162 32164 32163 32165 stardust = callPackage ../games/stardust { };