summary refs log tree commit diff
path: root/pkgs/games/frogatto/engine.nix
blob: b848c414b7a3c362b34fea52c763ef0e51f0b78a (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
{ lib, stdenv, fetchFromGitHub, fetchurl, which
, boost, SDL2, SDL2_image, SDL2_mixer, SDL2_ttf
, glew, zlib, icu, pkg-config, cairo, libvpx }:

stdenv.mkDerivation {
  pname = "anura-engine";
  version = "unstable-2022-04-09";

  src = fetchFromGitHub {
    owner = "anura-engine";
    repo = "anura";
    rev = "5ac7f6fe63114274f0da7dad4c1ed673651e6424";
    sha256 = "1yrcbvzgxdvn893qk1qcpb53pjns366fdls5qjal7lhq71kkfc67";
    fetchSubmodules = true;
  };
  patches = [
    # https://github.com/anura-engine/anura/issues/321
    (fetchurl {
      url = "https://github.com/anura-engine/anura/commit/627d08fb5254b5c66d315f1706089905c2704059.patch";
      sha256 = "052m58qb3lg0hnxacpnjz2sz89dk0x6b5qi2q9bkzkvg38f237rr";
    })
  ];

  nativeBuildInputs = [
    which pkg-config
  ];

  buildInputs = [
    boost
    SDL2
    SDL2_image
    SDL2_mixer
    SDL2_ttf
    glew
    zlib
    icu
    cairo
    libvpx
  ];

  enableParallelBuilding = true;

  installPhase = ''
    mkdir -p $out/bin $out/share/frogatto
    cp -ar data images modules $out/share/frogatto/
    cp -a anura $out/bin/frogatto
  '';

  meta = with lib; {
    homepage = "https://github.com/anura-engine/anura";
    description = "Game engine used by Frogatto";
    license = licenses.zlib;
    platforms = platforms.linux;
    maintainers = with maintainers; [ astro ];
  };
}