From 0da1ef93cb1ce9c6f4917734e8030a92cddf394e Mon Sep 17 00:00:00 2001 From: Matteo Pacini Date: Thu, 4 Jul 2024 21:51:03 +0100 Subject: [PATCH] melonDS: darwin support --- pkgs/by-name/me/melonDS/package.nix | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/me/melonDS/package.nix b/pkgs/by-name/me/melonDS/package.nix index 6f66934fd0e4..1eafaf9d6294 100644 --- a/pkgs/by-name/me/melonDS/package.nix +++ b/pkgs/by-name/me/melonDS/package.nix @@ -7,6 +7,7 @@ , libarchive , libpcap , libsForQt5 +, qt6 , libslirp , pkg-config , stdenv @@ -16,7 +17,8 @@ }: let - inherit (libsForQt5) + qt = if stdenv.isLinux then libsForQt5 else qt6; + inherit (qt) qtbase qtmultimedia wrapQtAppsHook; @@ -46,16 +48,26 @@ stdenv.mkDerivation (finalAttrs: { libGL qtbase qtmultimedia - wayland zstd + ] ++ lib.optionals stdenv.isLinux [ + wayland ]; strictDeps = true; - qtWrapperArgs = [ + qtWrapperArgs = lib.optionals stdenv.isLinux [ "--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libpcap ]}" + ] ++ lib.optionals stdenv.isDarwin [ + "--prefix DYLD_LIBRARY_PATH : ${lib.makeLibraryPath [ libpcap ]}" ]; + installPhase = lib.optionalString stdenv.isDarwin '' + runHook preInstall + mkdir -p $out/Applications + cp -r melonDS.app $out/Applications/ + runHook postInstall + ''; + passthru = { updateScript = unstableGitUpdater { }; }; @@ -88,6 +100,6 @@ stdenv.mkDerivation (finalAttrs: { benley shamilton ]; - platforms = lib.platforms.linux; + platforms = lib.platforms.linux ++ lib.platforms.darwin; }; })