diff --git a/pkgs/by-name/gz/gzdoom/package.nix b/pkgs/by-name/gz/gzdoom/package.nix index 17051d7692e6..e0f3fbd2a66e 100644 --- a/pkgs/by-name/gz/gzdoom/package.nix +++ b/pkgs/by-name/gz/gzdoom/package.nix @@ -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 "" "${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