summary refs log tree commit diff
path: root/pkgs/games/doom-ports/prboom-plus/default.nix
blob: 15875296fff8571065583b97e027b1b31b71cc9b (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
{ lib
, stdenv
, fetchFromGitHub
, cmake
, SDL2
, SDL2_mixer
, SDL2_image
, SDL2_net
, fluidsynth
, soundfont-fluid
, portmidi
, dumb
, libvorbis
, libmad
, pcre
}:

stdenv.mkDerivation rec {
  pname = "prboom-plus";
  version = "2.6.66";

  src = fetchFromGitHub {
    owner = "coelckers";
    repo = "prboom-plus";
    rev = "v${version}";
    sha256 = "sha256-moU/bZ2mS1QfKPP6HaAwWP1nRNZ4Ue5DFl9zBBrJiHw=";
  };

  sourceRoot = "source/prboom2";

  nativeBuildInputs = [
    cmake
  ];

  buildInputs = [
    SDL2
    SDL2_mixer
    SDL2_image
    SDL2_net
    fluidsynth
    portmidi
    dumb
    libvorbis
    libmad
    pcre
  ];

  # Fixes impure path to soundfont
  prePatch = ''
    substituteInPlace src/m_misc.c --replace \
      "/usr/share/sounds/sf3/default-GM.sf3" \
      "${soundfont-fluid}/share/soundfonts/FluidR3_GM2-2.sf2"
  '';

  meta = with lib; {
    homepage = "https://github.com/coelckers/prboom-plus";
    description = "An advanced, Vanilla-compatible Doom engine based on PrBoom";
    license = licenses.gpl2Plus;
    platforms = platforms.linux;
    maintainers = [ maintainers.ashley ];
  };
}