diff options
author | Daniel Nagy <danielnagy@posteo.de> | 2022-10-04 22:54:13 +0200 |
---|---|---|
committer | Daniel Nagy <danielnagy@posteo.de> | 2022-11-28 14:00:00 +0100 |
commit | b95d3db40c551a95330f38c5cff2fd4f72f2e48c (patch) | |
tree | de9e241e40ed9bbf59ba9e9532e88e81a2e8210b /pkgs/games/mari0 | |
parent | a2494bf2042d605ca1c4a679401bdc4971da54fb (diff) |
mari0: use copyDesktopItems
Diffstat (limited to 'pkgs/games/mari0')
-rw-r--r-- | pkgs/games/mari0/default.nix | 50 |
1 files changed, 23 insertions, 27 deletions
diff --git a/pkgs/games/mari0/default.nix b/pkgs/games/mari0/default.nix index 8189c07898113..9541b97476c16 100644 --- a/pkgs/games/mari0/default.nix +++ b/pkgs/games/mari0/default.nix @@ -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"; 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 { owner = "Stabyourself"; repo = pname; @@ -25,17 +12,26 @@ stdenv.mkDerivation { sha256 = "1zqaq4w599scsjvy1rsb21fd2r8j3srx9vym4ir9bh666dp36gxa"; }; - nativeBuildInputs = [ makeWrapper ]; - buildInputs = [ lua love_11 zip ]; - - installPhase = - '' - mkdir -p $out/bin $out/share/games/lovegames $out/share/applications - zip -9 -r ${pname}.love ./* - mv ${pname}.love $out/share/games/lovegames/${pname}.love - makeWrapper ${love_11}/bin/love $out/bin/${pname} --add-flags $out/share/games/lovegames/${pname}.love - ln -s ${desktopItem}/share/applications/* $out/share/applications/ - chmod +x $out/bin/${pname} + nativeBuildInputs = [ makeWrapper copyDesktopItems zip ]; + + desktopItems = [ + (makeDesktopItem { + name = "mari0"; + exec = pname; + comment = "Crossover between Super Mario Bros. and Portal"; + desktopName = "mari0"; + genericName = "mari0"; + 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; { |