From 4814445ea195acadda15a394f4b3eb1ea5597eb5 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Thu, 29 Feb 2024 10:19:38 +0000 Subject: [PATCH 01/20] Packaging updates --- deploy/macos/copy-scores.sh | 5 --- deploy/macos/notarize.sh | 61 +++++-------------------------------- main/MainWindow.cpp | 2 +- 3 files changed, 8 insertions(+), 60 deletions(-) diff --git a/deploy/macos/copy-scores.sh b/deploy/macos/copy-scores.sh index da82a0e..d20152d 100755 --- a/deploy/macos/copy-scores.sh +++ b/deploy/macos/copy-scores.sh @@ -39,11 +39,6 @@ if [ -d "$datadir" ]; then fi done echo - echo "Removing trivial scores (C major scales and TheBlues)..." - rm -r "$sdir/C major"* - rm -r "$rdir/C major"* - rm -r "$rdir/TheBlues"* - echo echo "Done" else echo diff --git a/deploy/macos/notarize.sh b/deploy/macos/notarize.sh index 751e76d..72f443b 100755 --- a/deploy/macos/notarize.sh +++ b/deploy/macos/notarize.sh @@ -10,6 +10,7 @@ # spctl -a -v "/Applications/Application.app" user="appstore@particularprograms.co.uk" +team_id="73F996B92S" set -eu @@ -21,60 +22,12 @@ dmg="$full_dmg" echo echo "Uploading for notarization..." -uuidfile=.notarization-uuid -statfile=.notarization-status -rm -f "$uuidfile" "$statfile" - -# At some point we need to switch to... -#xcrun notarytool submit \ -# "$dmg" \ -# --apple-id "$user" \ -# --keychain-profile altool \ -# --wait --progress - -xcrun altool --notarize-app \ - -f "$dmg" \ - --primary-bundle-id "$bundleid" \ - -u "$user" \ - -p @keychain:altool 2>&1 | tee "$uuidfile" - -uuid=$(cat "$uuidfile" | grep RequestUUID | awk '{ print $3; }') - -if [ -z "$uuid" ]; then - echo - echo "Failed (no UUID returned, check output)" - exit 1 -fi - -echo "Done, UUID is $uuid" - -echo -echo "Waiting and checking for completion..." - -while true ; do - sleep 30 - - xcrun altool --notarization-info \ - "$uuid" \ - -u "$user" \ - -p @keychain:altool 2>&1 | tee "$statfile" - if grep -q 'Package Approved' "$statfile"; then - echo - echo "Approved! Status output is:" - cat "$statfile" - break - elif grep -q 'in progress' "$statfile" ; then - echo - echo "Still in progress... Status output is:" - cat "$statfile" - echo "Waiting..." - else - echo - echo "Failure or unknown status in output:" - cat "$statfile" - exit 2 - fi -done +xcrun notarytool submit \ + "$dmg" \ + --apple-id "$user" \ + --team-id "$team_id" \ + --keychain-profile notarytool \ + --wait --progress echo echo "Stapling to package..." diff --git a/main/MainWindow.cpp b/main/MainWindow.cpp index f5171d6..0d59af3 100644 --- a/main/MainWindow.cpp +++ b/main/MainWindow.cpp @@ -6438,7 +6438,7 @@ MainWindow::introduction() int indent = fontSize * 2; introText = introText.arg(iconSize).arg(indent); - std::cout << "text is: " << introText << std::endl; +// std::cout << "text is: " << introText << std::endl; QDialog *d = new QDialog(this); d->setWindowTitle(tr("Using %1").arg(QApplication::applicationName())); From b0a9004c2177876a31c64879304a90ed60ab5321 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Thu, 29 Feb 2024 10:20:29 +0000 Subject: [PATCH 02/20] Subrepo update --- repoint-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repoint-lock.json b/repoint-lock.json index 47e46ae..8fc06b9 100644 --- a/repoint-lock.json +++ b/repoint-lock.json @@ -4,7 +4,7 @@ "pin": "63e0c3b37b6fb9ce6f074ea8222b4903e4f5568a" }, "svcore": { - "pin": "045a8eaeccc1bec75cabb267eb41e3929f2cd1e8" + "pin": "20e7181744677635bea6957b864cd4920ac0aab6" }, "svgui": { "pin": "18da36ad18f90f28ded28ebc270e94b090e091dc" From 7eee27302c5d4f40495ba252213d1b3568107bfb Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Thu, 29 Feb 2024 10:22:01 +0000 Subject: [PATCH 03/20] In theory we should be able to make these both now --- deploy/clean-build-and-package | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deploy/clean-build-and-package b/deploy/clean-build-and-package index 35452f3..b60b4af 100755 --- a/deploy/clean-build-and-package +++ b/deploy/clean-build-and-package @@ -14,11 +14,11 @@ echo if [ -d /Applications ]; then - archs="x86_64" -# archs="x86_64 arm64" +# archs="x86_64" + archs="x86_64 arm64" - qtdir_x86_64="/Users/cannam/Qt/5.15.2/clang_64" - qtdir_arm64="/Users/cannam/Qt/5.15.2-arm64" + qtdir_x86_64="/Users/cannam/Qt/6.6.1/macos" + qtdir_arm64="/Users/cannam/Qt/6.6.1/macos" echo "Proceed to rebuild, package, and sign version $version of $full_name using:" for arch in $archs; do From 371615faee640d07f2fecc7c5e4fd94de10629f1 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Thu, 29 Feb 2024 12:41:15 +0000 Subject: [PATCH 04/20] Deployment fixes for multi-arch build --- deploy/clean-build-and-package | 30 +++++++++++++++++------------- deploy/cross/macos-arm64.txt | 2 +- deploy/cross/macos-x86_64.txt | 2 +- deploy/macos/deploy-and-package.sh | 8 +++++++- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/deploy/clean-build-and-package b/deploy/clean-build-and-package index b60b4af..a963894 100755 --- a/deploy/clean-build-and-package +++ b/deploy/clean-build-and-package @@ -2,10 +2,10 @@ set -eu -case $(git status --porcelain --untracked-files=no) in - "") ;; - *) echo "ERROR: Current working copy has been modified - not proceeding"; exit 2;; -esac +#case $(git status --porcelain --untracked-files=no) in +# "") ;; +# *) echo "ERROR: Current working copy has been modified - not proceeding"; exit 2;; +#esac mkdir -p packages echo @@ -14,7 +14,6 @@ echo if [ -d /Applications ]; then -# archs="x86_64" archs="x86_64 arm64" qtdir_x86_64="/Users/cannam/Qt/6.6.1/macos" @@ -32,12 +31,12 @@ if [ -d /Applications ]; then echo "*** ERROR: Qt dir $qtdir does not exist" exit 1 fi - if [ ! -f "$qtdir/bin/qmake" ]; then + qmake=$qtdir/bin/qmake + if [ ! -f "$qmake" ]; then echo "*** ERROR: qmake not found in $qmake (for Qt dir $qtdir)" exit 1 fi - qmake_arch=$(lipo -archs "$qtdir/bin/qmake") - if [ t"$qmake_arch" != t"$arch" ]; then + if ! lipo -archs "$qmake" | grep -q "$arch"; then echo "*** ERROR: wrong arch $qmake_arch for qmake $qmake (expected $arch)" exit 1 fi @@ -49,6 +48,8 @@ if [ -d /Applications ]; then ./repoint install + builddirs="" + for arch in $archs; do case "$arch" in @@ -56,9 +57,13 @@ if [ -d /Applications ]; then arm64) qtdir="$qtdir_arm64";; esac - rm -rf build-$arch - PATH="$qtdir/bin:$PATH" arch -$arch meson build-$arch --cross-file=deploy/cross/macos-$arch.txt --buildtype release -Db_lto=true - ninja -C build-$arch + builddir="build-$arch" + + rm -rf "$builddir" + PATH="$qtdir/bin:$PATH" arch -$arch meson setup "$builddir" --cross-file=deploy/cross/macos-$arch.txt --buildtype release -Db_lto=true + ninja -C "$builddir" + + builddirs="$builddirs $builddir" done @@ -66,8 +71,7 @@ if [ -d /Applications ]; then rm -rf "$full_versioned" rm -f "$full_dmg" - deploy/macos/deploy-and-package.sh build-x86_64 -# deploy/macos/deploy-and-package.sh build-x86_64 build-arm64 + deploy/macos/deploy-and-package.sh $builddirs mv "$full_dmg" packages/ diff --git a/deploy/cross/macos-arm64.txt b/deploy/cross/macos-arm64.txt index bb7c3a0..ecba21b 100644 --- a/deploy/cross/macos-arm64.txt +++ b/deploy/cross/macos-arm64.txt @@ -11,7 +11,7 @@ needs_exe_wrapper = false c = '/usr/bin/cc' cpp = '/usr/bin/c++' strip = 'strip' -pkgconfig = 'pkg-config' +pkg-config = 'pkg-config' qmake = 'qmake' [built-in options] diff --git a/deploy/cross/macos-x86_64.txt b/deploy/cross/macos-x86_64.txt index 479f9c0..6b91933 100644 --- a/deploy/cross/macos-x86_64.txt +++ b/deploy/cross/macos-x86_64.txt @@ -11,7 +11,7 @@ needs_exe_wrapper = false c = '/usr/bin/cc' cpp = '/usr/bin/c++' strip = 'strip' -pkgconfig = 'pkg-config' +pkg-config = 'pkg-config' qmake = 'qmake' [built-in options] diff --git a/deploy/macos/deploy-and-package.sh b/deploy/macos/deploy-and-package.sh index c962537..ea281a8 100755 --- a/deploy/macos/deploy-and-package.sh +++ b/deploy/macos/deploy-and-package.sh @@ -92,7 +92,13 @@ for builddir in $builddirs; do echo "App exists in target $target, merging..." find "$source" -name "$full_name" -o -name \*.dylib -o -name Qt\* | while read f; do - lipo "$f" "$volume/$f" -create -output "$volume/$f" + this=$(lipo -archs "$f") + that=$(lipo -archs "$volume/$f") + if [ "$this" = "$that" ]; then + echo "File $f already has desired arch(s) in target" + else + lipo "$f" "$volume/$f" -create -output "$volume/$f" + fi done for helper in vamp-plugin-load-checker piper-vamp-simple-server; do path="Contents/MacOS/$helper" From 2002997467a34e171d2c30ad90cda2b792b90b86 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Thu, 29 Feb 2024 12:41:24 +0000 Subject: [PATCH 05/20] Add FFTW for ARM --- meson.build | 23 ++++++++++------------- repoint-lock.json | 2 +- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/meson.build b/meson.build index da55267..c24e9a2 100644 --- a/meson.build +++ b/meson.build @@ -5,7 +5,7 @@ project( version: '1.0.0', license: 'GPL-2.0-or-later', default_options: [ - 'cpp_std=c++17', + 'cpp_std=c++20', 'warning_level=2', 'buildtype=release', 'b_ndebug=if-release', @@ -245,19 +245,16 @@ elif system == 'darwin' '-DHAVE_VDSP', '-D__MACOSX_CORE__', # for RtMidi ] + + # vDSP will be used in preference to FFTW most of the time, but + # FFTW supports more fft lengths - without it we can end up with a + # very slow implementation for unusual lengths. + feature_defines += [ + '-DHAVE_FFTW3', + '-DFFTW_DOUBLE_ONLY', + ] if architecture != 'aarch64' - - # vDSP will be used in preference to FFTW most of the time, but - # FFTW supports more fft lengths - without it we can end up with a - # very slow implementation for unusual lengths. However we don't - # have this in the deps build for arm64 yet because my first - # attempt at arm64 build failed and I haven't had a moment to - # return to it yet. - feature_defines += [ - '-DHAVE_FFTW3', - '-DFFTW_DOUBLE_ONLY', - ] # We don't actually need MAD on this platform at all - CoreAudio # can read mp3 files no problem - but we have been using it up to @@ -303,6 +300,7 @@ elif system == 'darwin' '-lopus', '-lportaudio', '-lsamplerate', + '-lfftw3', '-lz', '-lsord-0', '-lserd-0', @@ -321,7 +319,6 @@ elif system == 'darwin' if architecture != 'aarch64' # See comments when setting up feature_defines above feature_additional_libs += [ - '-lfftw3', '-lmad', '-lid3tag', ] diff --git a/repoint-lock.json b/repoint-lock.json index 8fc06b9..bea0b0c 100644 --- a/repoint-lock.json +++ b/repoint-lock.json @@ -16,7 +16,7 @@ "pin": "fae540cf4a79ac5ed5a4d4dc0df680b1acbe8628" }, "sv-dependency-builds": { - "pin": "f4eb0637efbbb54bdd909625640b245e606a8374" + "pin": "c0e0372de677d29048dfa1488afd8d1acb66fb8e" }, "icons/scalable": { "pin": "fa47556361a34604e042c9a1820051424451a024" From 20d5b4283789ab0babb802ca14befc3813526006 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Thu, 29 Feb 2024 13:03:14 +0000 Subject: [PATCH 06/20] Fix duplication of onset instants in case where a full alignment was re-run --- main/Session.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/Session.cpp b/main/Session.cpp index d995d3f..9e79af0 100644 --- a/main/Session.cpp +++ b/main/Session.cpp @@ -389,7 +389,7 @@ Session::acceptAlignment() return; } - if (m_acceptedOnsetsLayer) { + if (m_acceptedOnsetsLayer && m_partialAlignmentAudioEnd >= 0) { mergeLayers(m_acceptedOnsetsLayer, m_pendingOnsetsLayer, m_partialAlignmentAudioStart, m_partialAlignmentAudioEnd); } From c5b5c827cb8d56c2c83069621f3db593fe8b09e9 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Thu, 29 Feb 2024 13:29:59 +0000 Subject: [PATCH 07/20] Unpack bundled scores and recordings on first startup --- main/ScoreFinder.cpp | 39 +++++++++++++++++++++++++++++++++++++++ main/ScoreFinder.h | 5 +++++ main/main.cpp | 7 +++++++ 3 files changed, 51 insertions(+) diff --git a/main/ScoreFinder.cpp b/main/ScoreFinder.cpp index c54d1e7..7cd5d8e 100644 --- a/main/ScoreFinder.cpp +++ b/main/ScoreFinder.cpp @@ -230,3 +230,42 @@ ScoreFinder::getBundledRecordingDirectory(string scoreName) return dir.string(); } } + +void +ScoreFinder::populateUserDirectoriesFromBundled() +{ + auto scores = getScoreNames(); + + string userScoreDir = getUserScoreDirectory(); + string bundledScoreDir = getBundledScoreDirectory(); + + auto populate = [&](string fromDir, string toDir) { + if (!std::filesystem::exists(fromDir)) return; + if (!std::filesystem::create_directories(toDir)) { + SVDEBUG << "ScoreFinder::populateUserDirectoriesFromBundled: Failed to create target path " << toDir << endl; + return; + } + for (const auto &entry : std::filesystem::directory_iterator(fromDir)) { + if (std::filesystem::is_regular_file(entry)) { + string target = toDir + "/" + entry.path().filename().string(); + if (std::filesystem::exists(target)) { + SVDEBUG << "ScoreFinder::populateUserDirectoriesFromBundled: Target file " << target << " already exists, skipping" << endl; + continue; + } + SVDEBUG << "ScoreFinder::populateUserDirectoriesFromBundled: Copying from " << entry << " to " << target << endl; + std::filesystem::copy(entry, target); + } + } + }; + + for (string score : scores) { + + populate(bundledScoreDir + "/" + score, + userScoreDir + "/" + score); + + populate(getBundledRecordingDirectory(score), + getUserRecordingDirectory(score)); + } +} + + diff --git a/main/ScoreFinder.h b/main/ScoreFinder.h index 46b130e..3addd90 100644 --- a/main/ScoreFinder.h +++ b/main/ScoreFinder.h @@ -82,6 +82,11 @@ class ScoreFinder * reason, return the empty string. */ static std::string getBundledRecordingDirectory(std::string scoreName); + + /** Populate the user score and recording directories from bundled + * copies. Do not overwrite any existing files. + */ + static void populateUserDirectoriesFromBundled(); }; diff --git a/main/main.cpp b/main/main.cpp index 362f42d..6ddcc1f 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -439,6 +439,13 @@ main(int argc, char **argv) PluginPathSetter::initialiseEnvironmentVariables(); ScoreFinder::initialiseAlignerEnvironmentVariables(); + + settings.beginGroup("Bundled Scores"); + if (!settings.value("unpacked", false).toBool()) { + ScoreFinder::populateUserDirectoriesFromBundled(); + settings.setValue("unpacked", true); + } + settings.endGroup(); QIcon icon; int sizes[] = { 16, 32, 64, 128, 256 }; From c140399ecda8c84c57c000fd685f548e6d8d282c Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Thu, 29 Feb 2024 13:31:58 +0000 Subject: [PATCH 08/20] Restore modified directory check for packaging --- deploy/clean-build-and-package | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deploy/clean-build-and-package b/deploy/clean-build-and-package index a963894..99d3d32 100755 --- a/deploy/clean-build-and-package +++ b/deploy/clean-build-and-package @@ -2,10 +2,10 @@ set -eu -#case $(git status --porcelain --untracked-files=no) in -# "") ;; -# *) echo "ERROR: Current working copy has been modified - not proceeding"; exit 2;; -#esac +case $(git status --porcelain --untracked-files=no) in + "") ;; + *) echo "ERROR: Current working copy has been modified - not proceeding"; exit 2;; +esac mkdir -p packages echo From 4cbb05ff81665818e7733ebf1a1fdb1a0e41f017 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Thu, 29 Feb 2024 13:38:52 +0000 Subject: [PATCH 09/20] I don't think I intended to commit this change --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index c24e9a2..7aa2c1e 100644 --- a/meson.build +++ b/meson.build @@ -5,7 +5,7 @@ project( version: '1.0.0', license: 'GPL-2.0-or-later', default_options: [ - 'cpp_std=c++20', + 'cpp_std=c++17', 'warning_level=2', 'buildtype=release', 'b_ndebug=if-release', From cd8e44924ac9b55f16f887bd4ffbc7677b917732 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Thu, 29 Feb 2024 14:58:47 +0000 Subject: [PATCH 10/20] Notarize fix --- deploy/macos/notarize.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/deploy/macos/notarize.sh b/deploy/macos/notarize.sh index 72f443b..1629d03 100755 --- a/deploy/macos/notarize.sh +++ b/deploy/macos/notarize.sh @@ -1,11 +1,5 @@ #!/bin/bash -## The following assumes we have generated an app password at -## appleid.apple.com and then stored it to keychain id "altool" using -## e.g. -## security add-generic-password -a "cannam+apple@all-day-breakfast.com" \ -## -w "generated-app-password" -s "altool" - ## NB to verify: # spctl -a -v "/Applications/Application.app" @@ -26,7 +20,7 @@ xcrun notarytool submit \ "$dmg" \ --apple-id "$user" \ --team-id "$team_id" \ - --keychain-profile notarytool \ + --keychain-profile notarytool-cannam \ --wait --progress echo From f11563300f8027a6f2aeb36b911ff0c29f92852a Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Thu, 29 Feb 2024 15:53:59 +0000 Subject: [PATCH 11/20] Fixes to unbundling --- main/ScoreFinder.cpp | 22 ++++++++++++++++++---- main/main.cpp | 5 +++-- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/main/ScoreFinder.cpp b/main/ScoreFinder.cpp index 7cd5d8e..3e6645c 100644 --- a/main/ScoreFinder.cpp +++ b/main/ScoreFinder.cpp @@ -241,8 +241,9 @@ ScoreFinder::populateUserDirectoriesFromBundled() auto populate = [&](string fromDir, string toDir) { if (!std::filesystem::exists(fromDir)) return; - if (!std::filesystem::create_directories(toDir)) { - SVDEBUG << "ScoreFinder::populateUserDirectoriesFromBundled: Failed to create target path " << toDir << endl; + std::error_code errorCode; + if (!std::filesystem::create_directories(toDir, errorCode)) { + SVDEBUG << "ScoreFinder::populateUserDirectoriesFromBundled: Failed to create target path " << toDir << ": " << errorCode << endl; return; } for (const auto &entry : std::filesystem::directory_iterator(fromDir)) { @@ -253,19 +254,32 @@ ScoreFinder::populateUserDirectoriesFromBundled() continue; } SVDEBUG << "ScoreFinder::populateUserDirectoriesFromBundled: Copying from " << entry << " to " << target << endl; - std::filesystem::copy(entry, target); + std::filesystem::copy(entry, target, errorCode); + SVDEBUG << "(errorCode = " << errorCode << ")" << endl; } } }; + + SVDEBUG << "ScoreFinder::populateUserDirectoriesFromBundled: Have " + << scores.size() << " scores" << endl; + QString home = QDir::homePath(); for (string score : scores) { + SVDEBUG << "ScoreFinder::populateUserDirectoriesFromBundled: Score " + << score << endl; + populate(bundledScoreDir + "/" + score, userScoreDir + "/" + score); + std::filesystem::path userRecordingDir = home.toStdString() + + "/Documents/PianoPrecision/Recordings/" + score; + populate(getBundledRecordingDirectory(score), - getUserRecordingDirectory(score)); + userRecordingDir); } + + SVDEBUG << "ScoreFinder::populateUserDirectoriesFromBundled: Done" << endl; } diff --git a/main/main.cpp b/main/main.cpp index 6ddcc1f..49725b5 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -441,9 +441,10 @@ main(int argc, char **argv) ScoreFinder::initialiseAlignerEnvironmentVariables(); settings.beginGroup("Bundled Scores"); - if (!settings.value("unpacked", false).toBool()) { + QString unpackedKey = QString("unpacked-%1").arg(SV_VERSION); + if (!settings.value(unpackedKey, false).toBool()) { ScoreFinder::populateUserDirectoriesFromBundled(); - settings.setValue("unpacked", true); + settings.setValue(unpackedKey, true); } settings.endGroup(); From ba693bdcfbca00498d559b9afdf15a778260080e Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Thu, 29 Feb 2024 17:19:36 +0000 Subject: [PATCH 12/20] Windows build and package fixes --- deploy/win64/build-64.bat | 46 +++++++++++++--------- deploy/win64/build-and-package.bat | 2 +- deploy/win64/generate-wxs.ps1 | 4 +- deploy/win64/package.ps1 | 2 +- deploy/win64/wxs.in | 62 ++++++++++++++++-------------- main/MainWindow.cpp | 6 +-- main/ScoreFinder.cpp | 2 +- meson.build | 2 +- 8 files changed, 72 insertions(+), 54 deletions(-) diff --git a/deploy/win64/build-64.bat b/deploy/win64/build-64.bat index 3fdc847..25fa3ff 100644 --- a/deploy/win64/build-64.bat +++ b/deploy/win64/build-64.bat @@ -5,7 +5,7 @@ echo on set STARTPWD=%CD% -set QTDIR=C:\Qt\5.13.2\msvc2017_64 +set QTDIR=C:\QtOpenSource\6.6.2\msvc2019_64 if not exist %QTDIR% ( @ echo Could not find 64-bit Qt in %QTDIR% @ exit /b 2 @@ -28,28 +28,38 @@ cd %STARTPWD% call .\repoint install if %errorlevel% neq 0 exit /b %errorlevel% -if not exist build_win64\build.ninja ( - meson setup build_win64 --buildtype release -Db_lto=true +set BUILDDIR=build_win64 + +if not exist %BUILDDIR%\build.ninja ( + meson setup %BUILDDIR% --buildtype release -Db_lto=true if %errorlevel% neq 0 exit /b %errorlevel% ) -ninja -C build_win64 +ninja -C %BUILDDIR% if %errorlevel% neq 0 exit /b %errorlevel% -copy %QTDIR%\bin\Qt5Core.dll .\build_win64 -copy %QTDIR%\bin\Qt5Gui.dll .\build_win64 -copy %QTDIR%\bin\Qt5Widgets.dll .\build_win64 -copy %QTDIR%\bin\Qt5Network.dll .\build_win64 -copy %QTDIR%\bin\Qt5Xml.dll .\build_win64 -copy %QTDIR%\bin\Qt5Svg.dll .\build_win64 -copy %QTDIR%\bin\Qt5Test.dll .\build_win64 -copy %QTDIR%\bin\Qt5Pdf.dll .\build_win64 -copy %QTDIR%\plugins\platforms\qminimal.dll .\build_win64 -copy %QTDIR%\plugins\platforms\qwindows.dll .\build_win64 -copy %QTDIR%\plugins\styles\qwindowsvistastyle.dll .\build_win64 -copy sv-dependency-builds\win64-msvc\lib\libsndfile-1.dll .\build_win64 - -meson test -C build_win64 +copy %QTDIR%\bin\Qt6Core.dll .\%BUILDDIR% +copy %QTDIR%\bin\Qt6Gui.dll .\%BUILDDIR% +copy %QTDIR%\bin\Qt6Widgets.dll .\%BUILDDIR% +copy %QTDIR%\bin\Qt6Network.dll .\%BUILDDIR% +copy %QTDIR%\bin\Qt6Xml.dll .\%BUILDDIR% +copy %QTDIR%\bin\Qt6Svg.dll .\%BUILDDIR% +copy %QTDIR%\bin\Qt6Pdf.dll .\%BUILDDIR% +copy %QTDIR%\bin\Qt6Test.dll .\%BUILDDIR% + +mkdir .\%BUILDDIR%\plugins +mkdir .\%BUILDDIR%\plugins\platforms +mkdir .\%BUILDDIR%\plugins\styles + +copy %QTDIR%\plugins\platforms\qdirect2d.dll .\%BUILDDIR%\plugins\platforms +copy %QTDIR%\plugins\platforms\qminimal.dll .\%BUILDDIR%\plugins\platforms +copy %QTDIR%\plugins\platforms\qoffscreen.dll .\%BUILDDIR%\plugins\platforms +copy %QTDIR%\plugins\platforms\qwindows.dll .\%BUILDDIR%\plugins\platforms +copy %QTDIR%\plugins\styles\qwindowsvistastyle.dll .\%BUILDDIR%\plugins\styles + +copy sv-dependency-builds\win64-msvc\lib\libsndfile-1.dll .\%BUILDDIR% + +meson test -C %BUILDDIR% if %errorlevel% neq 0 exit /b %errorlevel% set PATH=%ORIGINALPATH% diff --git a/deploy/win64/build-and-package.bat b/deploy/win64/build-and-package.bat index 78d785a..5b2d503 100644 --- a/deploy/win64/build-and-package.bat +++ b/deploy/win64/build-and-package.bat @@ -7,7 +7,7 @@ if not exist "C:\Program Files (x86)\SMLNJ\bin" ( @ exit /b 2 ) -if not exist "C:\Program Files (x86)\WiX Toolset v3.11\bin" ( +if not exist "C:\Program Files (x86)\WiX Toolset v3.14\bin" ( @ echo Could not find WiX Toolset @ exit /b 2 ) diff --git a/deploy/win64/generate-wxs.ps1 b/deploy/win64/generate-wxs.ps1 index 0a6b333..d1cc6ae 100644 --- a/deploy/win64/generate-wxs.ps1 +++ b/deploy/win64/generate-wxs.ps1 @@ -6,13 +6,15 @@ $ErrorActionPreference = "Stop" $redist_parent_dir = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\" -$redists = (Get-ChildItem -Path $redist_parent_dir -Name -Include 14.* -Attributes Directory) +$redists = @(Get-ChildItem -Path $redist_parent_dir -Name -Include 14.* -Attributes Directory) if (!$redists) { echo "ERROR: No 14.x redistributable directories found under $redist_parent_dir" exit 1 } +"Redists are: $redists" + $redist_ver = $redists[-1] $wxs = "deploy\win64\$full_kebab.wxs" diff --git a/deploy/win64/package.ps1 b/deploy/win64/package.ps1 index d0d2c62..edcf06e 100644 --- a/deploy/win64/package.ps1 +++ b/deploy/win64/package.ps1 @@ -14,7 +14,7 @@ if ($args[0] -eq "sign") { . deploy\metadata.ps1 $kitdir = "C:\Program Files (x86)\Windows Kits\10\bin\x64" -$wixdir = "C:\Program Files (x86)\WiX Toolset v3.11\bin" +$wixdir = "C:\Program Files (x86)\WiX Toolset v3.14\bin" if (! (Test-Path -Path $kitdir -PathType Container)) { "ERROR: Windows Kit directory $kitdir not found" diff --git a/deploy/win64/wxs.in b/deploy/win64/wxs.in index 1568719..6a5ff18 100644 --- a/deploy/win64/wxs.in +++ b/deploy/win64/wxs.in @@ -96,37 +96,41 @@ + Id="Qt6" + Guid="f43cb50c-6024-4dba-ad41-9bcf3904c9b2"> + Name="Qt6Gui.dll" + Source="build_win64\Qt6Gui.dll"/> + Name="Qt6Network.dll" + Source="build_win64\Qt6Network.dll"/> + Name="Qt6Widgets.dll" + Source="build_win64\Qt6Widgets.dll"/> + Name="Qt6Xml.dll" + Source="build_win64\Qt6Xml.dll"/> + Name="Qt6Svg.dll" + Source="build_win64\Qt6Svg.dll"/> + Name="Qt6Pdf.dll" + Source="build_win64\Qt6Pdf.dll"/> + - + + Id="Qt6PlatformPlugins" + Guid="6290dc87-1c39-4be4-8b43-351b89a6ac08"> + Source="build_win64\plugins\platforms\qminimal.dll"/> + Source="build_win64\plugins\platforms\qwindows.dll"/> + Id="Qt6StylePlugins" + Guid="f7c74e62-d0b6-4c47-a87f-6e3a0294ea4d"> + Source="build_win64\plugins\styles\qwindowsvistastyle.dll"/> @@ -327,13 +331,15 @@ + - + - - + + diff --git a/main/MainWindow.cpp b/main/MainWindow.cpp index 0d59af3..8cbf120 100644 --- a/main/MainWindow.cpp +++ b/main/MainWindow.cpp @@ -5460,11 +5460,11 @@ MainWindow::renameCurrentLayer() CommandHistory::getInstance()->addCommand (new GenericCommand (tr("Rename Layer"), - [=, this]() { + [=]() { layer->setPresentationName(newName); setupExistingLayersMenus(); }, - [=, this]() { + [=]() { layer->setPresentationName(existingNameSet ? existingName : ""); setupExistingLayersMenus(); })); @@ -5551,7 +5551,7 @@ MainWindow::playSpeedChanged(int position) // Percentage is shown to 0dp if >100, to 1dp if <100; factor is // shown to 3sf - size_t buflen = 30; + constexpr size_t buflen = 30; char pcbuf[buflen]; char facbuf[buflen]; diff --git a/main/ScoreFinder.cpp b/main/ScoreFinder.cpp index 3e6645c..00a451e 100644 --- a/main/ScoreFinder.cpp +++ b/main/ScoreFinder.cpp @@ -272,7 +272,7 @@ ScoreFinder::populateUserDirectoriesFromBundled() populate(bundledScoreDir + "/" + score, userScoreDir + "/" + score); - std::filesystem::path userRecordingDir = home.toStdString() + + string userRecordingDir = home.toStdString() + "/Documents/PianoPrecision/Recordings/" + score; populate(getBundledRecordingDirectory(score), diff --git a/meson.build b/meson.build index 7aa2c1e..1cbb36a 100644 --- a/meson.build +++ b/meson.build @@ -355,7 +355,6 @@ elif system == 'windows' '-DUNICODE', '-D_USE_MATH_DEFINES', '-DCAPNP_LITE', - '-D_HAS_STD_BYTE=0', ] feature_defines = [ @@ -1385,6 +1384,7 @@ verovio_all_include_dirs = [ 'verovio/include/midi', 'verovio/include/zip', 'verovio/include/vrv', + 'verovio/include/win32', 'misc/fake-git-commit-header', ] From 90187c7aa8e09b8c9b3ce1ff6aab78992668cf28 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Thu, 29 Feb 2024 17:53:57 +0000 Subject: [PATCH 13/20] Windows packaging fixes --- deploy/win64/package.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy/win64/package.ps1 b/deploy/win64/package.ps1 index edcf06e..738a01b 100644 --- a/deploy/win64/package.ps1 +++ b/deploy/win64/package.ps1 @@ -13,7 +13,7 @@ if ($args[0] -eq "sign") { . deploy\metadata.ps1 -$kitdir = "C:\Program Files (x86)\Windows Kits\10\bin\x64" +$kitdir = "C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64" $wixdir = "C:\Program Files (x86)\WiX Toolset v3.14\bin" if (! (Test-Path -Path $kitdir -PathType Container)) { @@ -35,7 +35,7 @@ $name = "Christopher Cannam" if ($sign) { "Signing executables" - &"$kitdir\signtool" sign /v /n "$name" /t http://time.certum.pl /fd sha1 /a build_win64\*.exe + &"$kitdir\signtool" sign /v /debug /n "$name" /t http://time.certum.pl /fd sha256 /a build_win64\*.exe } "Packaging" @@ -51,7 +51,7 @@ rm "$full_kebab.wixpdb" if ($sign) { "Signing packages" - &"$kitdir\signtool" sign /v /n "$name" /t http://time.certum.pl /fd sha1 /a *.msi + &"$kitdir\signtool" sign /v /n "$name" /t http://time.certum.pl /fd sha256 /a *.msi &"$kitdir\signtool" verify /pa "$full_kebab.msi" } From 3880bcb107ff03edb3ff8021937767274132ec3c Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Thu, 29 Feb 2024 18:21:56 +0000 Subject: [PATCH 14/20] Most annoyingly, the icons in the intro text aren't showing up on Windows and I have no idea why not. They're appearing as replacement blank-page icons. For now use a different text on Windows without them --- main/MainWindow.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/main/MainWindow.cpp b/main/MainWindow.cpp index 8cbf120..71165dc 100644 --- a/main/MainWindow.cpp +++ b/main/MainWindow.cpp @@ -6417,6 +6417,21 @@ MainWindow::getReleaseText() const void MainWindow::introduction() { +#ifdef Q_OS_WIN32 + QString introText = + "

How to use Piano Precision

" + "

You can open this instruction page at any time from the Help menu.

" + "

This is a software tool that assists in analyzing recorded piano performances together with their scores.

" + "

The controls you'll need for loading a score and loading a recording are located at the top-left corner of the application." + "

  1. First, you'll need to load an MEI score using the musical-note tool button.
  2. " + "
  3. Then, you can load a performance (audio) recording of that score using the tool button next to it.
  4. " + "
  5. Underneath the score area, you can find controls for synchronizing the score with the audio.
" + "

If you don't have your own MEI scores or recordings yet, you can use our samples located in the folder called PianoPrecision within your Documents folder:" + "

  • Beethoven Sonata Op. 110 Movement I
  • " + "
  • J. S. Bach Fugue in C Major, BWV 846
  • " + "
  • Mozart Sonata No. 18 Movement II
  • " + "
  • Schubert Impromptu Op. 90 No. 1

"; +#else // !Q_OS_WIN32 QString introText = "

How to use Piano Precision

" "

You can open this instruction page at any time from the Help menu.

" @@ -6430,7 +6445,8 @@ MainWindow::introduction() "
• J. S. Bach Fugue in C Major, BWV 846" "
• Mozart Sonata No. 18 Movement II" "
• Schubert Impromptu Op. 90 No. 1

"; - +#endif + int fontSize = font().pixelSize(); if (fontSize < 0) fontSize = font().pointSize(); if (fontSize < 0) fontSize = 16; From 76472c49e8fa9e8e955968c158068a20e3d5b70c Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Thu, 29 Feb 2024 18:42:06 +0000 Subject: [PATCH 15/20] Explicit conversion to strings in various places --- main/ScoreFinder.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/main/ScoreFinder.cpp b/main/ScoreFinder.cpp index 00a451e..1a0c856 100644 --- a/main/ScoreFinder.cpp +++ b/main/ScoreFinder.cpp @@ -32,7 +32,7 @@ ScoreFinder::getUserScoreDirectory() std::filesystem::path dir = home.toStdString() + "/Documents/PianoPrecision/Scores"; if (!std::filesystem::exists(dir)) { SVDEBUG << "ScoreFinder::getUserScoreDirectory: Score directory " - << dir << " does not exist, attempting to create it" + << dir.string() << " does not exist, attempting to create it" << endl; if (std::filesystem::create_directories(dir)) { SVDEBUG << "ScoreFinder::getUserScoreDirectory: Succeeded" << endl; @@ -41,7 +41,7 @@ ScoreFinder::getUserScoreDirectory() return {}; } } else if (!std::filesystem::is_directory(dir)) { - SVDEBUG << "ScoreFinder::getUserScoreDirectory: Location " << dir + SVDEBUG << "ScoreFinder::getUserScoreDirectory: Location " << dir.string() << " exists but is not a directory!" << endl; return {}; @@ -85,12 +85,12 @@ getBundledDirectory(QString dirname) if (!std::filesystem::exists(dir) || !std::filesystem::is_directory(dir)) { SVDEBUG << "ScoreFinder::getBundledDirectory: Directory " - << dir << " does not exist or is not a directory" + << dir.string() << " does not exist or is not a directory" << endl; return ""; } else { SVDEBUG << "ScoreFinder::getBundledDirectory: Directory " - << dir << " exists, returning it" + << dir.string() << " exists, returning it" << endl; return sdir; } @@ -243,7 +243,7 @@ ScoreFinder::populateUserDirectoriesFromBundled() if (!std::filesystem::exists(fromDir)) return; std::error_code errorCode; if (!std::filesystem::create_directories(toDir, errorCode)) { - SVDEBUG << "ScoreFinder::populateUserDirectoriesFromBundled: Failed to create target path " << toDir << ": " << errorCode << endl; + SVDEBUG << "ScoreFinder::populateUserDirectoriesFromBundled: Failed to create target path " << toDir << ": " << errorCode.value() << endl; return; } for (const auto &entry : std::filesystem::directory_iterator(fromDir)) { @@ -253,9 +253,9 @@ ScoreFinder::populateUserDirectoriesFromBundled() SVDEBUG << "ScoreFinder::populateUserDirectoriesFromBundled: Target file " << target << " already exists, skipping" << endl; continue; } - SVDEBUG << "ScoreFinder::populateUserDirectoriesFromBundled: Copying from " << entry << " to " << target << endl; + SVDEBUG << "ScoreFinder::populateUserDirectoriesFromBundled: Copying from " << entry.path().string() << " to " << target << endl; std::filesystem::copy(entry, target, errorCode); - SVDEBUG << "(errorCode = " << errorCode << ")" << endl; + SVDEBUG << "(errorCode = " << errorCode.value() << ")" << endl; } } }; From 8e6354054aba22520db3e34253b434932b90fab2 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Fri, 1 Mar 2024 08:52:44 +0000 Subject: [PATCH 16/20] Tidy up the user recording directory logic --- main/MainWindow.cpp | 2 +- main/ScoreFinder.cpp | 32 +++++++++++++++++--------------- main/ScoreFinder.h | 10 ++++++---- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/main/MainWindow.cpp b/main/MainWindow.cpp index 71165dc..239832e 100644 --- a/main/MainWindow.cpp +++ b/main/MainWindow.cpp @@ -2521,7 +2521,7 @@ MainWindow::openScoreFile(QString scoreName, QString scoreFile) m_scoreWidget->setMusicalEvents(m_score.getMusicalEvents()); auto recordingDirectory = - ScoreFinder::getUserRecordingDirectory(scoreName.toStdString()); + ScoreFinder::getUserRecordingDirectory(scoreName.toStdString(), false); if (recordingDirectory != "") { RecordDirectory::setRecordContainerDirectory (QString::fromStdString(recordingDirectory)); diff --git a/main/ScoreFinder.cpp b/main/ScoreFinder.cpp index 1a0c856..5e88ab9 100644 --- a/main/ScoreFinder.cpp +++ b/main/ScoreFinder.cpp @@ -191,16 +191,24 @@ ScoreFinder::initialiseAlignerEnvironmentVariables() } string -ScoreFinder::getUserRecordingDirectory(string scoreName) +ScoreFinder::getUserRecordingDirectory(string scoreName, bool create) { QString home = QDir::homePath(); std::filesystem::path dir = home.toStdString() + "/Documents/PianoPrecision/Recordings/" + scoreName; if (!std::filesystem::exists(dir)) { - SVDEBUG << "ScoreFinder::getUserRecordingDirectory: Recording directory " - << dir << " does not exist, reporting no score-specific directory" - << endl; - return {}; + if (create) { + std::error_code errorCode; + if (!std::filesystem::create_directories(dir, errorCode)) { + SVDEBUG << "ScoreFinder::getUserRecordingDirectory: Failed to create target path " << dir << ": " << errorCode.value() << endl; + return {}; + } + } else { + SVDEBUG << "ScoreFinder::getUserRecordingDirectory: Recording directory " + << dir << " does not exist and create flag not set, reporting no score-specific directory" + << endl; + return {}; + } } else if (!std::filesystem::is_directory(dir)) { SVDEBUG << "ScoreFinder::getUserRecordingDirectory: Location " << dir << " exists but is not a directory!" @@ -240,12 +248,8 @@ ScoreFinder::populateUserDirectoriesFromBundled() string bundledScoreDir = getBundledScoreDirectory(); auto populate = [&](string fromDir, string toDir) { - if (!std::filesystem::exists(fromDir)) return; - std::error_code errorCode; - if (!std::filesystem::create_directories(toDir, errorCode)) { - SVDEBUG << "ScoreFinder::populateUserDirectoriesFromBundled: Failed to create target path " << toDir << ": " << errorCode.value() << endl; - return; - } + if (fromDir == "" || !std::filesystem::exists(fromDir)) return; + if (toDir == "" || !std::filesystem::exists(toDir)) return; for (const auto &entry : std::filesystem::directory_iterator(fromDir)) { if (std::filesystem::is_regular_file(entry)) { string target = toDir + "/" + entry.path().filename().string(); @@ -254,6 +258,7 @@ ScoreFinder::populateUserDirectoriesFromBundled() continue; } SVDEBUG << "ScoreFinder::populateUserDirectoriesFromBundled: Copying from " << entry.path().string() << " to " << target << endl; + std::error_code errorCode; std::filesystem::copy(entry, target, errorCode); SVDEBUG << "(errorCode = " << errorCode.value() << ")" << endl; } @@ -272,11 +277,8 @@ ScoreFinder::populateUserDirectoriesFromBundled() populate(bundledScoreDir + "/" + score, userScoreDir + "/" + score); - string userRecordingDir = home.toStdString() + - "/Documents/PianoPrecision/Recordings/" + score; - populate(getBundledRecordingDirectory(score), - userRecordingDir); + getUserRecordingDirectory(score, true)); } SVDEBUG << "ScoreFinder::populateUserDirectoriesFromBundled: Done" << endl; diff --git a/main/ScoreFinder.h b/main/ScoreFinder.h index 3addd90..1c91324 100644 --- a/main/ScoreFinder.h +++ b/main/ScoreFinder.h @@ -70,11 +70,13 @@ class ScoreFinder /** Return the full path of the directory in which recordings of * the given score should be saved. If the directory does not - * exist yet, create it before returning its path. If creation - * fails or the path cannot be determined for any reason, return - * the empty string. + * exist and create is true, create it before returning its + * path. If creation fails, or create is false and the directory + * does not exist, or the path cannot be determined for any + * reason, return the empty string. */ - static std::string getUserRecordingDirectory(std::string scoreName); + static std::string getUserRecordingDirectory(std::string scoreName, + bool create); /** Return the full path of the directory in which app-bundled * recordings of the given score may be found. If the directory From bffbb6019b9b74017fbca572ea2fc222f65e8a0b Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Fri, 1 Mar 2024 09:43:55 +0000 Subject: [PATCH 17/20] Windows script fix --- deploy/win64/package.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/win64/package.ps1 b/deploy/win64/package.ps1 index 738a01b..cc0ea38 100644 --- a/deploy/win64/package.ps1 +++ b/deploy/win64/package.ps1 @@ -41,7 +41,7 @@ if ($sign) { "Packaging" if (Test-Path -Path "$full_kebab.msi") { - rm $full_kebab.msi + rm "$full_kebab.msi" } &"$wixdir\candle" -v deploy\win64\"$full_kebab.wxs" From 23355a871600855be7c55f82cb915f7364dd9676 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Fri, 1 Mar 2024 11:50:18 +0000 Subject: [PATCH 18/20] Unpack scores and recordings always, not only on first run --- main/main.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/main/main.cpp b/main/main.cpp index 49725b5..ce744c0 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -439,14 +439,7 @@ main(int argc, char **argv) PluginPathSetter::initialiseEnvironmentVariables(); ScoreFinder::initialiseAlignerEnvironmentVariables(); - - settings.beginGroup("Bundled Scores"); - QString unpackedKey = QString("unpacked-%1").arg(SV_VERSION); - if (!settings.value(unpackedKey, false).toBool()) { - ScoreFinder::populateUserDirectoriesFromBundled(); - settings.setValue(unpackedKey, true); - } - settings.endGroup(); + ScoreFinder::populateUserDirectoriesFromBundled(); QIcon icon; int sizes[] = { 16, 32, 64, 128, 256 }; From c2cd321e6591d3d4d490ecadad37e8a4757f5812 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Fri, 1 Mar 2024 11:50:50 +0000 Subject: [PATCH 19/20] Create target hierarchy - previous tidy had resulted in this only happening for recordings, not scores --- main/ScoreFinder.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/main/ScoreFinder.cpp b/main/ScoreFinder.cpp index 5e88ab9..991030a 100644 --- a/main/ScoreFinder.cpp +++ b/main/ScoreFinder.cpp @@ -248,8 +248,15 @@ ScoreFinder::populateUserDirectoriesFromBundled() string bundledScoreDir = getBundledScoreDirectory(); auto populate = [&](string fromDir, string toDir) { + std::error_code errorCode; if (fromDir == "" || !std::filesystem::exists(fromDir)) return; - if (toDir == "" || !std::filesystem::exists(toDir)) return; + if (toDir == "") return; + if (!std::filesystem::exists(toDir)) { + if (!std::filesystem::create_directories(toDir, errorCode)) { + SVDEBUG << "ScoreFinder::populateUserDirectoriesFromBundled: Failed to create target path " << toDir << ": " << errorCode.value() << endl; + return; + } + } for (const auto &entry : std::filesystem::directory_iterator(fromDir)) { if (std::filesystem::is_regular_file(entry)) { string target = toDir + "/" + entry.path().filename().string(); @@ -258,7 +265,6 @@ ScoreFinder::populateUserDirectoriesFromBundled() continue; } SVDEBUG << "ScoreFinder::populateUserDirectoriesFromBundled: Copying from " << entry.path().string() << " to " << target << endl; - std::error_code errorCode; std::filesystem::copy(entry, target, errorCode); SVDEBUG << "(errorCode = " << errorCode.value() << ")" << endl; } From 9a289797bea9d1dbf15f679202d41cd15446a33a Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Fri, 1 Mar 2024 13:23:02 +0000 Subject: [PATCH 20/20] Workaround for some stupidity on the Mac (operation not permitted when creating dmg with same volume name as one that was mounted earlier, even though it is long unmounted) --- deploy/macos/deploy-and-package.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deploy/macos/deploy-and-package.sh b/deploy/macos/deploy-and-package.sh index ea281a8..389d457 100755 --- a/deploy/macos/deploy-and-package.sh +++ b/deploy/macos/deploy-and-package.sh @@ -36,6 +36,7 @@ echo "Version: $version" source="$full_name.app" volume="$full_versioned" +volname="$full_name - $version" target="$volume"/"$full_name".app dmg="$volume".dmg @@ -129,7 +130,7 @@ deploy/macos/sign.sh "$volume" || exit 1 rm -f "$dmg" - hdiutil create -srcfolder "$volume" "$dmg" -volname "$volume" -fs HFS+ && + hdiutil create -srcfolder "$volume" "$dmg" -volname "$volname" -fs HFS+ && rm -r "$volume" echo "Done"