changeset 41:f1326adbb33b

Use actual plugin path
author Chris Cannam
date Thu, 19 Dec 2019 13:44:39 +0000
parents eb1788a438dc
children 37d79024d966
files installer.cpp installer.pro
diffstat 2 files changed, 37 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/installer.cpp	Wed Dec 18 17:30:08 2019 +0000
+++ b/installer.cpp	Thu Dec 19 13:44:39 2019 +0000
@@ -4,11 +4,19 @@
 #include <QFile>
 #include <QDir>
 
+#include <vamp-hostsdk/PluginHostAdapter.h>
+
 #include <iostream>
 using namespace std;
 
 int main(int argc, char **argv)
 {
+    auto pathList = Vamp::PluginHostAdapter::getPluginPath();
+    if (pathList.empty()) {
+        cerr << "Failed to look up Vamp plugin path" << endl;
+        return 1;
+    }
+
     QApplication app(argc, argv);
     QDir dir(":out/");
     auto entries = dir.entryList({ "*.so", "*.dll", "*.dylib" });
@@ -17,19 +25,24 @@
         cerr << e.toStdString() << endl;
     }
 
-    QString target = QDir::homePath() + "/Library/Audio/Plug-Ins/Vamp/";
+    auto firstPath = *pathList.begin();
+    QString target = QString::fromUtf8(firstPath.c_str(), firstPath.size());
 
     for (auto e: entries) {
         QFile f(":out/" + e);
-        if (!f.copy(target + e)) {
+        QString destination = target + "/" + e;
+        cerr << "Copying " << e.toStdString() << " to "
+             << destination.toStdString() << "..." << endl;
+        if (!f.copy(destination)) {
             cerr << "Failed to copy " << e.toStdString()
-                 << " to target " << (target + e).toStdString() << endl;
+                 << " to target " << destination.toStdString() << endl;
 	    continue;
         }
-	if (!QFile::setPermissions(target + e, 
-				   QFile::ReadOwner | QFile::WriteOwner | 
-				   QFile::ExeOwner | QFile::ReadGroup | 
-				   QFile::ReadOther)) {
+	if (!QFile::setPermissions
+            (destination,
+             QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner |
+             QFile::ReadGroup | QFile::ExeGroup |
+             QFile::ReadOther | QFile::ExeOther)) {
             cerr << "Failed to set permissions on " << e.toStdString() << endl;
 	    continue;
 	}
--- a/installer.pro	Wed Dec 18 17:30:08 2019 +0000
+++ b/installer.pro	Thu Dec 19 13:44:39 2019 +0000
@@ -47,7 +47,23 @@
 QMAKE_EXTRA_TARGETS += qrc_cpp
 PRE_TARGETDEPS += $$qrc_cpp.target
 
-SOURCES += installer.cpp $$qrc_cpp.target
+SOURCES += \
+        installer.cpp \
+        $$qrc_cpp.target \
+        vamp-plugin-sdk/src/vamp-hostsdk/Files.cpp \
+        vamp-plugin-sdk/src/vamp-hostsdk/host-c.cpp \
+        vamp-plugin-sdk/src/vamp-hostsdk/PluginBufferingAdapter.cpp \
+        vamp-plugin-sdk/src/vamp-hostsdk/PluginChannelAdapter.cpp \
+        vamp-plugin-sdk/src/vamp-hostsdk/PluginHostAdapter.cpp \
+        vamp-plugin-sdk/src/vamp-hostsdk/PluginInputDomainAdapter.cpp \
+        vamp-plugin-sdk/src/vamp-hostsdk/PluginLoader.cpp \
+        vamp-plugin-sdk/src/vamp-hostsdk/PluginSummarisingAdapter.cpp \
+        vamp-plugin-sdk/src/vamp-hostsdk/PluginWrapper.cpp \
+        vamp-plugin-sdk/src/vamp-hostsdk/RealTime.cpp
+
+linux* {
+   LIBS += -ldl
+}
 
 macx* {
     QMAKE_POST_LINK += deploy/osx/deploy.sh $$shell_quote($$TARGET)