From 31cb06a26a8218099b4b0890f383936a353dbfa7 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Wed, 27 Nov 2024 23:50:00 +0100 Subject: [PATCH] vapoursynth-editor: fix darwin build --- pkgs/by-name/va/vapoursynth/editor.nix | 33 +++++++++++++++++++------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/va/vapoursynth/editor.nix b/pkgs/by-name/va/vapoursynth/editor.nix index 25d583148eb2..b426d111c799 100644 --- a/pkgs/by-name/va/vapoursynth/editor.nix +++ b/pkgs/by-name/va/vapoursynth/editor.nix @@ -1,5 +1,6 @@ { lib, + stdenv, mkDerivation, fetchFromGitHub, makeWrapper, @@ -23,6 +24,11 @@ let hash = "sha256-+/9j9DJDGXbuTvE8ZXIu6wjcof39SyatS36Q6y9hLPg="; }; + postPatch = '' + substituteInPlace pro/vsedit/vsedit.pro \ + --replace-fail "TARGET = vsedit-32bit" "TARGET = vsedit" + ''; + nativeBuildInputs = [ qmake ]; buildInputs = [ qtbase @@ -34,14 +40,25 @@ let preConfigure = "cd pro"; - preFixup = '' - cd ../build/release* - mkdir -p $out/bin - for bin in vsedit{,-job-server{,-watcher}}; do - mv $bin $out/bin - wrapQtApp $out/bin/$bin - done - ''; + preFixup = + '' + cd ../build/release* + mkdir -p $out/bin + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/Applications + for bin in vsedit{,-job-server{,-watcher}}; do + mv $bin.app $out/Applications + makeQtWrapper $out/Applications/$bin.app/Contents/MacOS/$bin $out/bin/$bin + wrapQtApp $out/Applications/$bin.app/Contents/MacOS/$bin + done + '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + for bin in vsedit{,-job-server{,-watcher}}; do + mv $bin $out/bin + wrapQtApp $out/bin/$bin + done + ''; passthru = { inherit withPlugins;