rocksndiamonds: modernize
Signed-off-by: Marcin Serwin <marcin@serwin.dev>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
stdenv,
|
||||
fetchurl,
|
||||
makeDesktopItem,
|
||||
copyDesktopItems,
|
||||
SDL2,
|
||||
SDL2_image,
|
||||
SDL2_mixer,
|
||||
@@ -10,32 +11,35 @@
|
||||
zlib,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "rocksndiamonds";
|
||||
version = "4.4.0.5";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://www.artsoft.org/RELEASES/linux/${pname}/${pname}-${version}-linux.tar.gz";
|
||||
url = "https://www.artsoft.org/RELEASES/linux/rocksndiamonds/rocksndiamonds-${finalAttrs.version}-linux.tar.gz";
|
||||
hash = "sha256-8e6ZYpFoUQ4+ykHDLlKWWyUANPq1lXv7IRHYWfBOU/U=";
|
||||
};
|
||||
|
||||
desktopItem = makeDesktopItem {
|
||||
name = "rocksndiamonds";
|
||||
exec = "rocksndiamonds";
|
||||
icon = "rocksndiamonds";
|
||||
comment = meta.description;
|
||||
desktopName = "Rocks'n'Diamonds";
|
||||
genericName = "Tile-based puzzle";
|
||||
categories = [
|
||||
"Game"
|
||||
"LogicGame"
|
||||
];
|
||||
};
|
||||
desktopItems = [
|
||||
(makeDesktopItem {
|
||||
name = "rocksndiamonds";
|
||||
exec = finalAttrs.meta.mainProgram;
|
||||
icon = "rocksndiamonds";
|
||||
comment = finalAttrs.meta.description;
|
||||
desktopName = "Rocks'n'Diamonds";
|
||||
genericName = "Tile-based puzzle";
|
||||
categories = [
|
||||
"Game"
|
||||
"LogicGame"
|
||||
];
|
||||
})
|
||||
];
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
SDL2 # sdl2-config
|
||||
copyDesktopItems
|
||||
];
|
||||
buildInputs = [
|
||||
SDL2
|
||||
@@ -46,22 +50,16 @@ stdenv.mkDerivation rec {
|
||||
];
|
||||
|
||||
preConfigure = ''
|
||||
makeFlagsArray+=("CC=$CC" "AR=$AR" "RANLIB=$RANLIB")
|
||||
'';
|
||||
|
||||
preBuild = ''
|
||||
dataDir="$out/share/rocksndiamonds"
|
||||
appendToVar makeFlags "BASE_PATH=$dataDir"
|
||||
dataDir=$out/share/rocksndiamonds
|
||||
makeFlagsArray+=("CC=$CC" "AR=$AR" "RANLIB=$RANLIB" "BASE_PATH=$dataDir")
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
appDir=$out/share/applications
|
||||
iconDir=$out/share/icons/hicolor/32x32/apps
|
||||
mkdir -p $out/bin $appDir $iconDir $dataDir
|
||||
mkdir -p $out/bin $iconDir $dataDir
|
||||
cp rocksndiamonds $out/bin/
|
||||
ln -s ${desktopItem}/share/applications/* $appDir/
|
||||
ln -s $dataDir/graphics/gfx_classic/icons/icon.png $iconDir/rocksndiamonds.png
|
||||
cp -r conf docs graphics levels music sounds $dataDir
|
||||
|
||||
@@ -72,12 +70,12 @@ stdenv.mkDerivation rec {
|
||||
# ranlib: game_bd.a: error reading bd_caveengine.o: file truncated
|
||||
enableParallelBuilding = false;
|
||||
|
||||
meta = with lib; {
|
||||
meta = {
|
||||
description = "Scrolling tile-based arcade style puzzle game";
|
||||
mainProgram = "rocksndiamonds";
|
||||
homepage = "https://www.artsoft.org/rocksndiamonds/";
|
||||
license = licenses.gpl2Only;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ orivej ];
|
||||
license = lib.licenses.gpl2Only;
|
||||
platforms = lib.platforms.linux;
|
||||
maintainers = with lib.maintainers; [ orivej ];
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user