From f4140ff0157fa7d8e3bcc53eb895f0d70a3e4224 Mon Sep 17 00:00:00 2001 From: Daniel Nagy Date: Thu, 1 Dec 2022 17:00:00 +0100 Subject: [PATCH] orthorobot: repair and cleanup --- pkgs/games/orthorobot/default.nix | 51 ++++++++++++++++++------------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/pkgs/games/orthorobot/default.nix b/pkgs/games/orthorobot/default.nix index 34808438da7d..5fc11d212514 100644 --- a/pkgs/games/orthorobot/default.nix +++ b/pkgs/games/orthorobot/default.nix @@ -1,4 +1,6 @@ -{ lib, stdenv, fetchurl, fetchFromGitHub, zip, love, lua, makeWrapper, makeDesktopItem }: +{ lib, stdenv, fetchurl, fetchFromGitHub, love, zip, fetchpatch, makeWrapper +, makeDesktopItem, copyDesktopItems }: + stdenv.mkDerivation rec { pname = "orthorobot"; version = "1.1.1"; @@ -11,32 +13,39 @@ stdenv.mkDerivation rec { }; icon = fetchurl { - url = "http://stabyourself.net/images/screenshots/orthorobot-5.png"; + url = "https://stabyourself.net/images/screenshots/orthorobot-5.png"; sha256 = "13fa4divdqz4vpdij1lcs5kf6w2c4jm3cc9q6bz5h7lkng31jzi6"; }; - desktopItem = makeDesktopItem { - name = "orthorobot"; - exec = pname; - icon = icon; - comment = "Robot game"; - desktopName = "Orthorobot"; - genericName = "orthorobot"; - categories = [ "Game" ]; - }; + desktopItems = [ + (makeDesktopItem { + name = "orthorobot"; + exec = pname; + icon = icon; + comment = "Robot game"; + desktopName = "Orthorobot"; + genericName = "orthorobot"; + categories = [ "Game" ]; + }) + ]; - nativeBuildInputs = [ makeWrapper ]; - buildInputs = [ lua love zip ]; + nativeBuildInputs = [ makeWrapper zip copyDesktopItems ]; - dontBuild = true; + patches = [ + # support for love11 + (fetchpatch { + url = "https://github.com/Stabyourself/orthorobot/pull/3.patch"; + sha256 = "sha256-WHHP6QM7R5eEkVF+J2pGNnds/OKRIRXyon85wjd3GXI="; + }) + ]; 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}/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} + runHook preInstall + zip -9 -r orthorobot.love ./* + install -Dm444 -t $out/share/games/lovegames/ orthorobot.love + makeWrapper ${love}/bin/love $out/bin/orthorobot \ + --add-flags $out/share/games/lovegames/orthorobot.love + runHook postInstall ''; meta = with lib; { @@ -44,6 +53,6 @@ stdenv.mkDerivation rec { maintainers = with maintainers; [ leenaars ]; platforms = platforms.linux; license = licenses.free; - downloadPage = "http://stabyourself.net/orthorobot/"; + downloadPage = "https://stabyourself.net/orthorobot/"; }; }