moonlight-qt: Support darwin (#239600)

This commit is contained in:
Zhong Jianxin
2023-06-29 19:29:24 -04:00
committed by GitHub
parent b1434f14da
commit 1cdf0bddc8
3 changed files with 64 additions and 5 deletions
@@ -0,0 +1,38 @@
--- a/app/app.pro 2023-06-24 19:10:00.653377668 +0800
+++ b/app/app.pro 2023-06-24 19:20:06.632188299 +0800
@@ -49,19 +49,8 @@
INCLUDEPATH += $$PWD/../libs/windows/include
LIBS += ws2_32.lib winmm.lib dxva2.lib ole32.lib gdi32.lib user32.lib d3d9.lib dwmapi.lib dbghelp.lib
}
-macx {
- INCLUDEPATH += $$PWD/../libs/mac/include
- INCLUDEPATH += $$PWD/../libs/mac/Frameworks/SDL2.framework/Versions/A/Headers
- INCLUDEPATH += $$PWD/../libs/mac/Frameworks/SDL2_ttf.framework/Versions/A/Headers
- LIBS += -L$$PWD/../libs/mac/lib -F$$PWD/../libs/mac/Frameworks
-
- # QMake doesn't handle framework-style includes correctly on its own
- QMAKE_CFLAGS += -F$$PWD/../libs/mac/Frameworks
- QMAKE_CXXFLAGS += -F$$PWD/../libs/mac/Frameworks
- QMAKE_OBJECTIVE_CFLAGS += -F$$PWD/../libs/mac/Frameworks
-}
-unix:!macx {
+unix {
CONFIG += link_pkgconfig
PKGCONFIG += openssl sdl2 SDL2_ttf opus
@@ -120,13 +109,12 @@
CONFIG += soundio discord-rpc
}
macx {
- LIBS += -lssl -lcrypto -lavcodec.59 -lavutil.57 -lopus -framework SDL2 -framework SDL2_ttf
LIBS += -lobjc -framework VideoToolbox -framework AVFoundation -framework CoreVideo -framework CoreGraphics -framework CoreMedia -framework AppKit -framework Metal
# For libsoundio
LIBS += -framework CoreAudio -framework AudioUnit
- CONFIG += ffmpeg soundio discord-rpc
+ CONFIG += ffmpeg soundio
}
SOURCES += \
@@ -16,8 +16,13 @@
, libopus
, ffmpeg
, wayland
, darwin
}:
let
inherit (darwin.apple_sdk_11_0.frameworks) AVFoundation AppKit AudioUnit VideoToolbox;
in
stdenv.mkDerivation rec {
pname = "moonlight-qt";
version = "4.3.1";
@@ -30,6 +35,8 @@ stdenv.mkDerivation rec {
fetchSubmodules = true;
};
patches = [ ./darwin.diff ];
nativeBuildInputs = [
wrapQtAppsHook
pkg-config
@@ -40,17 +47,30 @@ stdenv.mkDerivation rec {
qtquickcontrols2
SDL2
SDL2_ttf
openssl
libopus
ffmpeg
] ++ lib.optionals stdenv.isLinux [
libva
libvdpau
libxkbcommon
alsa-lib
libpulseaudio
openssl
libopus
ffmpeg
wayland
] ++ lib.optionals stdenv.isDarwin [
AVFoundation
AppKit
AudioUnit
VideoToolbox
];
postInstall = lib.optionalString stdenv.isDarwin ''
mkdir $out/Applications $out/bin
mv app/Moonlight.app $out/Applications
rm -r $out/Applications/Moonlight.app/Contents/Frameworks
ln -s $out/Applications/Moonlight.app/Contents/MacOS/Moonlight $out/bin/moonlight
'';
meta = with lib; {
description = "Play your PC games on almost any device";
homepage = "https://moonlight-stream.org";
+3 -2
View File
@@ -32993,11 +32993,12 @@ with pkgs;
moonlight-embedded = callPackage ../applications/misc/moonlight-embedded { };
moonlight-qt = libsForQt5.callPackage ../applications/misc/moonlight-qt {
moonlight-qt = libsForQt5.callPackage ../applications/misc/moonlight-qt ({
} // lib.optionalAttrs stdenv.isLinux {
SDL2 = buildPackages.SDL2.override {
drmSupport = true;
};
};
});
mooSpace = callPackage ../applications/audio/mooSpace { };