1{
2 lib,
3 copyDesktopItems,
4 fetchFromGitHub,
5 fetchpatch,
6 fetchurl,
7 love,
8 makeDesktopItem,
9 makeWrapper,
10 stdenv,
11 strip-nondeterminism,
12 zip,
13}:
14
15stdenv.mkDerivation rec {
16 pname = "orthorobot";
17 version = "1.1.1";
18
19 src = fetchFromGitHub {
20 owner = "Stabyourself";
21 repo = pname;
22 rev = "v${version}";
23 sha256 = "1ca6hvd890kxmamsmsfiqzw15ngsvb4lkihjb6kabgmss61a6s5p";
24 };
25
26 icon = fetchurl {
27 url = "https://stabyourself.net/images/screenshots/orthorobot-5.png";
28 sha256 = "13fa4divdqz4vpdij1lcs5kf6w2c4jm3cc9q6bz5h7lkng31jzi6";
29 };
30
31 desktopItems = [
32 (makeDesktopItem {
33 name = "orthorobot";
34 exec = pname;
35 icon = icon;
36 comment = "Robot game";
37 desktopName = "Orthorobot";
38 genericName = "orthorobot";
39 categories = [ "Game" ];
40 })
41 ];
42
43 nativeBuildInputs = [
44 copyDesktopItems
45 makeWrapper
46 strip-nondeterminism
47 zip
48 ];
49
50 patches = [
51 # support for love11
52 # https://github.com/Stabyourself/orthorobot/pull/3
53 (fetchpatch {
54 name = "Stabyourself-orthorobot-pull-3.patch";
55 url = "https://github.com/Stabyourself/orthorobot/compare/48f07423950b29a94b04aefe268f2f951f55b62e...05856ba7dbf1bb86d0f16a5f511d8ee9f2176015.patch";
56 sha256 = "sha256-WHHP6QM7R5eEkVF+J2pGNnds/OKRIRXyon85wjd3GXI=";
57 })
58 ];
59
60 installPhase = ''
61 runHook preInstall
62 zip -9 -r orthorobot.love ./*
63 strip-nondeterminism --type zip orthorobot.love
64 install -Dm444 -t $out/share/games/lovegames/ orthorobot.love
65 makeWrapper ${love}/bin/love $out/bin/orthorobot \
66 --add-flags $out/share/games/lovegames/orthorobot.love
67 runHook postInstall
68 '';
69
70 meta = with lib; {
71 description = "Recharge the robot";
72 mainProgram = "orthorobot";
73 maintainers = with maintainers; [ leenaars ];
74 platforms = platforms.linux;
75 license = licenses.free;
76 downloadPage = "https://stabyourself.net/orthorobot/";
77 };
78}