changeset 51:cf2840ba1e07

Windows build logic and updates
author Chris Cannam
date Thu, 30 Jan 2020 13:28:32 +0000
parents 6547119dbc54
children eeab56dd59d6
files deploy/win64/build-64.bat deploy/win64/copy-metadata.ps1 installer.cpp installer.pro installer.qrc.in noconfig.pri plugins.pro repoint-lock.json repoint-project.json vamp-aubio-plugins.pro vamp-plugin-pack.pro
diffstat 11 files changed, 200 insertions(+), 72 deletions(-) [+]
line wrap: on
line diff
--- a/deploy/win64/build-64.bat	Wed Jan 29 15:00:32 2020 +0000
+++ b/deploy/win64/build-64.bat	Thu Jan 30 13:28:32 2020 +0000
@@ -28,18 +28,44 @@
 call .\repoint install
 if %errorlevel% neq 0 exit /b %errorlevel%
 
+PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& 'deploy\win64\copy-metadata.ps1' "
+if %errorlevel% neq 0 exit /b %errorlevel%
+
 call .\deploy\win64\generate-qrc installer.qrc
 if %errorlevel% neq 0 exit /b %errorlevel%
 
 mkdir build_win64
 cd build_win64
 
-qmake -spec win32-msvc -r -tp vc ..\vamp-plugin-pack.pro
+qmake -spec win32-msvc -r -tp vc ..\plugins.pro
 if %errorlevel% neq 0 exit /b %errorlevel%
 
-msbuild vamp-plugin-pack.sln /t:Build /p:Configuration=Release
+msbuild plugins.sln /t:Build /p:Configuration=Release
 if %errorlevel% neq 0 exit /b %errorlevel%
 
+rem and sign!
+copy release\out\*.dll ..\out\
+
+mkdir o
+%QTDIR%\bin\rcc ..\installer.qrc -o o\qrc_installer.cpp
+
+qmake -spec win32-msvc -r -tp vc ..\installer.pro
+if %errorlevel% neq 0 exit /b %errorlevel%
+
+msbuild "Vamp Plugin Pack Installer.vcxproj" /t:Build /p:Configuration=Release
+if %errorlevel% neq 0 exit /b %errorlevel%
+
+copy %QTDIR%\bin\Qt5Core.dll .\release
+copy %QTDIR%\bin\Qt5Gui.dll .\release
+copy %QTDIR%\bin\Qt5Widgets.dll .\release
+copy %QTDIR%\bin\Qt5Network.dll .\release
+copy %QTDIR%\bin\Qt5Xml.dll .\release
+copy %QTDIR%\bin\Qt5Svg.dll .\release
+copy %QTDIR%\bin\Qt5Test.dll .\release
+copy %QTDIR%\plugins\platforms\qminimal.dll .\release
+copy %QTDIR%\plugins\platforms\qwindows.dll .\release
+copy %QTDIR%\plugins\styles\qwindowsvistastyle.dll .\release
+
 cd ..
 
 set PATH=%ORIGINALPATH%
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/win64/copy-metadata.ps1	Thu Jan 30 13:28:32 2020 +0000
@@ -0,0 +1,51 @@
+
+Set-StrictMode -Version 2.0
+$ErrorActionPreference = "Stop"
+
+mkdir -f out
+
+dir -Attributes Directory | foreach {
+
+    $dir = $_.BaseName
+    $lib = $dir
+
+    if ($dir -eq "constant-q-cpp") { $lib = "cqvamp" }
+    if ($dir -eq "marsyas") { $lib = "mvamp" }
+    if ($dir -eq "match-vamp") { $lib = "match-vamp-plugin" }
+    if ($dir -eq "vamp-aubio-plugins") { $lib = "vamp-aubio" }
+    if ($dir -eq "vamp-libxtract-plugins") { $lib = "vamp-libxtract" }
+    if ($dir -eq "vamp-plugin-sdk") { $lib = "vamp-example-plugins" }
+    if ($dir -eq "vamp-fanchirp") { $lib = "fanchirp" }
+    if ($dir -eq "vamp-tempogram") { $lib = "tempogram" }
+    if ($dir -eq "vamp-simple-cepstrum") { $lib = "simple-cepstrum" }
+
+    ( "cat", "n3" ) | foreach {
+
+        if (Test-Path -Path $dir/$lib.$_ -PathType Leaf) {
+            cp $dir/$lib.$_ out/
+        }
+    }
+
+    ( "README", "COPYING", "CITATION" ) | foreach {
+
+        if (Test-Path -Path $dir/$_.md -PathType Leaf) {
+            cp $dir/$_.md out/${lib}_$_.md
+        } elseif  (Test-Path -Path $dir/$_.txt -PathType Leaf) {
+            cp $dir/$_.txt out/${lib}_$_.txt
+        } elseif  (Test-Path -Path $dir/$_ -PathType Leaf) {
+            cp $dir/$_ out/${lib}_$_.txt
+        }
+    }
+}
+
+# oddments
+
+cp marsyas/src/mvamp/mvamp.n3 out/ 
+cp marsyas/src/mvamp/mvamp.cat out/ 
+
+cp vamp-plugin-sdk/examples/vamp-example-plugins.n3 out/ 
+cp vamp-plugin-sdk/examples/vamp-example-plugins.cat out/
+
+cp ua-vamp-plugins/LICENSE out/ua-vamp-plugins_COPYING.txt 
+
+del out/vamp-example-plugins_README.txt # it's about the SDK not the plugins
--- a/installer.cpp	Wed Jan 29 15:00:32 2020 +0000
+++ b/installer.cpp	Thu Jan 30 13:28:32 2020 +0000
@@ -11,6 +11,8 @@
 #include <QScrollArea>
 #include <QDialogButtonBox>
 #include <QLabel>
+#include <QFont>
+#include <QFontInfo>
 
 #include <vamp-hostsdk/PluginHostAdapter.h>
 
@@ -20,6 +22,8 @@
 #include <iostream>
 #include <set>
 
+#include "base/Debug.h"
+
 using namespace std;
 using namespace Dataquay;
 
@@ -28,7 +32,7 @@
 {
     auto pathList = Vamp::PluginHostAdapter::getPluginPath();
     if (pathList.empty()) {
-        cerr << "Failed to look up Vamp plugin path" << endl;
+        SVCERR << "Failed to look up Vamp plugin path" << endl;
         return QString();
     }
 
@@ -44,7 +48,7 @@
     auto entries = dir.entryList({ "*.so", "*.dll", "*.dylib" });
 
     for (auto e: entries) {
-        cerr << e.toStdString() << endl;
+        SVCERR << e.toStdString() << endl;
     }
 
     return entries;
@@ -55,8 +59,8 @@
 {
     QFile f(filename);
     if (!f.open(QFile::ReadOnly | QFile::Text)) {
-        cerr << "Failed to open RDF resource file "
-             << filename.toStdString() << endl;
+        SVCERR << "Failed to open RDF resource file "
+               << filename.toStdString() << endl;
         return;
     }
 
@@ -68,8 +72,8 @@
                            Uri("file:" + filename),
                            BasicStore::ImportIgnoreDuplicates);
     } catch (const RDFException &ex) {
-        cerr << "Failed to import RDF resource file "
-             << filename.toStdString() << ": " << ex.what() << endl;
+        SVCERR << "Failed to import RDF resource file "
+               << filename.toStdString() << ": " << ex.what() << endl;
     }
 }
 
@@ -182,8 +186,8 @@
     }
 
     for (auto wp: wanted) {
-        cerr << "Failed to find any RDF information about library "
-             << wp.second << endl;
+        SVCERR << "Failed to find any RDF information about library "
+               << wp.second << endl;
     }
     
     return results;
@@ -194,11 +198,11 @@
 {
     QFile f(":out/" + library);
     QString destination = target + "/" + library;
-    cerr << "Copying " << library.toStdString() << " to "
-         << destination.toStdString() << "..." << endl;
+    SVCERR << "Copying " << library.toStdString() << " to "
+           << destination.toStdString() << "..." << endl;
     if (!f.copy(destination)) {
-        cerr << "Failed to copy " << library.toStdString()
-             << " to target " << destination.toStdString() << endl;
+        SVCERR << "Failed to copy " << library.toStdString()
+               << " to target " << destination.toStdString() << endl;
         return;
     }
     if (!QFile::setPermissions
@@ -206,8 +210,8 @@
          QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner |
          QFile::ReadGroup | QFile::ExeGroup |
          QFile::ReadOther | QFile::ExeOther)) {
-        cerr << "Failed to set permissions on "
-             << library.toStdString() << endl;
+        SVCERR << "Failed to set permissions on "
+               << library.toStdString() << endl;
         return;
     }
 }
@@ -281,7 +285,7 @@
             contents = QObject::tr("Plugins: %1").arg(titleText);
         }
 */        
-        QString text = QObject::tr("<b>%1</b><br><small><i>%2</i><br>%3</small>")
+        QString text = QObject::tr("<b>%1</b><br><i>%2</i><br>%3")
                                 .arg(info.title)
                                 .arg(info.maker)
                                 .arg(info.description);
@@ -321,9 +325,9 @@
     QObject::connect(bb, SIGNAL(rejected()), &dialog, SLOT(reject()));
 
     if (dialog.exec() == QDialog::Accepted) {
-        cerr << "accepted" << endl;
+        SVCERR << "accepted" << endl;
     } else {
-        cerr << "rejected" << endl;
+        SVCERR << "rejected" << endl;
     }
 
     QStringList approved;
@@ -340,6 +344,20 @@
 {
     QApplication app(argc, argv);
 
+    QApplication::setOrganizationName("sonic-visualiser");
+    QApplication::setOrganizationDomain("sonicvisualiser.org");
+    QApplication::setApplicationName(QApplication::tr("Vamp Plugin Pack Installer"));
+
+#ifdef Q_OS_WIN32
+    QFont font(QApplication::font());
+    QString preferredFamily = "Segoe UI";
+    font.setFamily(preferredFamily);
+    if (QFontInfo(font).family() == preferredFamily) {
+        font.setPointSize(10);
+        QApplication::setFont(font);
+    }
+#endif
+
     QString target = getDefaultInstallDirectory();
     if (target == "") {
         return 1;
--- a/installer.pro	Wed Jan 29 15:00:32 2020 +0000
+++ b/installer.pro	Thu Jan 30 13:28:32 2020 +0000
@@ -9,10 +9,12 @@
     include(noconfig.pri)
 }
 
+INCLUDEPATH += $$PWD/svcore $$PWD/bqvec $$PWD/dataquay $$PWD/dataquay/dataquay
+
 QMAKE_CXXFLAGS_RELEASE -= -flto
 QMAKE_LFLAGS_RELEASE -= -flto
 
-CONFIG += release warn_on c++14
+CONFIG += release warn_on c++17
 
 QT += gui widgets svg
 
@@ -52,6 +54,9 @@
 SOURCES += \
         installer.cpp \
         $$qrc_cpp.target \
+        svcore/base/Debug.cpp \
+        svcore/base/ResourceFinder.cpp \
+        svcore/system/System.cpp \
         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 \
@@ -83,5 +88,7 @@
 
 win32* {
     LIBS += -lsord -lserd
+
+    QMAKE_LFLAGS_RELEASE += -MANIFESTUAC:\"level=\'requireAdministrator\' uiAccess=\'false\'\"
 }
     
--- a/installer.qrc.in	Wed Jan 29 15:00:32 2020 +0000
+++ b/installer.qrc.in	Thu Jan 30 13:28:32 2020 +0000
@@ -94,8 +94,8 @@
   <file>out/ua-vamp-plugins.@SUFFIX@</file>
   <file>out/vamp-aubio.cat</file>
   <file>out/vamp-aubio.n3</file>
-  <file>out/vamp-aubio-plugins_COPYING.txt</file>
-  <file>out/vamp-aubio-plugins_README.md</file>
+  <file>out/vamp-aubio_COPYING.txt</file>
+  <file>out/vamp-aubio_README.md</file>
   <file>out/vamp-aubio.@SUFFIX@</file>
   <file>out/vamp-example-plugins.cat</file>
   <file>out/vamp-example-plugins_COPYING.txt</file>
--- a/noconfig.pri	Wed Jan 29 15:00:32 2020 +0000
+++ b/noconfig.pri	Thu Jan 30 13:28:32 2020 +0000
@@ -5,7 +5,7 @@
 
 PREFIX_PATH = /usr/local
 
-INCLUDEPATH += $$PWD/vamp-plugin-sdk $$PWD/dataquay $$PWD/dataquay/dataquay
+INCLUDEPATH += $$PWD/vamp-plugin-sdk
 
 win32-msvc* {
 
@@ -20,7 +20,9 @@
         LIBS += -NODEFAULTLIB:LIBCMT -Lrelease
     }
 
-    DEFINES += NOMINMAX _USE_MATH_DEFINES HAVE_C99_VARARGS_MACROS
+    DEFINES += NOMINMAX _USE_MATH_DEFINES HAVE_C99_VARARGS_MACROS _HAS_STD_BYTE=0
+
+    LIBS += -lWindowsApp
 }
 
 macx* {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins.pro	Thu Jan 30 13:28:32 2020 +0000
@@ -0,0 +1,53 @@
+
+TEMPLATE = subdirs
+
+SUBDIRS += \
+        sub_sdk \
+        sub_match \
+        sub_tuning_difference \
+        sub_pyin \
+        sub_nnls_chroma \
+        sub_qm_vamp_plugins \
+        sub_azi \
+        sub_aubio \
+        sub_silvet \
+        sub_tipic \
+        sub_segmentino \
+        sub_examples \
+        sub_ua \
+        sub_bbc \
+        sub_cq \
+        sub_cepstral_pitchtracker \
+        sub_simple_cepstrum \
+        sub_libxtract \
+        sub_beatroot \
+        sub_marsyas \
+        sub_fanchirp \
+        sub_vampy \
+        sub_tempogram
+        
+sub_sdk.file = vamp-plugin-sdk.pro
+sub_match.file = match-vamp.pro
+sub_pyin.file = pyin.pro
+sub_tuning_difference.file = tuning-difference.pro
+sub_nnls_chroma.file = nnls-chroma.pro
+sub_qm_vamp_plugins.file = qm-vamp-plugins.pro
+sub_azi.file = azi.pro
+sub_aubio.file = vamp-aubio-plugins.pro
+sub_silvet.file = silvet.pro
+sub_tipic.file = tipic.pro
+sub_segmentino.file = segmentino.pro
+sub_examples.file = vamp-example-plugins.pro
+sub_ua.file = ua-vamp-plugins.pro
+sub_bbc.file = bbc-vamp-plugins.pro
+sub_cq.file = constant-q-cpp.pro
+sub_cepstral_pitchtracker.file = cepstral-pitchtracker.pro
+sub_simple_cepstrum.file = vamp-simple-cepstrum.pro
+sub_libxtract.file = vamp-libxtract-plugins.pro
+sub_beatroot.file = beatroot-vamp.pro
+sub_marsyas.file = marsyas-vamp.pro
+sub_fanchirp.file = vamp-fanchirp.pro
+sub_vampy.file = vampy.pro
+sub_tempogram.file = vamp-tempogram.pro
+
+CONFIG += ordered
--- a/repoint-lock.json	Wed Jan 29 15:00:32 2020 +0000
+++ b/repoint-lock.json	Thu Jan 30 13:28:32 2020 +0000
@@ -81,6 +81,12 @@
     "vampy": {
       "pin": "a38d318c85a9"
     },
+    "bqvec": {
+      "pin": "cd235ecbeb31"
+    },
+    "svcore": {
+      "pin": "1cd161242250"
+    },
     "sv-dependency-builds": {
       "pin": "d0c2a83c1364"
     },
--- a/repoint-project.json	Wed Jan 29 15:00:32 2020 +0000
+++ b/repoint-project.json	Thu Jan 30 13:28:32 2020 +0000
@@ -159,6 +159,15 @@
             "service": "soundsoftware",
             "pin": "a38d318c85a9"
         },
+        "bqvec": {
+            "vcs": "hg",
+            "service": "sourcehut",
+            "owner": "breakfastquay"
+        },
+        "svcore": {
+            "vcs": "hg",
+            "service": "soundsoftware"
+        },
         "sv-dependency-builds": {
             "vcs": "hg",
             "service": "soundsoftware"
--- a/vamp-aubio-plugins.pro	Wed Jan 29 15:00:32 2020 +0000
+++ b/vamp-aubio-plugins.pro	Thu Jan 30 13:28:32 2020 +0000
@@ -39,8 +39,8 @@
 !win* {
     QMAKE_POST_LINK += && \
         cp vamp-aubio-plugins/vamp-aubio.cat vamp-aubio-plugins/vamp-aubio.n3 out/ && \
-        cp vamp-aubio-plugins/COPYING out/vamp-aubio-plugins_COPYING.txt && \
-        cp vamp-aubio-plugins/README.md out/vamp-aubio-plugins_README.md
+        cp vamp-aubio-plugins/COPYING out/vamp-aubio_COPYING.txt && \
+        cp vamp-aubio-plugins/README.md out/vamp-aubio_README.md
 }
 
 SOURCES += \
--- a/vamp-plugin-pack.pro	Wed Jan 29 15:00:32 2020 +0000
+++ b/vamp-plugin-pack.pro	Thu Jan 30 13:28:32 2020 +0000
@@ -2,54 +2,10 @@
 TEMPLATE = subdirs
 
 SUBDIRS += \
-        sub_sdk \
-        sub_match \
-        sub_tuning_difference \
-        sub_pyin \
-        sub_nnls_chroma \
-        sub_qm_vamp_plugins \
-        sub_azi \
-        sub_aubio \
-        sub_silvet \
-        sub_tipic \
-        sub_segmentino \
-        sub_examples \
-        sub_ua \
-        sub_bbc \
-        sub_cq \
-        sub_cepstral_pitchtracker \
-        sub_simple_cepstrum \
-        sub_libxtract \
-        sub_beatroot \
-        sub_marsyas \
-        sub_fanchirp \
-        sub_vampy \
-        sub_tempogram \
+        sub_plugins \
         sub_installer
 
-sub_sdk.file = vamp-plugin-sdk.pro
-sub_match.file = match-vamp.pro
-sub_pyin.file = pyin.pro
-sub_tuning_difference.file = tuning-difference.pro
-sub_nnls_chroma.file = nnls-chroma.pro
-sub_qm_vamp_plugins.file = qm-vamp-plugins.pro
-sub_azi.file = azi.pro
-sub_aubio.file = vamp-aubio-plugins.pro
-sub_silvet.file = silvet.pro
-sub_tipic.file = tipic.pro
-sub_segmentino.file = segmentino.pro
-sub_examples.file = vamp-example-plugins.pro
-sub_ua.file = ua-vamp-plugins.pro
-sub_bbc.file = bbc-vamp-plugins.pro
-sub_cq.file = constant-q-cpp.pro
-sub_cepstral_pitchtracker.file = cepstral-pitchtracker.pro
-sub_simple_cepstrum.file = vamp-simple-cepstrum.pro
-sub_libxtract.file = vamp-libxtract-plugins.pro
-sub_beatroot.file = beatroot-vamp.pro
-sub_marsyas.file = marsyas-vamp.pro
-sub_fanchirp.file = vamp-fanchirp.pro
-sub_vampy.file = vampy.pro
-sub_tempogram.file = vamp-tempogram.pro
+sub_plugins.file = plugins.pro
 sub_installer.file = installer.pro
 
 repoint.target = $$PWD/.repoint.point