nixpkgs/pkgs/by-name/gz/gzdoom/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

126 lines
2.5 KiB
Nix
Raw Normal View History

2024-09-12 20:44:25 +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-12 20:56:49 +00:00
}:
stdenv.mkDerivation rec {
pname = "gzdoom";
2024-10-31 13:52:24 +00:00
version = "4.13.2";
2022-12-12 20:56:49 +00:00
src = fetchFromGitHub {
owner = "ZDoom";
repo = "gzdoom";
rev = "g${version}";
fetchSubmodules = true;
2024-10-31 13:52:24 +00:00
hash = "sha256-3nkdpJ3XO58YHtjVTwxdSdCL6CnMcih6mTnI7FXLm34=";
2015-05-10 17:50:56 +00:00
};
2024-09-12 20:44:25 +00:00
outputs = [
"out"
"doc"
];
2022-12-12 20:56:49 +00:00
nativeBuildInputs = [
cmake
copyDesktopItems
2023-10-22 15:48:00 +00:00
imagemagick
2022-12-12 20:56:49 +00:00
makeWrapper
ninja
pkg-config
];
buildInputs = [
SDL2
bzip2
fluidsynth
game-music-emu
gtk3
libGL
libjpeg
libsndfile
libvpx
libwebp
2022-12-12 20:56:49 +00:00
mpg123
openal
vulkan-loader
zlib
zmusic
];
postPatch = ''
substituteInPlace tools/updaterevision/UpdateRevision.cmake \
2024-09-12 20:41:09 +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-12 20:56:49 +00:00
'';
cmakeFlags = [
"-DDYN_GTK=OFF"
"-DDYN_OPENAL=OFF"
];
desktopItems = [
(makeDesktopItem {
name = "gzdoom";
exec = "gzdoom";
desktopName = "GZDoom";
2023-10-22 15:48:00 +00:00
comment = meta.description;
icon = "gzdoom";
2022-12-12 20:56:49 +00:00
categories = [ "Game" ];
})
];
postInstall = ''
mv $out/bin/gzdoom $out/share/games/doom/gzdoom
2024-09-12 20:39:33 +00:00
makeWrapper $out/share/games/doom/gzdoom $out/bin/gzdoom \
--set LD_LIBRARY_PATH ${lib.makeLibraryPath [ vulkan-loader ]}
2023-10-22 15:48: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-12 20:41:09 +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-10-22 15:48:00 +00:00
done;
2022-12-12 20:56:49 +00:00
'';
2024-09-12 20:44:25 +00:00
meta = {
2022-12-12 20:56:49 +00:00
homepage = "https://github.com/ZDoom/gzdoom";
description = "Modder-friendly OpenGL and Vulkan source port based on the DOOM engine";
mainProgram = "gzdoom";
2022-12-12 20:56:49 +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.
'';
2024-09-12 20:44:25 +00:00
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [
azahi
lassulus
2024-09-12 20:47:01 +00:00
Gliczy
2024-09-12 20:44:25 +00:00
];
};
2022-12-12 20:56:49 +00:00
}