2023-02-02 18:25:31 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromBitbucket
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
2023-02-09 11:40:11 +00:00
|
|
|
, makeWrapper
|
2023-02-02 18:25:31 +00:00
|
|
|
, zlib
|
|
|
|
, bzip2
|
|
|
|
, libjpeg
|
|
|
|
, SDL2
|
|
|
|
, SDL2_net
|
|
|
|
, SDL2_mixer
|
|
|
|
, gtk3
|
|
|
|
}:
|
2021-08-10 14:31:46 +00:00
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ecwolf";
|
2023-02-09 11:40:11 +00:00
|
|
|
version = "1.4.1";
|
2021-08-05 21:33:18 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
src = fetchFromBitbucket {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-02-09 11:40:11 +00:00
|
|
|
sha256 = "V2pSP8i20zB50WtUMujzij+ISSupdQQ/oCYYrOaTU1g=";
|
2021-08-05 21:33:18 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ]
|
2023-02-09 11:40:11 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ makeWrapper ];
|
2023-02-02 18:25:31 +00:00
|
|
|
buildInputs = [ zlib bzip2 libjpeg SDL2 SDL2_net SDL2_mixer gtk3 ];
|
2021-08-05 21:33:18 +00:00
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework AppKit";
|
2021-08-05 21:33:18 +00:00
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
# ECWolf installs its binary to the games/ directory, but Nix only adds bin/
|
|
|
|
# directories to the PATH.
|
|
|
|
postInstall = lib.optionalString stdenv.isLinux ''
|
|
|
|
mv "$out/games" "$out/bin"
|
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
|
|
|
mkdir -p $out/{Applications,bin}
|
|
|
|
cp -R ecwolf.app $out/Applications
|
|
|
|
makeWrapper $out/{Applications/ecwolf.app/Contents/MacOS,bin}/ecwolf
|
2021-08-05 21:33:18 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Enhanched SDL-based port of Wolfenstein 3D for various platforms";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "ecwolf";
|
2021-08-05 21:33:18 +00:00
|
|
|
homepage = "https://maniacsvault.net/ecwolf/";
|
|
|
|
license = licenses.gpl2Plus;
|
2023-02-09 11:40:11 +00:00
|
|
|
maintainers = with maintainers; [ jayman2000 sander ];
|
2021-08-05 21:33:18 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|