Merge pull request #120627 from MetaDark/yabridge

yabridge, yabridgectl: hard code wine path

authored by

Sandro and committed by
GitHub
8efeed72 e9547b6a

+58 -3
+28
pkgs/tools/audio/yabridge/default.nix
··· 1 1 { lib 2 2 , stdenv 3 3 , fetchFromGitHub 4 + , fetchpatch 5 + , substituteAll 4 6 , meson 5 7 , ninja 6 8 , pkg-config ··· 77 79 cp -R --no-preserve=mode,ownership ${vst3.src} vst3 78 80 )''; 79 81 82 + patches = [ 83 + # Fix printing wine version when using absolute path (remove patches in next release): 84 + (fetchpatch { 85 + url = "https://github.com/robbert-vdh/yabridge/commit/2aadf5256b3eafeb86efa8626247972dd33baa13.patch"; 86 + sha256 = "sha256-Nq9TQJxa22vJLmf+USyPBkF8cKyEzb1Lp2Rx86pDxnY="; 87 + }) 88 + (fetchpatch { 89 + url = "https://github.com/robbert-vdh/yabridge/commit/93df3fa1da6ffcc69a5b384ba04e3da7c5ef23ef.patch"; 90 + sha256 = "sha256-//8Dxolqe6n+aFo4yVnnMR9kSq/iEFE0qZPvcIBehvI="; 91 + }) 92 + 93 + # Hard code wine path so wine version is correct in logs 94 + (substituteAll { 95 + src = ./hardcode-wine.patch; 96 + inherit wine; 97 + }) 98 + ]; 99 + 80 100 postPatch = '' 81 101 patchShebangs . 82 102 ''; ··· 115 135 cp yabridge-host.exe{,.so} "$out/bin" 116 136 cp libyabridge-vst2.so "$out/lib" 117 137 cp libyabridge-vst3.so "$out/lib" 138 + ''; 139 + 140 + # Hard code wine path in wrapper scripts generated by winegcc 141 + postFixup = '' 142 + for exe in "$out"/bin/*.exe; do 143 + substituteInPlace "$exe" \ 144 + --replace 'WINELOADER="wine"' 'WINELOADER="${wine}/bin/wine"' 145 + done 118 146 ''; 119 147 120 148 meta = with lib; {
+13
pkgs/tools/audio/yabridge/hardcode-wine.patch
··· 1 + diff --git a/src/plugin/utils.cpp b/src/plugin/utils.cpp 2 + index 1ff05bc..0723456 100644 3 + --- a/src/plugin/utils.cpp 4 + +++ b/src/plugin/utils.cpp 5 + @@ -351,7 +351,7 @@ std::string get_wine_version() { 6 + access(wineloader_path.c_str(), X_OK) == 0) { 7 + wine_path = wineloader_path; 8 + } else { 9 + - wine_path = bp::search_path("wine").string(); 10 + + wine_path = "@wine@/bin/wine"; 11 + } 12 + 13 + bp::ipstream output;
+13 -1
pkgs/tools/audio/yabridgectl/default.nix
··· 1 - { lib, rustPlatform, yabridge }: 1 + { lib 2 + , rustPlatform 3 + , yabridge 4 + , makeWrapper 5 + , wine 6 + }: 2 7 3 8 rustPlatform.buildRustPackage rec { 4 9 pname = "yabridgectl"; ··· 16 21 ]; 17 22 18 23 patchFlags = [ "-p3" ]; 24 + 25 + nativeBuildInputs = [ makeWrapper ]; 26 + 27 + postFixup = '' 28 + wrapProgram "$out/bin/yabridgectl" \ 29 + --prefix PATH : ${lib.makeBinPath [ wine ]} 30 + ''; 19 31 20 32 meta = with lib; { 21 33 description = "A small, optional utility to help set up and update yabridge for several directories at once";
+4 -2
pkgs/top-level/all-packages.nix
··· 807 807 xtrt = callPackage ../tools/archivers/xtrt { }; 808 808 809 809 yabridge = callPackage ../tools/audio/yabridge { 810 - wine = wineWowPackages.minimal; 810 + wine = wineWowPackages.staging; 811 811 }; 812 812 813 - yabridgectl = callPackage ../tools/audio/yabridgectl { }; 813 + yabridgectl = callPackage ../tools/audio/yabridgectl { 814 + wine = wineWowPackages.staging; 815 + }; 814 816 815 817 ### APPLICATIONS/TERMINAL-EMULATORS 816 818