mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
VST3 Host: Use correct path to .so on Linux
This fixes an issue where VST3 plugins failed to scan and load on Linux.
This commit is contained in:
parent
362a1cc070
commit
ca8b5f7483
1 changed files with 28 additions and 2 deletions
|
|
@ -1334,8 +1334,10 @@ public:
|
|||
return handle.getFile();
|
||||
}
|
||||
|
||||
static Ptr getHandle (const File& f)
|
||||
static Ptr getHandle (const String& modulePath)
|
||||
{
|
||||
const auto f = getDLLFileFromBundle (modulePath);
|
||||
|
||||
auto& bundles = getHandles();
|
||||
|
||||
const auto iter = std::find_if (bundles.begin(), bundles.end(), [&] (Ptr x)
|
||||
|
|
@ -1356,6 +1358,30 @@ private:
|
|||
getHandles().insert (this);
|
||||
}
|
||||
|
||||
static File getDLLFileFromBundle (const String& bundlePath)
|
||||
{
|
||||
#if JUCE_LINUX || JUCE_BSD
|
||||
const auto machineName = []() -> String
|
||||
{
|
||||
struct utsname unameData;
|
||||
const auto res = uname (&unameData);
|
||||
|
||||
if (res != 0)
|
||||
return {};
|
||||
|
||||
return unameData.machine;
|
||||
}();
|
||||
|
||||
const File file { bundlePath };
|
||||
|
||||
return file.getChildFile ("Contents")
|
||||
.getChildFile (machineName + "-linux")
|
||||
.getChildFile (file.getFileNameWithoutExtension() + ".so");
|
||||
#else
|
||||
return File { bundlePath };
|
||||
#endif
|
||||
}
|
||||
|
||||
static std::set<RefCountedDllHandle*>& getHandles()
|
||||
{
|
||||
static std::set<RefCountedDllHandle*> bundles;
|
||||
|
|
@ -1373,7 +1399,7 @@ public:
|
|||
static VST3ModuleHandle create (const File& pluginFile, const PluginDescription& desc)
|
||||
{
|
||||
VST3ModuleHandle result;
|
||||
result.handle = RefCountedDllHandle::getHandle (pluginFile);
|
||||
result.handle = RefCountedDllHandle::getHandle (pluginFile.getFullPathName());
|
||||
|
||||
if (result.handle == nullptr)
|
||||
return {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue