1 { lib, stdenv, fetchurl, fetchpatch, makeDesktopItem, SDL2, SDL2_image, SDL2_mixer, SDL2_net }:
3 stdenv.mkDerivation rec {
4 pname = "rocksndiamonds";
8 url = "https://www.artsoft.org/RELEASES/unix/${pname}/rocksndiamonds-${version}.tar.gz";
9 sha256 = "1k0m6l5g886d9mwwh6q0gw75qsb85mpf8i0rglh047app56nsk72";
13 # Pull upstream fix for -fno-common toolchain.
15 name = "fno-common-p1.patch";
16 url = "https://git.artsoft.org/?p=rocksndiamonds.git;a=patch;h=b4271393b10b7c664a58f3db7349a3875c1676fe";
17 sha256 = "0bdy4d2ril917radmm0c2yh2gqfyh7q1c8kahig5xknn2rkf2iac";
20 name = "fno-common-p2.patch";
21 url = "https://git.artsoft.org/?p=rocksndiamonds.git;a=patch;h=81dbde8a570a94dd2e938eff2f52dc5a3ecced21";
22 sha256 = "1mk5yb8pxrpxvvsxw3pjcbgx2c658baq9vmqqipbj5byhkkw7v2l";
26 desktopItem = makeDesktopItem {
27 name = "rocksndiamonds";
28 exec = "rocksndiamonds";
29 icon = "rocksndiamonds";
30 comment = meta.description;
31 desktopName = "Rocks'n'Diamonds";
32 genericName = "Tile-based puzzle";
33 categories = [ "Game" "LogicGame" ];
36 buildInputs = [ SDL2 SDL2_image SDL2_mixer SDL2_net ];
39 dataDir="$out/share/rocksndiamonds"
40 makeFlags+="RO_GAME_DIR=$dataDir"
44 appDir=$out/share/applications
45 iconDir=$out/share/icons/hicolor/32x32/apps
46 mkdir -p $out/bin $appDir $iconDir $dataDir
47 cp rocksndiamonds $out/bin/
48 ln -s ${desktopItem}/share/applications/* $appDir/
49 ln -s $dataDir/graphics/gfx_classic/RocksIcon32x32.png $iconDir/rocksndiamonds.png
50 cp -r docs graphics levels music sounds $dataDir
53 enableParallelBuilding = true;
56 description = "Scrolling tile-based arcade style puzzle game";
57 homepage = "https://www.artsoft.org/rocksndiamonds/";
58 license = licenses.gpl2;
59 platforms = platforms.linux;
60 maintainers = with maintainers; [ orivej ];