Unverified Commit ff389616 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

Merge pull request #319743 from azuwis/moonlight-qt

moonlight-qt: 5.0.1 -> 6.0.1, and other enhancements
parents ab0b07ea f3cf3042
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@

- [AMDVLK](https://github.com/GPUOpen-Drivers/AMDVLK), AMD's open source Vulkan driver, is now available to be configured as `hardware.amdgpu.amdvlk` option.
  This also allows configuring runtime settings of AMDVLK and enabling experimental features.
- The `moonlight-qt` package ([Moonlight game streaming](https://moonlight-stream.org/)) now has HDR support on Linux systems.

## New Services {#sec-release-24.11-new-services}

+0 −38
Original line number Diff line number Diff line
--- 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.60 -lavutil.58 -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 += \
+101 −0
Original line number Diff line number Diff line
{ stdenv
, lib
, fetchFromGitHub
, wrapQtAppsHook
, pkg-config
, qmake
, qtquickcontrols2
, SDL2
, SDL2_ttf
, libva
, libvdpau
, libxkbcommon
, alsa-lib
, libpulseaudio
, openssl
, libopus
, ffmpeg
, wayland
, darwin
{
  stdenv,
  lib,
  fetchFromGitHub,
  darwin,
  overrideSDK,
  libsForQt5,
  pkg-config,
  vulkan-headers,
  SDL2,
  SDL2_ttf,
  ffmpeg,
  libopus,
  libplacebo,
  openssl,
  alsa-lib,
  libpulseaudio,
  libva,
  libvdpau,
  libxkbcommon,
  wayland,
  nix-update-script,
}:

let
  inherit (darwin.apple_sdk_11_0.frameworks) AVFoundation AppKit AudioUnit VideoToolbox;
  inherit (darwin.apple_sdk_11_0.frameworks)
    AVFoundation
    AppKit
    AudioUnit
    VideoToolbox
    ;
  stdenv' = if stdenv.isDarwin then overrideSDK stdenv "11.0" else stdenv;
in

stdenv.mkDerivation rec {
stdenv'.mkDerivation rec {
  pname = "moonlight-qt";
  version = "5.0.1";
  version = "6.0.1";

  src = fetchFromGitHub {
    owner = "moonlight-stream";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-0ONjUqpM1tUnyaEnMgVl7ff6pND7kyqouv2mpgteZP0=";
    sha256 = "sha256-zrl8WPXvQ/7FTqFnpwoXEJ85prtgJWoWNsdckw5+JHI=";
    fetchSubmodules = true;
  };

  patches = [ ./darwin.diff ];

  nativeBuildInputs = [
    wrapQtAppsHook
    libsForQt5.qmake
    libsForQt5.wrapQtAppsHook
    pkg-config
    qmake
    vulkan-headers
  ];

  buildInputs = [
    qtquickcontrols2
    SDL2
  buildInputs =
    [
      (SDL2.override { drmSupport = stdenv.isLinux; })
      SDL2_ttf
    openssl
    libopus
      ffmpeg
  ] ++ lib.optionals stdenv.isLinux [
      libopus
      libplacebo
      libsForQt5.qtquickcontrols2
      openssl
    ]
    ++ lib.optionals stdenv.isLinux [
      alsa-lib
      libpulseaudio
      libva
      libvdpau
      libxkbcommon
    alsa-lib
    libpulseaudio
      wayland
  ] ++ lib.optionals stdenv.isDarwin [
    ]
    ++ lib.optionals stdenv.isDarwin [
      AVFoundation
      AppKit
      AudioUnit
      VideoToolbox
    ];

  qmakeFlags = [ "CONFIG+=disable-prebuilts" ];

  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
  '';

  passthru.updateScript = nix-update-script { };

  meta = with lib; {
    description = "Play your PC games on almost any device";
    homepage = "https://moonlight-stream.org";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ luc65r ];
    maintainers = with maintainers; [
      azuwis
      luc65r
      zmitchell
    ];
    platforms = platforms.all;
    mainProgram = "moonlight";
  };
+0 −7
Original line number Diff line number Diff line
@@ -32562,13 +32562,6 @@ with pkgs;
  moonlight-embedded = callPackage ../applications/misc/moonlight-embedded { };
  moonlight-qt = libsForQt5.callPackage ../applications/misc/moonlight-qt {
    stdenv = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv;
    SDL2 = buildPackages.SDL2.override {
      drmSupport = stdenv.isLinux;
    };
  };
  mooSpace = callPackage ../applications/audio/mooSpace { };
  mop = callPackage ../applications/misc/mop { };