Skip to content

Commit 4cc9db6

Browse files
authored
Merge pull request mixxxdj#16157 from mixxxdj/sync-branch-2.6-to-main
Merge changes from `2.6` into `main`
2 parents b077fc8 + 628f1f3 commit 4cc9db6

14 files changed

Lines changed: 179 additions & 26 deletions

File tree

.github/dependabot.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,9 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "weekly"
7-
target-branch: "2.5"
7+
target-branch: "2.6"
8+
- package-ecosystem: "pre-commit"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"
12+
target-branch: "2.6"

.github/workflows/build.yml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,9 @@ jobs:
244244
# On windows-11-arm this action installs the x64 version which has unwanted side effects
245245
if: matrix.os == 'windows-2022'
246246
with:
247-
# This is a workaround for a SSL false positive in cmake 3.26.4
248-
# When downloading the manual. 3.21 is required for installing the
249-
# ANGLE Dlls via IMPORTED_RUNTIME_ARTIFACTS
250-
cmake-version: "3.21.x"
247+
# This version of CMake is needed for Wix Toolset >= v4 support,
248+
# see: https://cmake.org/cmake/help/latest/cpack_gen/wix.html#variable:CPACK_WIX_VERSION
249+
cmake-version: "3.30.x"
251250

252251
- name: "[Windows] Set up MSVC Developer Command Prompt"
253252
if: runner.os == 'Windows'
@@ -458,13 +457,30 @@ jobs:
458457
timestamp-digest: SHA256
459458
timeout: 600
460459

461-
- name: "[Windows 11 ARM64] Install WiX Toolset3"
462-
if: matrix.os == 'windows-11-arm'
460+
- name: "[Windows] Sign WiX custom action DLL"
461+
env:
462+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
463+
if: runner.os == 'Windows' && env.AZURE_TENANT_ID
464+
uses: azure/trusted-signing-action@v1.1.0
465+
with:
466+
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
467+
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
468+
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
469+
endpoint: https://weu.codesigning.azure.net/
470+
trusted-signing-account-name: mixxx
471+
certificate-profile-name: mixxx
472+
files: ${{ github.workspace }}/build/packaging/wix/mixxxupgradecustomaction.dll
473+
file-digest: SHA256
474+
timestamp-rfc3161: http://timestamp.acs.microsoft.com
475+
timestamp-digest: SHA256
476+
timeout: 600
477+
478+
- name: "[Windows] Install WiX Toolset"
479+
if: runner.os == 'Windows'
480+
shell: pwsh
463481
run: |
464-
choco install wixtoolset
465-
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
466-
refreshenv
467-
echo "WIX=$env:WIX" >> $env:GITHUB_ENV
482+
dotnet.exe tool install --global wix --version 6.0.2
483+
wix extension add --global WixToolset.UI.wixext/6.0.2
468484
469485
- name: "Package"
470486
id: package

CMakeLists.txt

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3239,7 +3239,7 @@ option(ENGINEPRIME "Support for library export to Denon Engine Prime" ON)
32393239
if(ENGINEPRIME)
32403240
# libdjinterop does not currently have a stable ABI, so we fetch sources for a specific tag, build here, and link
32413241
# statically. This situation should be reviewed once libdjinterop hits version 1.x.
3242-
set(LIBDJINTEROP_VERSION 0.27.0)
3242+
set(LIBDJINTEROP_VERSION 0.27.1)
32433243
# Look whether an existing installation of libdjinterop matches the required version.
32443244
find_package(DjInterop ${LIBDJINTEROP_VERSION} EXACT CONFIG)
32453245
if(NOT DjInterop_FOUND)
@@ -3302,7 +3302,7 @@ if(ENGINEPRIME)
33023302
"https://github.com/xsco/libdjinterop/archive/refs/tags/${LIBDJINTEROP_VERSION}.tar.gz"
33033303
"https://launchpad.net/~xsco/+archive/ubuntu/djinterop/+sourcefiles/libdjinterop/${LIBDJINTEROP_VERSION}-0ubuntu1/libdjinterop_${LIBDJINTEROP_VERSION}.orig.tar.gz"
33043304
URL_HASH
3305-
SHA256=c4e73bf3907fd45be1c9767bcd9f367cbb7c279b4fe047bf2216bc92ae3d1668
3305+
SHA256=4c7393ab70b7c92374557e72c86f650bea73ba50e59f6e5a683c69038cc7ea48
33063306
DOWNLOAD_DIR "${CMAKE_CURRENT_BINARY_DIR}/downloads"
33073307
DOWNLOAD_NAME "libdjinterop-${LIBDJINTEROP_VERSION}.tar.gz"
33083308
PREFIX "libdjinterop-${LIBDJINTEROP_VERSION}"
@@ -5386,6 +5386,8 @@ set(
53865386
"${CMAKE_CURRENT_SOURCE_DIR}/packaging/CPackDebInstall.cmake"
53875387
)
53885388

5389+
# Use WiX toolset version >= 4.0 for building Windows installers.
5390+
set(CPACK_WIX_VERSION 4)
53895391
set(CPACK_WIX_UPGRADE_GUID "921DC99C-4DCF-478D-B950-50685CB9E6BE")
53905392
set(
53915393
CPACK_WIX_LICENSE_RTF
@@ -5424,6 +5426,24 @@ if(WIN32)
54245426
)
54255427
endif()
54265428

5429+
# Build the custom action DLL for cross-scope upgrade detection.
5430+
# Old Mixxx (<=2.5) was installed per-user due to a CPack bug (CMP0172).
5431+
# The standard FindRelatedProducts skips per-user products when the
5432+
# current install is per-machine. The custom action calls scope-agnostic
5433+
# MsiEnumRelatedProducts() to detect and mark the old installation for
5434+
# removal by RemoveExistingProducts.
5435+
add_subdirectory(packaging/wix)
5436+
set(CPACK_WIX_INSTALL_SCOPE "perMachine")
5437+
file(
5438+
GENERATE OUTPUT
5439+
"${CMAKE_CURRENT_BINARY_DIR}/packaging/wix/MixxxUpgradePatch.xml"
5440+
INPUT "${CMAKE_CURRENT_SOURCE_DIR}/packaging/wix/MixxxUpgradePatch.xml.in"
5441+
)
5442+
set(
5443+
CPACK_WIX_PATCH_FILE
5444+
"${CMAKE_CURRENT_BINARY_DIR}/packaging/wix/MixxxUpgradePatch.xml"
5445+
)
5446+
54275447
# uses CMAKE_PROJECT_VERSION
54285448
configure_file(packaging/wix/LICENSE.rtf.in packaging/wix/LICENSE.rtf @ONLY)
54295449
endif()

packaging/flatpak/modules/libdjinterop.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ config-opts:
44
- -DCMAKE_BUILD_TYPE=RelWithDebInfo
55
sources:
66
- type: archive
7-
url: https://github.com/xsco/libdjinterop/archive/refs/tags/0.27.0.tar.gz
8-
sha256: c4e73bf3907fd45be1c9767bcd9f367cbb7c279b4fe047bf2216bc92ae3d1668
7+
url: https://github.com/xsco/libdjinterop/archive/refs/tags/0.27.1.tar.gz
8+
sha256: 4c7393ab70b7c92374557e72c86f650bea73ba50e59f6e5a683c69038cc7ea48
99
x-checker-data:
1010
type: anitya
1111
project-id: 374896

packaging/wix/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Custom action DLL for WiX installer upgrade detection.
2+
# Finds old Mixxx installations with CPACK_WIX_INSTALL_SCOPE "none"
3+
# that the standard FindRelatedProducts action skips due to scope mismatch.
4+
if(WIN32)
5+
add_library(mixxxupgradecustomaction SHARED mixxxupgradecustomaction.cpp)
6+
target_link_libraries(mixxxupgradecustomaction PRIVATE msi)
7+
set_target_properties(
8+
mixxxupgradecustomaction
9+
PROPERTIES
10+
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/packaging/wix"
11+
PREFIX ""
12+
)
13+
endif()
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<CPackWiXPatch>
2+
<!--
3+
Cross-scope upgrade detection for Mixxx.
4+
5+
Old Mixxx (<=2.5.5) installers had InstallScope=NONE (mixture of per-user and per-machine)
6+
due to a CPack bug (see CMake policy CMP0172). New installers (>= 2.6.0) are per-machine.
7+
The standard FindRelatedProducts skips per-user products when the current
8+
install is per-machine, leaving the old version behind.
9+
10+
This custom action DLL calls MsiEnumRelatedProducts() which is
11+
scope-agnostic, and sets WIX_UPGRADE_DETECTED so RemoveExistingProducts
12+
can clean up the old installation.
13+
-->
14+
<CPackWiXFragment Id="#PRODUCT">
15+
<Binary Id="mixxxupgradecustomaction"
16+
SourceFile="$<TARGET_FILE:mixxxupgradecustomaction>" />
17+
18+
<CustomAction Id="FindAllRelatedMixxxInstallations"
19+
BinaryRef="mixxxupgradecustomaction"
20+
DllEntry="FindAllRelatedMixxxInstallations"
21+
Execute="firstSequence" />
22+
23+
<InstallExecuteSequence>
24+
<Custom Action="FindAllRelatedMixxxInstallations" Before="FindRelatedProducts" />
25+
</InstallExecuteSequence>
26+
27+
<InstallUISequence>
28+
<Custom Action="FindAllRelatedMixxxInstallations" Before="FindRelatedProducts" />
29+
</InstallUISequence>
30+
</CPackWiXFragment>
31+
</CPackWiXPatch>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Custom Action DLL to find Mixxx installations regardless of install scope.
2+
// The standard MSI FindRelatedProducts skips per-user installs when the
3+
// current install is per-machine. This includes the mismatch generated by
4+
// CPACK_WIX_INSTALL_SCOPE "none".
5+
// This MsiEnumRelatedProducts() has no such filter.
6+
7+
// clang-format off
8+
// windows.h must precede msi.h (defines UINT, WINAPI, etc.)
9+
#include <windows.h>
10+
#include <msi.h>
11+
#include <msiquery.h>
12+
// clang-format on
13+
14+
#pragma comment(lib, "msi.lib")
15+
16+
namespace {
17+
// MSI GUIDs are exactly 38 chars (incl curly brackets, dashes and the null terminator):
18+
// {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
19+
constexpr DWORD kMsiGuidBufferSize = 39;
20+
21+
// Mixxx Upgrade GUID — same as CPACK_WIX_UPGRADE_GUID
22+
constexpr wchar_t kMixxxUpgradeCode[] = L"{921DC99C-4DCF-478D-B950-50685CB9E6BE}";
23+
} // namespace
24+
25+
extern "C"
26+
__declspec(dllexport) UINT __stdcall FindAllRelatedMixxxInstallations(
27+
MSIHANDLE hInstall) {
28+
// Get our own ProductCode so we don't mark ourselves for removal.
29+
wchar_t productCode[kMsiGuidBufferSize] = {};
30+
DWORD productCodeLen = kMsiGuidBufferSize;
31+
MsiGetPropertyW(hInstall, L"ProductCode", productCode, &productCodeLen);
32+
33+
// Enumerate ALL products with our UpgradeCode (scope-agnostic).
34+
wchar_t relatedProduct[kMsiGuidBufferSize] = {};
35+
DWORD index = 0;
36+
while (MsiEnumRelatedProductsW(kMixxxUpgradeCode, 0, index, relatedProduct) == ERROR_SUCCESS) {
37+
if (wcscmp(relatedProduct, productCode) != 0) {
38+
// Found an older/different installation — mark it for upgrade removal.
39+
MsiSetPropertyW(hInstall, L"WIX_UPGRADE_DETECTED", relatedProduct);
40+
MsiSetPropertyW(hInstall, L"MIGRATE", relatedProduct);
41+
MsiSetPropertyW(hInstall, L"UPGRADINGPRODUCTCODE", relatedProduct);
42+
break; // Typically only one old installation exists
43+
}
44+
++index;
45+
}
46+
47+
return ERROR_SUCCESS;
48+
}

src/coreservices.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,8 @@ void CoreServices::initialize(QApplication* pApp) {
679679
QString fd = QFileDialog::getExistingDirectory(nullptr,
680680
tr("Choose music library directory"),
681681
QStandardPaths::writableLocation(
682-
QStandardPaths::MusicLocation));
682+
QStandardPaths::MusicLocation),
683+
QFileDialog::ShowDirsOnly);
683684
#endif
684685
// request to add directory to database.
685686
if (!fd.isEmpty() && m_pLibrary->requestAddDir(fd)) {

src/engine/controls/bpmcontrol.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,8 @@ double BpmControl::calcSyncAdjustment(bool userTweakingSync) {
601601
adjustment = 1.0;
602602
// When updating the user offset, make sure to remove the existing offset or else it
603603
// will get double-applied.
604-
m_dUserOffset.setValue(error + curUserOffset);
604+
double offset = std::fmod(error + curUserOffset, 1.0f);
605+
m_dUserOffset.setValue(offset);
605606
} else {
606607
// Threshold above which we do sync adjustment.
607608
const double kErrorThreshold = 0.01;

src/library/export/dlglibraryexport.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,10 @@ void DlgLibraryExport::browseExportDirectory() {
222222
m_pConfig->getValue(ConfigKey("[Library]", kLastDirConfigItemName),
223223
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
224224
const auto exportDirectory = QFileDialog::getExistingDirectory(
225-
nullptr, tr("Export Library To"), lastExportDirectory);
225+
nullptr,
226+
tr("Export Library To"),
227+
lastExportDirectory,
228+
QFileDialog::ShowDirsOnly);
226229
if (exportDirectory.isEmpty()) {
227230
return;
228231
}

0 commit comments

Comments
 (0)