sdlpop: init at 1.21

+86
+68
pkgs/games/sdlpop/default.nix
··· 1 + { lib, stdenv 2 + , makeWrapper 3 + , makeDesktopItem, copyDesktopItems 4 + , fetchFromGitHub 5 + , pkg-config 6 + , SDL2, SDL2_image 7 + }: 8 + 9 + stdenv.mkDerivation rec { 10 + pname = "sdlpop"; 11 + version = "1.21"; 12 + 13 + src = fetchFromGitHub { 14 + owner = "NagyD"; 15 + repo = "SDLPoP"; 16 + rev = "v${version}"; 17 + sha256 = "1q4mnyg8v4420f1bp24v8lgi335vijdv61yi3fan14jgfzl38l7w"; 18 + }; 19 + 20 + nativeBuildInputs = [ pkg-config makeWrapper copyDesktopItems ]; 21 + buildInputs = [ SDL2 SDL2_image ]; 22 + 23 + makeFlags = [ "-C" "src" ]; 24 + 25 + preBuild = '' 26 + substituteInPlace src/Makefile --replace "CC = gcc" "CC = ${stdenv.cc.targetPrefix}gcc" 27 + ''; 28 + 29 + # The prince binary expects two things of the working directory it is called from: 30 + # (1) There is a subdirectory "data" containing the level data. 31 + # (2) The working directory is writable, so save and quicksave files can be created. 32 + # Our solution is to ensure that ~/.local/share/sdlpop is the working 33 + # directory, symlinking the data files into it. This is the task of the 34 + # prince.sh wrapper. 35 + 36 + installPhase = '' 37 + runHook preInstall 38 + 39 + install -Dm755 prince $out/bin/.prince-bin 40 + substituteAll ${./prince.sh} $out/bin/prince 41 + chmod +x $out/bin/prince 42 + 43 + mkdir -p $out/share/sdlpop 44 + cp -r data doc mods SDLPoP.ini $out/share/sdlpop 45 + 46 + install -Dm755 data/icon.png $out/share/icons/hicolor/32x32/apps/sdlpop.png 47 + 48 + runHook postInstall 49 + ''; 50 + 51 + desktopItems = [ (makeDesktopItem { 52 + name = "sdlpop"; 53 + icon = "sdlpop"; 54 + exec = "prince"; 55 + desktopName = "SDLPoP"; 56 + comment = "An open-source port of Prince of Persia"; 57 + categories = "Game;AdventureGame;"; 58 + }) ]; 59 + 60 + meta = with lib; { 61 + description = "Open-source port of Prince of Persia"; 62 + homepage = "https://github.com/NagyD/SDLPoP"; 63 + license = licenses.gpl3Plus; 64 + maintainers = with maintainers; [ iblech ]; 65 + platforms = platforms.unix; 66 + broken = stdenv.isDarwin; 67 + }; 68 + }
+16
pkgs/games/sdlpop/prince.sh
··· 1 + #! @shell@ 2 + 3 + set -euo pipefail 4 + 5 + mkdir -p ~/.local/share/sdlpop 6 + cd ~/.local/share/sdlpop 7 + 8 + for i in SDLPoP.ini mods; do 9 + [ -e $i ] || cp -r @out@/share/sdlpop/$i . 10 + done 11 + 12 + # Create the data symlink or update it (in case it is a symlink, else the user 13 + # has probably tinkered with it and does not want it to be recreated). 14 + [ ! -e data -o -L data ] && ln -sf @out@/share/sdlpop/data . 15 + 16 + exec -a "prince" @out@/bin/.prince-bin "$@"
+2
pkgs/top-level/all-packages.nix
··· 26711 26711 inherit (gnome3) zenity; 26712 26712 }; 26713 26713 26714 + sdlpop = callPackage ../games/sdlpop { }; 26715 + 26714 26716 stepmania = callPackage ../games/stepmania { 26715 26717 ffmpeg = ffmpeg_2; 26716 26718 };