This was preliminarily pinned to SDL2_classic in 2532c6621107f44e0c857c7a3a0bfe01a5c52c58 (#393386). The reason for that was DRM support and an incompatible override interface. sdl3 is build with drm enabled by default, which means building things that depend on drm through sdl2-compat should just work, no override needed.
		
			
				
	
	
		
			97 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			97 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
{
 | 
						|
  stdenv,
 | 
						|
  lib,
 | 
						|
  fetchFromGitHub,
 | 
						|
  fetchpatch,
 | 
						|
  qt6,
 | 
						|
  pkg-config,
 | 
						|
  vulkan-headers,
 | 
						|
  SDL2,
 | 
						|
  SDL2_ttf,
 | 
						|
  ffmpeg,
 | 
						|
  libopus,
 | 
						|
  libplacebo,
 | 
						|
  openssl,
 | 
						|
  alsa-lib,
 | 
						|
  libpulseaudio,
 | 
						|
  libva,
 | 
						|
  libvdpau,
 | 
						|
  libxkbcommon,
 | 
						|
  wayland,
 | 
						|
  libdrm,
 | 
						|
  nix-update-script,
 | 
						|
}:
 | 
						|
 | 
						|
stdenv.mkDerivation (finalAttrs: {
 | 
						|
  pname = "moonlight-qt";
 | 
						|
  version = "6.1.0";
 | 
						|
 | 
						|
  src = fetchFromGitHub {
 | 
						|
    owner = "moonlight-stream";
 | 
						|
    repo = "moonlight-qt";
 | 
						|
    rev = "v${finalAttrs.version}";
 | 
						|
    hash = "sha256-rWVNpfRDLrWsqELPFquA6rW6/AfWV+6DNLUCPqIhle0=";
 | 
						|
    fetchSubmodules = true;
 | 
						|
  };
 | 
						|
 | 
						|
  patches = [
 | 
						|
    # Fix build for Xcode < 14
 | 
						|
    (fetchpatch {
 | 
						|
      url = "https://github.com/moonlight-stream/moonlight-qt/commit/76deafbd7bf868562d69061e7d6abf2612a2c7ad.patch";
 | 
						|
      hash = "sha256-+rXdexZQpOP6yS+oTmvYVxasWxOX16uU1udN75zNX3w=";
 | 
						|
    })
 | 
						|
  ];
 | 
						|
 | 
						|
  nativeBuildInputs = [
 | 
						|
    qt6.qmake
 | 
						|
    qt6.wrapQtAppsHook
 | 
						|
    pkg-config
 | 
						|
    vulkan-headers
 | 
						|
  ];
 | 
						|
 | 
						|
  buildInputs =
 | 
						|
    [
 | 
						|
      SDL2
 | 
						|
      SDL2_ttf
 | 
						|
      ffmpeg
 | 
						|
      libopus
 | 
						|
      libplacebo
 | 
						|
      qt6.qtdeclarative
 | 
						|
      qt6.qtsvg
 | 
						|
      openssl
 | 
						|
    ]
 | 
						|
    ++ lib.optionals stdenv.hostPlatform.isLinux [
 | 
						|
      alsa-lib
 | 
						|
      libpulseaudio
 | 
						|
      libva
 | 
						|
      libvdpau
 | 
						|
      libxkbcommon
 | 
						|
      qt6.qtwayland
 | 
						|
      wayland
 | 
						|
      libdrm
 | 
						|
    ];
 | 
						|
 | 
						|
  qmakeFlags = [ "CONFIG+=disable-prebuilts" ];
 | 
						|
 | 
						|
  postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
 | 
						|
    mkdir $out/Applications $out/bin
 | 
						|
    mv app/Moonlight.app $out/Applications
 | 
						|
    ln -s $out/Applications/Moonlight.app/Contents/MacOS/Moonlight $out/bin/moonlight
 | 
						|
  '';
 | 
						|
 | 
						|
  passthru.updateScript = nix-update-script { };
 | 
						|
 | 
						|
  meta = {
 | 
						|
    changelog = "https://github.com/moonlight-stream/moonlight-qt/releases/tag/v${finalAttrs.version}";
 | 
						|
    description = "Play your PC games on almost any device";
 | 
						|
    homepage = "https://moonlight-stream.org";
 | 
						|
    license = lib.licenses.gpl3Plus;
 | 
						|
    maintainers = with lib.maintainers; [
 | 
						|
      azuwis
 | 
						|
      zmitchell
 | 
						|
    ];
 | 
						|
    platforms = lib.platforms.all;
 | 
						|
    mainProgram = "moonlight";
 | 
						|
  };
 | 
						|
})
 |