about summary refs log tree commit diff
path: root/pkgs/games/orthorobot
diff options
context:
space:
mode:
authorDaniel Nagy <danielnagy@posteo.de>2022-12-01 17:00:00 +0100
committerDaniel Nagy <danielnagy@posteo.de>2022-12-01 17:13:12 +0100
commitf4140ff0157fa7d8e3bcc53eb895f0d70a3e4224 (patch)
tree61847bc33fda63959fbc520eb77b1da009a75240 /pkgs/games/orthorobot
parent6065d768e145ca5782e961774b5f06f0a0520729 (diff)
downloadnixlib-f4140ff0157fa7d8e3bcc53eb895f0d70a3e4224.tar
nixlib-f4140ff0157fa7d8e3bcc53eb895f0d70a3e4224.tar.gz
nixlib-f4140ff0157fa7d8e3bcc53eb895f0d70a3e4224.tar.bz2
nixlib-f4140ff0157fa7d8e3bcc53eb895f0d70a3e4224.tar.lz
nixlib-f4140ff0157fa7d8e3bcc53eb895f0d70a3e4224.tar.xz
nixlib-f4140ff0157fa7d8e3bcc53eb895f0d70a3e4224.tar.zst
nixlib-f4140ff0157fa7d8e3bcc53eb895f0d70a3e4224.zip
orthorobot: repair and cleanup
Diffstat (limited to 'pkgs/games/orthorobot')
-rw-r--r--pkgs/games/orthorobot/default.nix51
1 files 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/";
   };
 }