2022-06-16 17:23:12 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, makeDesktopItem, SDL2, SDL2_image, SDL2_mixer, SDL2_net }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-06-28 23:13:55 +00:00
|
|
|
pname = "rocksndiamonds";
|
2020-04-24 23:36:52 +00:00
|
|
|
version = "4.1.1.0";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2021-06-28 23:13:55 +00:00
|
|
|
url = "https://www.artsoft.org/RELEASES/unix/${pname}/rocksndiamonds-${version}.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "1k0m6l5g886d9mwwh6q0gw75qsb85mpf8i0rglh047app56nsk72";
|
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
patches = [
|
|
|
|
# Pull upstream fix for -fno-common toolchain.
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fno-common-p1.patch";
|
|
|
|
url = "https://git.artsoft.org/?p=rocksndiamonds.git;a=patch;h=b4271393b10b7c664a58f3db7349a3875c1676fe";
|
|
|
|
sha256 = "0bdy4d2ril917radmm0c2yh2gqfyh7q1c8kahig5xknn2rkf2iac";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fno-common-p2.patch";
|
|
|
|
url = "https://git.artsoft.org/?p=rocksndiamonds.git;a=patch;h=81dbde8a570a94dd2e938eff2f52dc5a3ecced21";
|
|
|
|
sha256 = "1mk5yb8pxrpxvvsxw3pjcbgx2c658baq9vmqqipbj5byhkkw7v2l";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "rocksndiamonds";
|
|
|
|
exec = "rocksndiamonds";
|
|
|
|
icon = "rocksndiamonds";
|
|
|
|
comment = meta.description;
|
|
|
|
desktopName = "Rocks'n'Diamonds";
|
|
|
|
genericName = "Tile-based puzzle";
|
2022-03-05 16:20:37 +00:00
|
|
|
categories = [ "Game" "LogicGame" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ SDL2 SDL2_image SDL2_mixer SDL2_net ];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
dataDir="$out/share/rocksndiamonds"
|
|
|
|
makeFlags+="RO_GAME_DIR=$dataDir"
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
appDir=$out/share/applications
|
|
|
|
iconDir=$out/share/icons/hicolor/32x32/apps
|
|
|
|
mkdir -p $out/bin $appDir $iconDir $dataDir
|
|
|
|
cp rocksndiamonds $out/bin/
|
|
|
|
ln -s ${desktopItem}/share/applications/* $appDir/
|
|
|
|
ln -s $dataDir/graphics/gfx_classic/RocksIcon32x32.png $iconDir/rocksndiamonds.png
|
|
|
|
cp -r docs graphics levels music sounds $dataDir
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Scrolling tile-based arcade style puzzle game";
|
|
|
|
homepage = "https://www.artsoft.org/rocksndiamonds/";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ orivej ];
|
|
|
|
};
|
|
|
|
}
|