mari0: use copyDesktopItems

This commit is contained in:
Daniel Nagy 2022-10-04 22:54:13 +02:00
parent a2494bf204
commit b95d3db40c
No known key found for this signature in database
GPG Key ID: 1B8E8DCB576FB671

View File

@ -1,23 +1,10 @@
{ lib, stdenv, fetchFromGitHub, zip, love_11, lua, makeWrapper, makeDesktopItem }: { lib, stdenv, fetchFromGitHub, zip, love, makeWrapper, makeDesktopItem
, copyDesktopItems }:
let stdenv.mkDerivation rec {
pname = "mari0"; pname = "mari0";
version = "1.6.2"; version = "1.6.2";
desktopItem = makeDesktopItem {
name = "mari0";
exec = pname;
comment = "Crossover between Super Mario Bros. and Portal";
desktopName = "mari0";
genericName = "mari0";
categories = [ "Game" ];
};
in
stdenv.mkDerivation {
inherit pname version;
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "Stabyourself"; owner = "Stabyourself";
repo = pname; repo = pname;
@ -25,17 +12,26 @@ stdenv.mkDerivation {
sha256 = "1zqaq4w599scsjvy1rsb21fd2r8j3srx9vym4ir9bh666dp36gxa"; sha256 = "1zqaq4w599scsjvy1rsb21fd2r8j3srx9vym4ir9bh666dp36gxa";
}; };
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [ makeWrapper copyDesktopItems zip ];
buildInputs = [ lua love_11 zip ];
installPhase = desktopItems = [
'' (makeDesktopItem {
mkdir -p $out/bin $out/share/games/lovegames $out/share/applications name = "mari0";
zip -9 -r ${pname}.love ./* exec = pname;
mv ${pname}.love $out/share/games/lovegames/${pname}.love comment = "Crossover between Super Mario Bros. and Portal";
makeWrapper ${love_11}/bin/love $out/bin/${pname} --add-flags $out/share/games/lovegames/${pname}.love desktopName = "mari0";
ln -s ${desktopItem}/share/applications/* $out/share/applications/ genericName = "mari0";
chmod +x $out/bin/${pname} categories = [ "Game" ];
})
];
installPhase = ''
runHook preInstall
zip -9 -r mari0.love ./*
install -Dm444 -t $out/share/games/lovegames/ mari0.love
makeWrapper ${love}/bin/love $out/bin/mari0 \
--add-flags $out/share/games/lovegames/mari0.love
runHook postInstall
''; '';
meta = with lib; { meta = with lib; {