gzdoom: add darwin support (#382087)

This commit is contained in:
Azat Bahawi
2025-02-15 16:51:03 +03:00
committed by GitHub
3 changed files with 31 additions and 24 deletions
+7
View File
@@ -19212,6 +19212,13 @@
githubId = 20760527;
name = "Madelyn";
};
r4v3n6101 = {
name = "r4v3n6101";
email = "raven6107@gmail.com";
github = "r4v3n6101";
githubId = 30029970;
keys = [ { fingerprint = "FA05 8A29 B45E 06C0 8FE9 4907 05D2 BE42 F3EC D7CC"; } ];
};
raboof = {
email = "arnout@bzzt.net";
matrix = "@raboof:matrix.org";
+21 -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,11 +118,12 @@ 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
Gliczy
r4v3n6101
];
};
}
+3 -5
View File
@@ -29,9 +29,7 @@ stdenv.mkDerivation rec {
"dev"
];
patches = [
./fluidsynth.patch
];
patches = [ ./fluidsynth.patch ];
postPatch = ''
substituteInPlace source/mididevices/music_fluidsynth_mididevice.cpp \
@@ -46,12 +44,11 @@ stdenv.mkDerivation rec {
];
buildInputs = [
alsa-lib
fluidsynth
libsndfile
mpg123
zlib
];
] ++ lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib ];
meta = {
description = "GZDoom's music system as a standalone library";
@@ -67,6 +64,7 @@ stdenv.mkDerivation rec {
azahi
lassulus
Gliczy
r4v3n6101
];
};
}