summary refs log tree commit diff
path: root/pkgs/games/orthorobot/default.nix
blob: 6ca70596458d40dcbb8f8676c68a6edfd5759694 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{ lib
, copyDesktopItems
, fetchFromGitHub
, fetchpatch
, fetchurl
, love
, makeDesktopItem
, makeWrapper
, stdenv
, strip-nondeterminism
, zip
}:

stdenv.mkDerivation rec {
  pname = "orthorobot";
  version = "1.1.1";

  src = fetchFromGitHub {
    owner = "Stabyourself";
    repo = pname;
    rev = "v${version}";
    sha256 = "1ca6hvd890kxmamsmsfiqzw15ngsvb4lkihjb6kabgmss61a6s5p";
  };

  icon = fetchurl {
    url = "https://stabyourself.net/images/screenshots/orthorobot-5.png";
    sha256 = "13fa4divdqz4vpdij1lcs5kf6w2c4jm3cc9q6bz5h7lkng31jzi6";
  };

  desktopItems = [
    (makeDesktopItem {
      name = "orthorobot";
      exec = pname;
      icon = icon;
      comment = "Robot game";
      desktopName = "Orthorobot";
      genericName = "orthorobot";
      categories = [ "Game" ];
    })
  ];

  nativeBuildInputs = [
    copyDesktopItems
    makeWrapper
    strip-nondeterminism
    zip
  ];

  patches = [
    # support for love11
    (fetchpatch {
      url = "https://github.com/Stabyourself/orthorobot/pull/3.patch";
      sha256 = "sha256-WHHP6QM7R5eEkVF+J2pGNnds/OKRIRXyon85wjd3GXI=";
    })
  ];

  installPhase = ''
    runHook preInstall
    zip -9 -r orthorobot.love ./*
    strip-nondeterminism --type zip 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; {
    description = "Recharge the robot";
    maintainers = with maintainers; [ leenaars ];
    platforms = platforms.linux;
    license = licenses.free;
    downloadPage = "https://stabyourself.net/orthorobot/";
  };
}