Code change:
<ins> diff --git a/tools/yabridgectl/src/config.rs b/tools/yabridgectl/src/config.rs index c1c89cf..d7bd822 100644 --- a/tools/yabridgectl/src/config.rs +++ b/tools/yabridgectl/src/config.rs @@ -23,6 +23,7 @@ use std::collections::{BTreeMap, BTreeSet}; use std::env; use std::fmt::Display; use std::fs; +use std::iter; use std::path::{Path, PathBuf}; use which::which; use xdg::BaseDirectories; @@ -216,34 +217,24 @@ impl Config { } } None => { -                // Search in the system library locations and in `~/.local/share/yabridge` if no -                // path was set explicitely. We'll also search through `/usr/local/lib` just in case -                // but since we advocate against installing yabridge there we won't list this path -                // in the error message when `libyabridge-vst2.so` can't be found. -                let system_path = Path::new("/usr/lib"); +                // Search through NIX_PROFILES & data home directory if no path was set explicitly. +                let nix_profiles = env::var("NIX_PROFILES"); let user_path = xdg_dirs.get_data_home(); -                let lib_directories = [ -                    system_path, -                    // Used on Debian based distros -                    Path::new("/usr/lib/x86_64-linux-gnu"), -                    // Used on Fedora -                    Path::new("/usr/lib64"), -                    Path::new("/usr/local/lib"), -                    Path::new("/usr/local/lib/x86_64-linux-gnu"), -                    Path::new("/usr/local/lib64"), -                    &user_path, -                ]; +                let lib_directories = nix_profiles.iter() +                    .flat_map(|profiles| profiles.split(' ') +                              .map(|profile| Path::new(profile).join("lib"))) +                    .chain(iter::once(user_path.clone())); + let mut candidates = lib_directories -                    .iter() .map(|directory| directory.join(LIBYABRIDGE_VST2_NAME)); + match candidates.find(|directory| directory.exists()) { Some(candidate) => candidate, _ => { return Err(anyhow!( -                            "Could not find '{}' in either '{}' or '{}'. You can override the  -                            default search path using 'yabridgectl set --path=<path>'.", +                            "Could not find '{}' through 'NIX_PROFILES' or '{}'. You can override the  +                             default search path using 'yabridgectl set --path=<path>'.", LIBYABRIDGE_VST2_NAME, -                            system_path.display(), user_path.display() )); } diff --git a/tools/yabridgectl/src/main.rs b/tools/yabridgectl/src/main.rs index 0db1bd4..221cdd0 100644 --- a/tools/yabridgectl/src/main.rs +++ b/tools/yabridgectl/src/main.rs @@ -102,7 +102,7 @@ fn main() -> Result<()> { .about("Path to the directory containing 'libyabridge-{vst2,vst3}.so'") .long_about( "Path to the directory containing 'libyabridge-{vst2,vst3}.so'. If this  -                             is not set, then yabridgectl will look in both '/usr/lib' and  +                             is not set, then yabridgectl will look through 'NIX_PROFILES' and  '~/.local/share/yabridge' by default.", ) .validator(validate_path) </ins>

Related discussion:
text: I saw that the package created by for yabridge 2.2.1 has not been merged yet, but please let me know if you want to update the yabridge and yabridgectl packages for yabridge 3.0.0 and need any help! One additional dependency is now a patched version of the VST3 SDK which is patched to compile under winegcc and with support for Meson. I'm not quite sure how Nix packaging handles those things.
Thanks, I have it building right now. I'm just testing out vst3 plugins right now :smile:
:cry: For some reason neither the vst2 or vst3 plugins are working, even though they get synced. I think it might be an issue with my system installed wine. I'll submit my changes anyway so other people can test it out.
So they are found but yabridge fails to load them? Which Wine are your derivations using?
You can try running manually to see if that is the issue. A plain call should print: And should print:
I'm able to sync them with yabridgectl, but they fail to load in Reaper. I'm using (currently version 6.0) to build yabridge, but I have a custom build of wine staging 6.0 currently installed. seems to be working fine:
That indeed seems to work as expected, that's great news! If you start REAPER with and then take a look at after trying to scan/load a plugin then you'll probably be able to figure out what's wrong very quickly.
Hmm, apparently the path to the VST host is too long :stuckouttongue:
Huh I can't think of from the top of my head what would be throwing such an exception. That message printed after comes from a try-catch around the entire plugin startup that catches and prints any . Windows (and thus Wine, because it has to be compatible haha) has a path name limit of 255 characters, but none of those paths sound like they should come close to that.
Yeah, sorry. It was just a problem with my home environment. I was trying to test it without installing because I lost the nixpkgs commit I used to generate my home-manager environment.