_90secondportraits: use copyDesktopItems

This commit is contained in:
Daniel Nagy 2023-05-15 23:45:00 +02:00
parent 9129b6bc67
commit f5ab2390de
No known key found for this signature in database
GPG key ID: 1B8E8DCB576FB671

View file

@ -1,51 +1,44 @@
{ lib, stdenv, fetchurl, love, lua, makeWrapper, makeDesktopItem }: { lib, stdenv, fetchurl, love, makeWrapper, makeDesktopItem, copyDesktopItems }:
let let
pname = "90secondportraits"; pname = "90secondportraits";
version = "1.01b";
icon = fetchurl { icon = fetchurl {
url = "http://tangramgames.dk/img/thumb/90secondportraits.png"; url = "http://tangramgames.dk/img/thumb/90secondportraits.png";
sha256 = "13k6cq8s7jw77j81xfa5ri41445m778q6iqbfplhwdpja03c6faw"; sha256 = "13k6cq8s7jw77j81xfa5ri41445m778q6iqbfplhwdpja03c6faw";
}; };
desktopItem = makeDesktopItem { desktopItems = [
name = "90secondportraits"; (makeDesktopItem {
exec = pname; name = "90secondportraits";
icon = icon; exec = pname;
comment = "A silly speed painting game"; icon = icon;
desktopName = "90 Second Portraits"; comment = "A silly speed painting game";
genericName = "90secondportraits"; desktopName = "90 Second Portraits";
categories = [ "Game" ]; genericName = "90secondportraits";
}; categories = [ "Game" ];
})
];
in in stdenv.mkDerivation rec {
inherit pname desktopItems;
stdenv.mkDerivation { version = "1.01b";
name = "${pname}-${version}";
src = fetchurl { src = fetchurl {
url = "https://github.com/SimonLarsen/90-Second-Portraits/releases/download/${version}/${pname}-${version}.love"; url = "https://github.com/SimonLarsen/90-Second-Portraits/releases/download/${version}/${pname}-${version}.love";
sha256 = "0jj3k953r6vb02212gqcgqpb4ima87gnqgls43jmylxq2mcm33h5"; sha256 = "0jj3k953r6vb02212gqcgqpb4ima87gnqgls43jmylxq2mcm33h5";
}; };
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [ makeWrapper copyDesktopItems ];
buildInputs = [ lua love ];
dontUnpack = true; dontUnpack = true;
installPhase = installPhase = ''
'' runHook preInstall
mkdir -p $out/bin install -Dm444 $src $out/share/games/lovegames/${pname}.love
mkdir -p $out/share/games/lovegames makeWrapper ${love}/bin/love $out/bin/${pname} \
--add-flags $out/share/games/lovegames/${pname}.love
cp -v $src $out/share/games/lovegames/${pname}.love runHook postInstall
makeWrapper ${love}/bin/love $out/bin/${pname} --add-flags $out/share/games/lovegames/${pname}.love
chmod +x $out/bin/${pname}
mkdir -p $out/share/applications
ln -s ${desktopItem}/share/applications/* $out/share/applications/
''; '';
meta = with lib; { meta = with lib; {