Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/2.4' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed May 12, 2023
2 parents 92f1414 + 63c6776 commit 3e500b1
Show file tree
Hide file tree
Showing 10 changed files with 101 additions and 36 deletions.
35 changes: 31 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
artifacts_path: build/*.deb
artifacts_slug: ubuntu-jammy
qt_qpa_platform: offscreen
- name: macOS 11
- name: macOS 11 x64
os: macos-11
cmake_args: >-
-DBULK=ON
Expand All @@ -67,17 +67,41 @@ jobs:
-DMACOS_BUNDLE=ON
-DMODPLUG=ON
-DWAVPACK=ON
-DVCPKG_TARGET_TRIPLET=x64-osx-min1012
-DVCPKG_DEFAULT_HOST_TRIPLET=x64-osx-min1012
# TODO: Fix this broken test on macOS
ctest_args: --exclude-regex DirectoryDAOTest.relocateDirectory
cpack_generator: DragNDrop
compiler_cache: ccache
compiler_cache_path: /Users/runner/Library/Caches/ccache
buildenv_basepath: /Users/runner/buildenv
buildenv_script: tools/macos_buildenv.sh
artifacts_name: macOS DMG
buildenv_script: tools/macos_release_buildenv.sh
artifacts_name: macOS Intel DMG
artifacts_path: build/*.dmg
artifacts_slug: macos-macosintel
qt_qpa_platform: offscreen
- name: macOS 11 arm64
os: macos-11
cmake_args: >-
-DBULK=ON
-DCOREAUDIO=ON
-DHSS1394=ON
-DMACOS_BUNDLE=ON
-DMODPLUG=ON
-DWAVPACK=ON
-DVCPKG_TARGET_TRIPLET=arm64-osx-min1100
-DVCPKG_DEFAULT_HOST_TRIPLET=x64-osx-min1012
# TODO: Fix this broken test on macOS
crosscompile: true
cpack_generator: DragNDrop
compiler_cache: ccache
compiler_cache_path: /Users/runner/Library/Caches/ccache
buildenv_basepath: /Users/runner/buildenv
buildenv_script: tools/macos_arm64-cross-release_buildenv.sh
artifacts_name: macOS ARM DMG
artifacts_path: build/*.dmg
artifacts_slug: macos-macosarm
qt_qpa_platform: offscreen
- name: Windows 2019 (MSVC)
os: windows-2019
# TODO: Re-enable FFmpeg after licensing issues have been clarified
Expand All @@ -101,7 +125,7 @@ jobs:
compiler_cache: sccache
compiler_cache_path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache\cache
buildenv_basepath: C:\buildenv
buildenv_script: tools/windows_buildenv.bat
buildenv_script: tools/windows_release_buildenv.bat
artifacts_name: Windows Installer
artifacts_path: build/*.msi
artifacts_slug: windows-win64
Expand All @@ -119,6 +143,7 @@ jobs:
container: ${{ matrix.container }}
outputs:
artifact-macos-macosintel: ${{ steps.prepare_deploy.outputs.artifact-macos-macosintel }}
artifact-macos-macosarm: ${{ steps.prepare_deploy.outputs.artifact-macos-macosarm }}
artifact-windows-win64: ${{ steps.prepare_deploy.outputs.artifact-windows-win64 }}
steps:
- name: "[Windows] Set up Cargo cache"
Expand Down Expand Up @@ -294,6 +319,7 @@ jobs:
run: ${{ matrix.compiler_cache }} -s

- name: "Test"
if: matrix.crosscompile != true
run: ctest --timeout 45 ${{ matrix.ctest_args }}
working-directory: build
env:
Expand All @@ -305,6 +331,7 @@ jobs:
CTEST_OUTPUT_ON_FAILURE: 1

- name: Benchmark
if: matrix.crosscompile != true
run: cmake --build . --target mixxx-benchmark --config RelWithDebInfo
working-directory: build
env:
Expand Down
20 changes: 14 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,21 @@ if(APPLE)
set(VCPKG_TARGET_TRIPLET "x64-osx-min10.15")
endif()
else()
# Minimum macOS version supported by Qt 5.12
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.12 CACHE STRING "Minimum macOS version the build will be able to run on")
if(NOT VCPKG_TARGET_TRIPLET)
set(VCPKG_TARGET_TRIPLET "x64-osx-min1012")
if(VCPKG_TARGET_TRIPLET STREQUAL "arm64-osx-min1100")
# Minimum macOS version for arm64 Support
set(CMAKE_OSX_DEPLOYMENT_TARGET 11.0 CACHE STRING "Minimum macOS version the build will be able to run on")
set(CMAKE_OSX_ARCHITECTURES arm64 CACHE STRING "The target achritecture")
set(CMAKE_SYSTEM_PROCESSOR arm64 CACHE STRING "The target system processor")
set(CMAKE_SYSTEM_NAME Darwin CACHE STRING "Setting this enables CMAKE_CROSSCOMPILE")
else()
# Minimum macOS version supported by Qt 5.12
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.12 CACHE STRING "Minimum macOS version the build will be able to run on")
if(NOT VCPKG_TARGET_TRIPLET)
set(VCPKG_TARGET_TRIPLET "x64-osx-min1012")
endif()
# Needed for deployment target < 10.14
add_compile_options(-fno-aligned-allocation)
endif()
# Needed for deployment target < 10.14
add_compile_options(-fno-aligned-allocation)
endif()
endif()

Expand Down
2 changes: 0 additions & 2 deletions packaging/macos/build_environment

This file was deleted.

1 change: 0 additions & 1 deletion packaging/windows/build_environment

This file was deleted.

3 changes: 3 additions & 0 deletions tools/macos_arm64-cross-release_buildenv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
tools_path=$(dirname "$0")
BUILDENV_ARM64=TRUE BUILDENV_RELEASE=TRUE "${tools_path}/macos_buildenv.sh" "$@"
3 changes: 3 additions & 0 deletions tools/macos_arm64-cross_buildenv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
tools_path=$(dirname "$0")
BUILDENV_ARM64=TRUE "${tools_path}/macos_buildenv.sh" "$@"
26 changes: 23 additions & 3 deletions tools/macos_buildenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,29 @@ realpath() {
THIS_SCRIPT_NAME=${BASH_SOURCE[0]}
[ -z "$THIS_SCRIPT_NAME" ] && THIS_SCRIPT_NAME=$0

MIXXX_ROOT="$(realpath "$(dirname "$THIS_SCRIPT_NAME")/..")"
if [ -n "${BUILDENV_ARM64}" ]; then
if [ -n "${BUILDENV_RELEASE}" ]; then
BUILDENV_BRANCH="2.4-rel"
BUILDENV_NAME="mixxx-deps-rel-2.4-arm64-osx-min1100-5adfbef"
BUILDENV_SHA256="17c9e5d552b160fe0e3de605ee6533f27f9ce43bd7d443f3c0fc315bed1a81a2"
else
BUILDENV_BRANCH="2.4"
BUILDENV_NAME="mixxx-deps-2.4-arm64-osx-min1100-65126fd"
BUILDENV_SHA256="1274cd167eb8966e86b86f8f65c6fd7d28f6b3b0ec7f9fd6527ece4588463749"
fi
else
if [ -n "${BUILDENV_RELEASE}" ]; then
BUILDENV_BRANCH="2.4-rel"
BUILDENV_NAME="mixxx-deps-rel-2.4-x64-osx-min1012-5adfbef"
BUILDENV_SHA256="5b2fc067b37cc206090531cb7dfe6f9e0be699de0183629f0838706acd73171e"
else
BUILDENV_BRANCH="2.4"
BUILDENV_NAME="mixxx-deps-2.4-x64-osx-min1012-65126fd"
BUILDENV_SHA256="c20872e2f73977db7d7b4b7199eed449fe7710da891076c2e8a079ea3d38d5ce"
fi
fi

read -r -d'\n' BUILDENV_NAME BUILDENV_SHA256 < "${MIXXX_ROOT}/packaging/macos/build_environment"
MIXXX_ROOT="$(realpath "$(dirname "$THIS_SCRIPT_NAME")/..")"

[ -z "$BUILDENV_BASEPATH" ] && BUILDENV_BASEPATH="${MIXXX_ROOT}/buildenv"

Expand All @@ -40,7 +60,7 @@ case "$1" in
if [ ! -d "${BUILDENV_PATH}" ]; then
if [ "$1" != "--profile" ]; then
echo "Build environment $BUILDENV_NAME not found in mixxx repository, downloading it..."
curl "https://downloads.mixxx.org/dependencies/2.4/macOS/${BUILDENV_NAME}.zip" -o "${BUILDENV_PATH}.zip"
curl "https://downloads.mixxx.org/dependencies/${BUILDENV_BRANCH}/macOS/${BUILDENV_NAME}.zip" -o "${BUILDENV_PATH}.zip"
OBSERVED_SHA256=$(shasum -a 256 "${BUILDENV_PATH}.zip"|cut -f 1 -d' ')
if [[ "$OBSERVED_SHA256" == "$BUILDENV_SHA256" ]]; then
echo "Download matched expected SHA256 sum $BUILDENV_SHA256"
Expand Down
3 changes: 3 additions & 0 deletions tools/macos_release_buildenv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
tools_path=$(dirname "$0")
BUILDENV_RELEASE=TRUE "${tools_path}/macos_buildenv.sh" "$@"
42 changes: 22 additions & 20 deletions tools/windows_buildenv.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ IF NOT DEFINED PLATFORM (
SET PLATFORM=x64
)

IF NOT DEFINED CONFIGURATION (
SET CONFIGURATION=release-fastbuild
)

IF NOT DEFINED BUILDENV_BASEPATH (
SET BUILDENV_BASEPATH=%MIXXX_ROOT%\buildenv
)
Expand All @@ -24,6 +20,16 @@ IF NOT DEFINED INSTALL_ROOT (
SET INSTALL_ROOT=%MIXXX_ROOT%\install
)

IF DEFINED BUILDENV_RELEASE (
SET BUILDENV_BRANCH=2.4-rel
SET BUILDENV_NAME=mixxx-deps-rel-2.4-x64-windows-5adfbef
SET BUILDENV_SHA256=b4b9ba62c6e99255f5591760bfce420a4a9c9a09885225b453f96d75f4d38bc5
) ELSE (
SET BUILDENV_BRANCH=2.4
SET BUILDENV_NAME=mixxx-deps-2.4-x64-windows-65126fd
SET BUILDENV_SHA256=812ebfed6b59e79ae040f3bc80041046a4bbd7bb33a0ef07c1cddc02ec0f0d1f
)

IF "%~1"=="" (
REM In case of manual start by double click no arguments are specified: Default to COMMAND_setup
CALL :COMMAND_setup
Expand All @@ -38,15 +44,12 @@ ENDLOCAL & SET "MIXXX_VCPKG_ROOT=%MIXXX_VCPKG_ROOT%" & SET "VCPKG_DEFAULT_TRIPLE
EXIT /B 0

:COMMAND_name
CALL :READ_ENVNAME
IF DEFINED GITHUB_ENV (
ECHO BUILDENV_NAME=!RETVAL! >> !GITHUB_ENV!
ECHO BUILDENV_NAME=%BUILDENV_NAME% >> !GITHUB_ENV!
)
GOTO :EOF

:COMMAND_setup
CALL :READ_ENVNAME
SET BUILDENV_NAME=%RETVAL%
SET BUILDENV_PATH=%BUILDENV_BASEPATH%\%BUILDENV_NAME%

IF NOT EXIST "%BUILDENV_BASEPATH%" (
Expand All @@ -55,13 +58,19 @@ EXIT /B 0
)

IF NOT EXIST "%BUILDENV_PATH%" (
SET BUILDENV_URL=https://downloads.mixxx.org/dependencies/2.4/Windows/!BUILDENV_NAME!.zip
SET BUILDENV_URL=https://downloads.mixxx.org/dependencies/!BUILDENV_BRANCH!/Windows/!BUILDENV_NAME!.zip
IF NOT EXIST "!BUILDENV_PATH!.zip" (
ECHO ^Download prebuilt build environment from "!BUILDENV_URL!" to "!BUILDENV_PATH!.zip"...
REM TODO: The /DYNAMIC parameter is required because our server does not yet support HTTP range headers
BITSADMIN /transfer buildenvjob /download /priority normal /DYNAMIC !BUILDENV_URL! "!BUILDENV_PATH!.zip"
REM TODO: verify download using sha256sum?
ECHO ^Download complete.
certutil -hashfile "!BUILDENV_PATH!.zip" SHA256 | FIND /C "!BUILDENV_SHA256!"
IF errorlevel 1 (
ECHO ^ERROR: Download did not match expected SHA256 checksum!
certutil -hashfile "!BUILDENV_PATH!.zip" SHA256
echo ^Expected: "!BUILDENV_SHA256!"
EXIT /B 1
)
) else (
ECHO ^Using cached archive at "!BUILDENV_PATH!.zip".
)
Expand Down Expand Up @@ -147,15 +156,6 @@ EXIT /B 0
GOTO :EOF


:READ_ENVNAME
ECHO Reading name of prebuild environment from "%MIXXX_ROOT%\packaging\windows\build_environment"
SET /P BUILDENV_NAME=<"%MIXXX_ROOT%\packaging\windows\build_environment"
SET BUILDENV_NAME=!BUILDENV_NAME:PLATFORM=%PLATFORM%!
SET BUILDENV_NAME=!BUILDENV_NAME:CONFIGURATION=%CONFIGURATION%!
SET RETVAL=%BUILDENV_NAME%
ECHO Environment name: %RETVAL%
GOTO :EOF

:GENERATE_CMakeSettings_JSON
REM Generate CMakeSettings.json which is read by MS Visual Studio to determine the supported CMake build environments
SET CMakeSettings=%MIXXX_ROOT%\CMakeSettings.json
Expand All @@ -177,7 +177,9 @@ REM Generate CMakeSettings.json which is read by MS Visual Studio to determine t
>>"%CMakeSettings%" echo {
>>"%CMakeSettings%" echo "configurations": [
SET configElementTermination=,
CALL :Configuration2CMakeSettings_JSON off Debug
IF NOT DEFINED BUILDENV_RELEASE (
CALL :Configuration2CMakeSettings_JSON off Debug
)
CALL :Configuration2CMakeSettings_JSON legacy RelWithDebInfo
CALL :Configuration2CMakeSettings_JSON portable RelWithDebInfo
SET configElementTermination=
Expand Down
2 changes: 2 additions & 0 deletions tools/windows_release_buildenv.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@ECHO OFF
set BUILDENV_RELEASE=TRUE && call "%~dp0windows_buildenv.bat" %* & set BUILDENV_RELEASE=

0 comments on commit 3e500b1

Please sign in to comment.