nixpkgs/pkgs/games/rocksndiamonds/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

60 lines
1.5 KiB
Nix
Raw Normal View History

2023-12-11 16:19:01 +00:00
{ lib
, stdenv
, fetchurl
, fetchpatch
, makeDesktopItem
, SDL2
, SDL2_image
, SDL2_mixer
, SDL2_net
, zlib
}:
2017-08-26 21:55:11 +00:00
stdenv.mkDerivation rec {
2021-06-22 21:44:58 +00:00
pname = "rocksndiamonds";
2024-02-29 10:21:06 +00:00
version = "4.3.8.2";
2017-08-26 21:55:11 +00:00
src = fetchurl {
2023-12-11 16:19:01 +00:00
url = "https://www.artsoft.org/RELEASES/linux/${pname}/${pname}-${version}-linux.tar.gz";
2024-02-29 10:21:06 +00:00
hash = "sha256-e/aYjjnEM6MP14FGX+N92U9fRNEjIaDfE1znl6A+4As=";
2017-08-26 21:55:11 +00:00
};
desktopItem = makeDesktopItem {
name = "rocksndiamonds";
exec = "rocksndiamonds";
icon = "rocksndiamonds";
comment = meta.description;
desktopName = "Rocks'n'Diamonds";
genericName = "Tile-based puzzle";
categories = [ "Game" "LogicGame" ];
2017-08-26 21:55:11 +00:00
};
2023-12-11 16:19:01 +00:00
buildInputs = [ SDL2 SDL2_image SDL2_mixer SDL2_net zlib ];
2017-08-26 21:55:11 +00:00
preBuild = ''
dataDir="$out/share/rocksndiamonds"
2023-12-11 16:19:01 +00:00
makeFlags+="BASE_PATH=$dataDir"
2017-08-26 21:55:11 +00:00
'';
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
2023-12-11 16:19:01 +00:00
cp -r conf docs graphics levels music sounds $dataDir
2017-08-26 21:55:11 +00:00
'';
enableParallelBuilding = true;
meta = with lib; {
2017-08-26 21:55:11 +00:00
description = "Scrolling tile-based arcade style puzzle game";
mainProgram = "rocksndiamonds";
homepage = "https://www.artsoft.org/rocksndiamonds/";
2017-08-26 21:55:11 +00:00
license = licenses.gpl2;
platforms = platforms.linux;
2023-12-11 16:19:01 +00:00
maintainers = with maintainers; [ orivej xfix ];
2017-08-26 21:55:11 +00:00
};
}