2023-01-19 15:59:41 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromBitbucket
|
|
|
|
, makeDesktopItem
|
|
|
|
, copyDesktopItems
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, zlib
|
|
|
|
, bzip2
|
|
|
|
, libjpeg
|
|
|
|
, SDL2
|
|
|
|
, SDL2_net
|
|
|
|
, SDL2_mixer
|
2023-01-27 11:56:42 +00:00
|
|
|
, gtk3
|
2023-01-19 15:59:41 +00:00
|
|
|
}:
|
2021-08-09 09:28:34 +00:00
|
|
|
|
2021-07-26 18:05:00 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ecwolf";
|
2023-02-05 11:56:06 +00:00
|
|
|
version = "1.4.1";
|
2021-07-26 18:05:00 +00:00
|
|
|
|
2023-01-19 15:31:54 +00:00
|
|
|
src = fetchFromBitbucket {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-02-05 11:56:06 +00:00
|
|
|
sha256 = "V2pSP8i20zB50WtUMujzij+ISSupdQQ/oCYYrOaTU1g=";
|
2021-07-26 18:05:00 +00:00
|
|
|
};
|
|
|
|
|
2021-08-09 09:28:34 +00:00
|
|
|
nativeBuildInputs = [ cmake copyDesktopItems pkg-config ];
|
2023-01-27 11:56:42 +00:00
|
|
|
buildInputs = [ zlib bzip2 libjpeg SDL2 SDL2_net SDL2_mixer gtk3 ];
|
2021-07-26 18:05:00 +00:00
|
|
|
|
2021-07-27 21:11:09 +00:00
|
|
|
# Disable app bundle creation on Darwin. It fails, and it is not needed to run it from the Nix store
|
2023-01-31 18:28:08 +00:00
|
|
|
preConfigure = lib.optionalString stdenv.isDarwin ''
|
2021-07-27 21:11:09 +00:00
|
|
|
sed -i -e "s|include(\''${CMAKE_CURRENT_SOURCE_DIR}/macosx/install.txt)||" src/CMakeLists.txt
|
2021-07-26 18:05:00 +00:00
|
|
|
'';
|
|
|
|
|
2023-02-04 18:11:54 +00:00
|
|
|
# ECWolf installs its binary to the games/ directory, but Nix only adds bin/
|
|
|
|
# directories to the PATH.
|
|
|
|
postInstall = ''
|
|
|
|
mv "$out/games" "$out/bin"
|
|
|
|
'';
|
|
|
|
|
2021-07-26 18:05:00 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Enhanched SDL-based port of Wolfenstein 3D for various platforms";
|
|
|
|
homepage = "https://maniacsvault.net/ecwolf/";
|
|
|
|
license = licenses.gpl2Plus;
|
2023-01-31 21:17:56 +00:00
|
|
|
maintainers = with maintainers; [ jayman2000 sander ];
|
2021-07-26 18:05:00 +00:00
|
|
|
platforms = platforms.all;
|
2023-01-27 11:56:42 +00:00
|
|
|
# On Darwin, the linker fails to find a bunch of symbols.
|
|
|
|
broken = stdenv.isDarwin;
|
2021-07-26 18:05:00 +00:00
|
|
|
};
|
|
|
|
}
|