summary refs log tree commit diff
path: root/pkgs/games/rimshot/default.nix
blob: c940c90b8841810c02f632d630445e74fbe4be06 (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
{ stdenv, fetchurl, unzip, love, lua, makeWrapper, makeDesktopItem }:

let
  pname = "rimshot";
  version = "1.0";

  icon = fetchurl {
    url = "http://stabyourself.net/images/screenshots/rimshot-2.png";
    sha256 = "08fyiqym3gcpq2vgb5dvafkban42fsbzfcr3iiyw03hz99q53psd";
  };

  desktopItem = makeDesktopItem {
    name = "rimshot";
    exec = pname;
    icon = icon;
    comment = "Create your own music";
    desktopName = "Rimshot";
    genericName = "rimshot";
    categories = "Audio;AudioVideo;Music";
  };

in

stdenv.mkDerivation {
  name = "${pname}-${version}";

  src = fetchurl {
    url = "http://stabyourself.net/dl.php?file=${pname}/${pname}-source.zip";
    sha256 = "08pdkyvki92549605m9bqnr24ipkbwkp5nkr5aagdqnr8ai4rgmi";
  };

  nativeBuildInputs = [ makeWrapper unzip ];
  buildInputs = [ lua love ];

  phases = [ "unpackPhase" "installPhase" ];

  unpackPhase = ''
    unzip -j $src
  '';  

  installPhase =
  ''
    mkdir -p $out/bin
    mkdir -p $out/share/games/lovegames

    cp -v ./*.love $out/share/games/lovegames/${pname}.love
    makeWrapper ${love}/bin/love $out/bin/${pname} --add-flags $out/share/games/lovegames/${pname}.love

    chmod +x $out/bin/${pname}
    mkdir -p $out/share/applications
    ln -s ${desktopItem}/share/applications/* $out/share/applications/
  '';

  meta = with stdenv.lib; {
    description = "Create your own music";
    maintainers = with maintainers; [ leenaars ];
    platforms = platforms.linux;
    license = licenses.free;
    downloadPage = http://stabyourself.net/rimshot/;
  };

}