2024-09-19 14:19:46 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
makeWrapper,
|
|
|
|
makeDesktopItem,
|
|
|
|
copyDesktopItems,
|
|
|
|
SDL2,
|
|
|
|
bzip2,
|
|
|
|
cmake,
|
|
|
|
fluidsynth,
|
|
|
|
game-music-emu,
|
|
|
|
gtk3,
|
|
|
|
imagemagick,
|
|
|
|
libGL,
|
|
|
|
libjpeg,
|
|
|
|
libsndfile,
|
|
|
|
libvpx,
|
|
|
|
libwebp,
|
|
|
|
mpg123,
|
|
|
|
ninja,
|
|
|
|
openal,
|
|
|
|
pkg-config,
|
|
|
|
vulkan-loader,
|
|
|
|
zlib,
|
|
|
|
zmusic,
|
2022-12-17 10:02:37 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "gzdoom";
|
2024-10-11 05:15:48 +00:00
|
|
|
version = "4.13.0";
|
2022-12-17 10:02:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ZDoom";
|
|
|
|
repo = "gzdoom";
|
|
|
|
rev = "g${version}";
|
|
|
|
fetchSubmodules = true;
|
2024-10-11 05:15:48 +00:00
|
|
|
hash = "sha256-Cm4ww/QXTzRiSojeGtZ+CwAL2oSxKaTaTLiGkcNjxaE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"doc"
|
|
|
|
];
|
2022-12-17 10:02:37 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
copyDesktopItems
|
2023-11-16 04:20:00 +00:00
|
|
|
imagemagick
|
2022-12-17 10:02:37 +00:00
|
|
|
makeWrapper
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
SDL2
|
|
|
|
bzip2
|
|
|
|
fluidsynth
|
|
|
|
game-music-emu
|
|
|
|
gtk3
|
|
|
|
libGL
|
|
|
|
libjpeg
|
|
|
|
libsndfile
|
|
|
|
libvpx
|
2023-10-09 19:29:22 +00:00
|
|
|
libwebp
|
2022-12-17 10:02:37 +00:00
|
|
|
mpg123
|
|
|
|
openal
|
|
|
|
vulkan-loader
|
|
|
|
zlib
|
|
|
|
zmusic
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace tools/updaterevision/UpdateRevision.cmake \
|
2024-09-19 14:19:46 +00:00
|
|
|
--replace-fail "ret_var(Tag)" "ret_var(\"${src.rev}\")" \
|
|
|
|
--replace-fail "ret_var(Timestamp)" "ret_var(\"1970-00-00 00:00:00 +0000\")" \
|
|
|
|
--replace-fail "ret_var(Hash)" "ret_var(\"${src.rev}\")" \
|
|
|
|
--replace-fail "<unknown version>" "${src.rev}"
|
2022-12-17 10:02:37 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DDYN_GTK=OFF"
|
|
|
|
"-DDYN_OPENAL=OFF"
|
|
|
|
];
|
|
|
|
|
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = "gzdoom";
|
|
|
|
exec = "gzdoom";
|
|
|
|
desktopName = "GZDoom";
|
2023-11-16 04:20:00 +00:00
|
|
|
comment = meta.description;
|
|
|
|
icon = "gzdoom";
|
2022-12-17 10:02:37 +00:00
|
|
|
categories = [ "Game" ];
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mv $out/bin/gzdoom $out/share/games/doom/gzdoom
|
2024-09-19 14:19:46 +00:00
|
|
|
makeWrapper $out/share/games/doom/gzdoom $out/bin/gzdoom \
|
|
|
|
--set LD_LIBRARY_PATH ${lib.makeLibraryPath [ vulkan-loader ]}
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
for size in 16 24 32 48 64 128; do
|
|
|
|
mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps
|
2024-09-19 14:19:46 +00:00
|
|
|
magick $src/src/win32/icon1.ico -background none -resize "$size"x"$size" -flatten \
|
|
|
|
$out/share/icons/hicolor/"$size"x"$size"/apps/gzdoom.png
|
2023-11-16 04:20:00 +00:00
|
|
|
done;
|
2022-12-17 10:02:37 +00:00
|
|
|
'';
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
meta = {
|
2022-12-17 10:02:37 +00:00
|
|
|
homepage = "https://github.com/ZDoom/gzdoom";
|
|
|
|
description = "Modder-friendly OpenGL and Vulkan source port based on the DOOM engine";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "gzdoom";
|
2022-12-17 10:02:37 +00:00
|
|
|
longDescription = ''
|
|
|
|
GZDoom is a feature centric port for all DOOM engine games, based on
|
|
|
|
ZDoom, adding an OpenGL renderer and powerful scripting capabilities.
|
2020-07-18 16:06:22 +00:00
|
|
|
'';
|
2024-09-19 14:19:46 +00:00
|
|
|
license = lib.licenses.gpl3Plus;
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
maintainers = with lib.maintainers; [
|
|
|
|
azahi
|
|
|
|
lassulus
|
|
|
|
Gliczy
|
|
|
|
];
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
2022-12-17 10:02:37 +00:00
|
|
|
}
|