2023-01-19 15:59:41 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromBitbucket
|
|
|
|
, makeDesktopItem
|
|
|
|
, copyDesktopItems
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, zlib
|
|
|
|
, bzip2
|
|
|
|
, libjpeg
|
|
|
|
, SDL2
|
|
|
|
, SDL2_net
|
|
|
|
, SDL2_mixer
|
|
|
|
, gtk2
|
|
|
|
}:
|
2021-08-09 09:28:34 +00:00
|
|
|
|
2021-07-26 18:05:00 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ecwolf";
|
2023-01-19 15:59:41 +00:00
|
|
|
version = "1.4.0";
|
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-01-19 15:59:41 +00:00
|
|
|
sha256 = "n1G1zvfE1l42fbJ7ZaMdV0QXn45PjMpaaZTDQAOBtYk=";
|
2021-07-26 18:05:00 +00:00
|
|
|
};
|
|
|
|
|
2021-08-09 09:28:34 +00:00
|
|
|
nativeBuildInputs = [ cmake copyDesktopItems pkg-config ];
|
2023-01-19 15:59:41 +00:00
|
|
|
buildInputs = [ zlib bzip2 libjpeg SDL2 SDL2_net SDL2_mixer gtk2 ];
|
2021-07-26 18:05:00 +00:00
|
|
|
|
2021-08-09 09:28:34 +00:00
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = "ecwolf";
|
|
|
|
exec = "ecwolf";
|
|
|
|
comment = "Enhanced Wolfenstein 3D port";
|
|
|
|
desktopName = "Wolfenstein 3D";
|
2022-02-22 14:56:15 +00:00
|
|
|
categories = [ "Game" ];
|
2021-08-09 09:28:34 +00:00
|
|
|
})
|
|
|
|
];
|
2021-07-26 18:05:00 +00:00
|
|
|
|
|
|
|
# Change the location where the ecwolf executable looks for the ecwolf.pk3
|
|
|
|
# file.
|
|
|
|
#
|
|
|
|
# By default, it expects the PK3 file to reside in the same directory as the
|
|
|
|
# executable, which is not desirable.
|
|
|
|
# We will adjust the code so that it can be retrieved from the share/
|
|
|
|
# directory.
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
sed -i -e "s|ecwolf.pk3|$out/share/ecwolf/ecwolf.pk3|" src/version.h
|
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
|
2021-08-09 09:28:34 +00:00
|
|
|
+ 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
|
|
|
'';
|
|
|
|
|
|
|
|
# Install the required PK3 file in the required data directory
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/ecwolf
|
|
|
|
cp ecwolf.pk3 $out/share/ecwolf
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2023-01-19 15:59:41 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2021-07-26 18:05:00 +00:00
|
|
|
description = "Enhanched SDL-based port of Wolfenstein 3D for various platforms";
|
|
|
|
homepage = "https://maniacsvault.net/ecwolf/";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = with maintainers; [ sander ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|