diff --git a/pkgs/tools/audio/yabridge/default.nix b/pkgs/tools/audio/yabridge/default.nix index c09045bdb6e..d8ddf3ee561 100644 --- a/pkgs/tools/audio/yabridge/default.nix +++ b/pkgs/tools/audio/yabridge/default.nix @@ -1,6 +1,8 @@ { lib , stdenv , fetchFromGitHub +, fetchpatch +, substituteAll , meson , ninja , pkg-config @@ -77,6 +79,24 @@ in stdenv.mkDerivation rec { cp -R --no-preserve=mode,ownership ${vst3.src} vst3 )''; + patches = [ + # Fix printing wine version when using absolute path (remove patches in next release): + (fetchpatch { + url = "https://github.com/robbert-vdh/yabridge/commit/2aadf5256b3eafeb86efa8626247972dd33baa13.patch"; + sha256 = "sha256-Nq9TQJxa22vJLmf+USyPBkF8cKyEzb1Lp2Rx86pDxnY="; + }) + (fetchpatch { + url = "https://github.com/robbert-vdh/yabridge/commit/93df3fa1da6ffcc69a5b384ba04e3da7c5ef23ef.patch"; + sha256 = "sha256-//8Dxolqe6n+aFo4yVnnMR9kSq/iEFE0qZPvcIBehvI="; + }) + + # Hard code wine path so wine version is correct in logs + (substituteAll { + src = ./hardcode-wine.patch; + inherit wine; + }) + ]; + postPatch = '' patchShebangs . ''; @@ -117,6 +137,14 @@ in stdenv.mkDerivation rec { cp libyabridge-vst3.so "$out/lib" ''; + # Hard code wine path in wrapper scripts generated by winegcc + postFixup = '' + for exe in "$out"/bin/*.exe; do + substituteInPlace "$exe" \ + --replace 'WINELOADER="wine"' 'WINELOADER="${wine}/bin/wine"' + done + ''; + meta = with lib; { description = "Yet Another VST bridge, run Windows VST2 plugins under Linux"; homepage = "https://github.com/robbert-vdh/yabridge"; diff --git a/pkgs/tools/audio/yabridge/hardcode-wine.patch b/pkgs/tools/audio/yabridge/hardcode-wine.patch new file mode 100644 index 00000000000..2b6ce1f448f --- /dev/null +++ b/pkgs/tools/audio/yabridge/hardcode-wine.patch @@ -0,0 +1,13 @@ +diff --git a/src/plugin/utils.cpp b/src/plugin/utils.cpp +index 1ff05bc..0723456 100644 +--- a/src/plugin/utils.cpp ++++ b/src/plugin/utils.cpp +@@ -351,7 +351,7 @@ std::string get_wine_version() { + access(wineloader_path.c_str(), X_OK) == 0) { + wine_path = wineloader_path; + } else { +- wine_path = bp::search_path("wine").string(); ++ wine_path = "@wine@/bin/wine"; + } + + bp::ipstream output; diff --git a/pkgs/tools/audio/yabridgectl/default.nix b/pkgs/tools/audio/yabridgectl/default.nix index 4548b288b69..2cbaf3f4ad5 100644 --- a/pkgs/tools/audio/yabridgectl/default.nix +++ b/pkgs/tools/audio/yabridgectl/default.nix @@ -1,4 +1,9 @@ -{ lib, rustPlatform, yabridge }: +{ lib +, rustPlatform +, yabridge +, makeWrapper +, wine +}: rustPlatform.buildRustPackage rec { pname = "yabridgectl"; @@ -17,6 +22,13 @@ rustPlatform.buildRustPackage rec { patchFlags = [ "-p3" ]; + nativeBuildInputs = [ makeWrapper ]; + + postFixup = '' + wrapProgram "$out/bin/yabridgectl" \ + --prefix PATH : ${lib.makeBinPath [ wine ]} + ''; + meta = with lib; { description = "A small, optional utility to help set up and update yabridge for several directories at once"; homepage = "https://github.com/robbert-vdh/yabridge/tree/master/tools/yabridgectl"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d6156bbcdeb..17289ffaa5f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -807,10 +807,12 @@ in xtrt = callPackage ../tools/archivers/xtrt { }; yabridge = callPackage ../tools/audio/yabridge { - wine = wineWowPackages.minimal; + wine = wineWowPackages.staging; }; - yabridgectl = callPackage ../tools/audio/yabridgectl { }; + yabridgectl = callPackage ../tools/audio/yabridgectl { + wine = wineWowPackages.staging; + }; ### APPLICATIONS/TERMINAL-EMULATORS