summary refs log tree commit diff
path: root/pkgs/games/nottetris2/default.nix
blob: 53e7dec08032b7a54d4ca4d15867aa5aaf841474 (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
{ lib, stdenv, fetchFromGitHub, zip, love_0_7, makeWrapper, makeDesktopItem }:

let
  pname = "nottetris2";
  version = "2.0";

  desktopItem = makeDesktopItem {
    name = "nottetris2";
    exec = pname;
    comment = "It's like tetris, but it's not";
    desktopName = "nottetris2";
    genericName = "nottetris2";
    categories = "Game";
  };

in

stdenv.mkDerivation {
  inherit pname version;

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

  nativeBuildInputs = [ zip ];
  buildInputs = [ love_0_7 makeWrapper ];

  phases = [ "unpackPhase" "installPhase" ];

  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_0_7}/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}
  '';

  meta = with lib; {
    description = "It's like Tetris, but it's not";
    platforms = platforms.linux;
    license = licenses.wtfpl;
    maintainers = with maintainers; [ yorickvp ];
    downloadPage = "https://stabyourself.net/nottetris2/";
  };

}