gzdoom: add darwin builds support

This commit is contained in:
r4v3n6101
2025-02-15 04:46:18 +03:00
parent 118f0c5fc0
commit 7e379d28dc
+20 -19
View File
@@ -8,16 +8,13 @@
SDL2,
bzip2,
cmake,
fluidsynth,
game-music-emu,
gtk3,
imagemagick,
libGL,
libjpeg,
libsndfile,
libvpx,
libwebp,
mpg123,
ninja,
openal,
pkg-config,
@@ -40,35 +37,32 @@ stdenv.mkDerivation rec {
patches = [ ./string_format.patch ];
outputs = [
"out"
"doc"
];
outputs = [ "out" ] ++ lib.optionals stdenv.hostPlatform.isLinux [ "doc" ];
nativeBuildInputs = [
cmake
copyDesktopItems
imagemagick
makeWrapper
ninja
pkg-config
];
] ++ lib.optionals stdenv.hostPlatform.isLinux [ copyDesktopItems ];
buildInputs = [
SDL2
zlib
bzip2
fluidsynth
game-music-emu
gtk3
# Graphics
libGL
libjpeg
libsndfile
libvpx
libwebp
mpg123
openal
vulkan-loader
zlib
# Sound (ZMusic contain MIDI libs)
game-music-emu
openal
zmusic
];
@@ -80,12 +74,14 @@ stdenv.mkDerivation rec {
--replace-fail "<unknown version>" "${src.rev}"
'';
# Apple dropped GL support
# Shader's loading will throw an error while linking
cmakeFlags = [
"-DDYN_GTK=OFF"
"-DDYN_OPENAL=OFF"
];
] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "-DHAVE_GLES2=OFF" ];
desktopItems = [
desktopItems = lib.optionals stdenv.hostPlatform.isLinux [
(makeDesktopItem {
name = "gzdoom";
exec = "gzdoom";
@@ -96,7 +92,12 @@ stdenv.mkDerivation rec {
})
];
postInstall = ''
installPhase = lib.optionalString stdenv.hostPlatform.isDarwin ''
mkdir -p "$out/Applications"
mv gzdoom.app "$out/Applications/"
'';
postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
mv $out/bin/gzdoom $out/share/games/doom/gzdoom
makeWrapper $out/share/games/doom/gzdoom $out/bin/gzdoom \
--set LD_LIBRARY_PATH ${lib.makeLibraryPath [ vulkan-loader ]}
@@ -117,7 +118,7 @@ stdenv.mkDerivation rec {
ZDoom, adding an OpenGL renderer and powerful scripting capabilities.
'';
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.linux;
platforms = with lib.platforms; linux ++ darwin;
maintainers = with lib.maintainers; [
azahi
lassulus