1 { stdenv, lib, fetchurl, makeDesktopItem, copyDesktopItems, cmake, pkg-config, zlib, bzip2, libjpeg, SDL, SDL_mixer, gtk2 }:
3 stdenv.mkDerivation rec {
8 url = "https://maniacsvault.net/ecwolf/files/ecwolf/1.x/${pname}-${version}-src.tar.xz";
9 sha256 = "1sbdv672dz47la5a5qwmdi1v258k9kc5dkx7cdj2b6gk8nbm2srl";
12 nativeBuildInputs = [ cmake copyDesktopItems pkg-config ];
13 buildInputs = [ zlib bzip2 libjpeg SDL SDL_mixer gtk2 ];
19 comment = "Enhanced Wolfenstein 3D port";
20 desktopName = "Wolfenstein 3D";
21 categories = [ "Game" ];
25 # Change the location where the ecwolf executable looks for the ecwolf.pk3
28 # By default, it expects the PK3 file to reside in the same directory as the
29 # executable, which is not desirable.
30 # We will adjust the code so that it can be retrieved from the share/
34 sed -i -e "s|ecwolf.pk3|$out/share/ecwolf/ecwolf.pk3|" src/version.h
36 # Disable app bundle creation on Darwin. It fails, and it is not needed to run it from the Nix store
37 + lib.optionalString stdenv.isDarwin ''
38 sed -i -e "s|include(\''${CMAKE_CURRENT_SOURCE_DIR}/macosx/install.txt)||" src/CMakeLists.txt
41 # Install the required PK3 file in the required data directory
43 mkdir -p $out/share/ecwolf
44 cp ecwolf.pk3 $out/share/ecwolf
48 description = "Enhanched SDL-based port of Wolfenstein 3D for various platforms";
49 homepage = "https://maniacsvault.net/ecwolf/";
50 license = licenses.gpl2Plus;
51 maintainers = with maintainers; [ sander ];
52 platforms = platforms.all;