summary refs log tree commit diff
path: root/pkgs/games/2048-in-terminal/default.nix
blob: 446252062fac58a91e04bf059ceaaa18f9a6397d (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
{ stdenv, fetchFromGitHub, ncurses }:

stdenv.mkDerivation rec {
  pname = "2048-in-terminal";
  version = "2017-11-29";

  src = fetchFromGitHub {
    sha256 = "1cqv5z1i5zcrvj0w6pdfnnff8m6kjndqxwkwsw5ma9jz503bmyc6";
    rev = "4e525066b0ef3442e92d2ba8dd373bdc205ece28";
    repo = "2048-in-terminal";
    owner = "alewmoose";
  };

  buildInputs = [ ncurses ];

  prePatch = ''
    sed -i '1i#include <fcntl.h>\n' save.c
  '';

  enableParallelBuilding = true;

  preInstall = ''
    mkdir -p $out/bin
  '';
  installFlags = [ "DESTDIR=$(out)/bin" ];

  meta = with stdenv.lib; {
    inherit (src.meta) homepage;
    description = "Animated console version of the 2048 game";
    license = licenses.mit;
    platforms = platforms.linux;
  };
}