3 , makeDesktopItem, copyDesktopItems
9 stdenv.mkDerivation rec {
13 src = fetchFromGitHub {
17 sha256 = "sha256-UI7NfOC/+druRYL5g2AhIjTPEq4ta1qEThcxgyrFjHY=";
20 nativeBuildInputs = [ pkg-config makeWrapper copyDesktopItems ];
22 buildInputs = [ SDL2 SDL2_image ];
24 makeFlags = [ "-C" "src" ];
27 substituteInPlace src/Makefile \
28 --replace "CC = gcc" "CC = ${stdenv.cc.targetPrefix}cc" \
29 --replace "CFLAGS += -I/opt/local/include" "CFLAGS += -I${SDL2.dev}/include/SDL2 -I${SDL2_image}/include/SDL2"
32 # The prince binary expects two things of the working directory it is called from:
33 # (1) There is a subdirectory "data" containing the level data.
34 # (2) The working directory is writable, so save and quicksave files can be created.
35 # Our solution is to ensure that ~/.local/share/sdlpop is the working
36 # directory, symlinking the data files into it. This is the task of the
42 install -Dm755 prince $out/bin/.prince-bin
43 substituteAll ${./prince.sh} $out/bin/prince
44 chmod +x $out/bin/prince
46 mkdir -p $out/share/sdlpop
47 cp -r data doc mods SDLPoP.ini $out/share/sdlpop
49 install -Dm755 data/icon.png $out/share/icons/hicolor/32x32/apps/sdlpop.png
54 desktopItems = [ (makeDesktopItem {
58 desktopName = "SDLPoP";
59 comment = "An open-source port of Prince of Persia";
60 categories = [ "Game" "AdventureGame" ];
64 description = "Open-source port of Prince of Persia";
65 homepage = "https://github.com/NagyD/SDLPoP";
66 changelog = "https://github.com/NagyD/SDLPoP/blob/v${version}/doc/ChangeLog.txt";
67 license = licenses.gpl3Plus;
68 maintainers = with maintainers; [ iblech ];
69 platforms = platforms.unix;
70 mainProgram = "prince";