about summary refs log tree commit diff
path: root/nixpkgs/pkgs/games/darkplaces/default.nix
blob: 876e0025976fcd13868910e1b525d7be6896ab54 (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
{ lib
, stdenv
, fetchFromGitHub
, zlib
, libjpeg
, SDL2
, libvorbis
}:
stdenv.mkDerivation rec {
  pname = "darkplaces";
  version = "unstable-2022-05-10";

  src = fetchFromGitHub {
    owner = "DarkPlacesEngine";
    repo = "darkplaces";
    rev = "f16954a9d40168253ac5d9890dabcf7dbd266cd9";
    hash = "sha256-5KsUcgHbuzFUE6LcclqI8VPSFbXZzBnxzOBB9Kf8krI=";
  };

  buildInputs = [
    zlib
    libjpeg
    SDL2
  ];

  buildFlags = [ "release" ];

  installPhase = ''
    runHook preInstall

    mkdir -p $out/bin
    install -m755 darkplaces-sdl $out/bin/darkplaces
    install -m755 darkplaces-dedicated $out/bin/darkplaces-dedicated

    runHook postInstall
  '';

  postFixup = ''
    patchelf \
      --add-needed ${libvorbis}/lib/libvorbisfile.so \
      --add-needed ${libvorbis}/lib/libvorbis.so \
      $out/bin/darkplaces
  '';

  meta = with lib; {
    homepage = "https://www.icculus.org/twilight/darkplaces/";
    description = "A quake 1 engine implementation by LadyHavoc";
    longDescription = ''
      A game engine based on the Quake 1 engine by id Software.
      It improves and builds upon the original 1996 engine by adding modern
      rendering features, and expanding upon the engine's native game code
      language QuakeC, as well as supporting additional map and model formats.
    '';
    maintainers = with maintainers; [ necrophcodr ];
    license = licenses.gpl2Plus;
    platforms = platforms.linux;
  };
}