yabridge, yabridgectl: hard code wine path

This commit is contained in:
Kira Bruneau 2021-04-20 16:08:20 -04:00
parent 79cb2cb986
commit 9cbe07c1b2
4 changed files with 58 additions and 3 deletions

View file

@ -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";

View file

@ -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;

View file

@ -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";

View file

@ -803,10 +803,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