about summary refs log tree commit diff
path: root/pkgs/games/ecwolf/default.nix
blob: 34c186f7f2dcfd39f23495dbf6e764f18c2cba5c (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
{ stdenv
, lib
, fetchFromBitbucket
, makeDesktopItem
, copyDesktopItems
, cmake
, pkg-config
, zlib
, bzip2
, libjpeg
, SDL2
, SDL2_net
, SDL2_mixer
, gtk3
}:

stdenv.mkDerivation rec {
  pname = "ecwolf";
  version = "1.4.0";

  src = fetchFromBitbucket {
    owner = pname;
    repo = pname;
    rev = version;
    sha256 = "n1G1zvfE1l42fbJ7ZaMdV0QXn45PjMpaaZTDQAOBtYk=";
  };

  nativeBuildInputs = [ cmake copyDesktopItems pkg-config ];
  buildInputs = [ zlib bzip2 libjpeg SDL2 SDL2_net SDL2_mixer gtk3 ];

  # Disable app bundle creation on Darwin. It fails, and it is not needed to run it from the Nix store
  preConfigure = lib.optionalString stdenv.isDarwin ''
    sed -i -e "s|include(\''${CMAKE_CURRENT_SOURCE_DIR}/macosx/install.txt)||" src/CMakeLists.txt
  '';

  # ECWolf installs its binary to the games/ directory, but Nix only adds bin/
  # directories to the PATH.
  postInstall = ''
    mv "$out/games" "$out/bin"
  '';

  meta = with lib; {
    description = "Enhanched SDL-based port of Wolfenstein 3D for various platforms";
    homepage = "https://maniacsvault.net/ecwolf/";
    license = licenses.gpl2Plus;
    maintainers = with maintainers; [ jayman2000 sander ];
    platforms = platforms.all;
    # On Darwin, the linker fails to find a bunch of symbols.
    broken = stdenv.isDarwin;
  };
}