Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/Main' into hid-parser-update
Browse files Browse the repository at this point in the history
  • Loading branch information
JoergAtGithub committed Jun 6, 2022
2 parents 603560d + 3d915de commit 55ca7d9
Show file tree
Hide file tree
Showing 465 changed files with 120,379 additions and 132,841 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
name: ${{ matrix.name }}
steps:
- name: Check out repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install build dependencies
run: tools/debian_buildenv.sh setup
- name: Create build directory
Expand Down
24 changes: 10 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
qt_qpa_platform: windows

env:
SCCACHE_COMMIT: 3f318a8675e4c3de4f5e8ab2d086189f2ae5f5cf
SCCACHE_VERSION: "0.3.0"
# macOS codesigning
APPLE_CODESIGN_IDENTITY: 2C2B5D3EDCE82BA55E22E9A67F16F8D03E390870
MACOS_CODESIGN_OPENSSL_PASSWORD: ${{ secrets.MACOS_CODESIGN_OPENSSL_PASSWORD }}
Expand All @@ -116,27 +116,23 @@ jobs:
artifact-windows-win64: ${{ steps.prepare_deploy.outputs.artifact-windows-win64 }}
steps:

# sccache's handling of the /fp:fast MSVC compiler option is broken, so use our fork with the fix.
# https://github.com/mozilla/sccache/issues/950
- name: "[Windows] Set up cargo cache"
- name: "[Windows] Set up Cargo cache"
if: runner.os == 'Windows'
uses: actions/cache@v2
uses: actions/cache@v3
id: sccache-build-cache
with:
path: C:\Users\runneradmin\.cargo
# hash of commit to build
key: sccache-${{ env.SCCACHE_COMMIT }}
key: sccache-${{ env.SCCACHE_VERSION }}

# This needs to be done first because something later messes with $PATH in a way that breaks cargo
# by causing it to find link.exe from Git for Windows instead of MSVC.
- name: "[Windows] Build fixed sccache"
- name: "[Windows] Build and install sccache"
shell: bash
if: runner.os == 'Windows' && steps.sccache-build-cache.outputs.cache-hit != 'true'
# TODO: change this to simply `cargo install sccache` after 0.2.16 has been released
run: cargo install --git https://github.com/mozilla/sccache.git --rev "${SCCACHE_COMMIT}"
run: cargo install --version "${{ env.SCCACHE_VERSION }}" sccache

- name: "Check out repository"
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
# This is necessary for making `git describe` work.
fetch-depth: 0
Expand Down Expand Up @@ -173,7 +169,7 @@ jobs:

- name: "[macOS/Windows] Set up build environment cache"
if: runner.os != 'Linux'
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ matrix.buildenv_basepath }}
key: ${{ runner.os }}-buildenv-${{ env.BUILDENV_NAME }}
Expand Down Expand Up @@ -231,7 +227,7 @@ jobs:
if: runner.os != 'windows'

- name: "Set up compiler cache"
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ matrix.compiler_cache_path }}
key: ${{ matrix.os }}-${{ matrix.compiler_cache }}-${{ github.head_ref }}-${{ github.run_number }}
Expand Down Expand Up @@ -443,7 +439,7 @@ jobs:
needs: build
steps:
- name: "Check out repository"
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
container: holzhaus/mixxx-ci:20210923
steps:
- name: "Check out repository"
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 2

Expand Down
23 changes: 18 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,24 @@ lib/googletest/googletest/test

# Exclude unneeded files from the bundled hidapi library in the lib/
# directory for future updates
lib/hidapi/android
lib/hidapi/dist
lib/hidapi/doxygen
lib/hidapi/hidtest
lib/hidapi/testgui
lib/hidapi/android/
lib/hidapi/dist/
lib/hidapi/documentation/
lib/hidapi/doxygen/
lib/hidapi/hidtest/
lib/hidapi/m4/
lib/hidapi/pc/
lib/hidapi/src/
lib/hidapi/testgui/
lib/hidapi/bootstrap
lib/hidapi/configure.ac
lib/hidapi/BUILD.*
lib/hidapi/windows/*
!lib/hidapi/windows/*.c
!lib/hidapi/windows/*.h
lib/hidapi/**/.gitignore
lib/hidapi/**/CMakeLists.txt
lib/hidapi/**/Makefile*

# Legacy compilation artifacts that are obsolete starting with 2.3
# TODO: Delete after 2.2 with SCons has been abandoned. Developers
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.2.0
hooks:
- id: fix-byte-order-marker
exclude: ^.*(\.cbproj|\.groupproj|\.props|\.sln|\.vcxproj|\.vcxproj.filters)$
Expand Down Expand Up @@ -63,7 +63,7 @@ repos:
#args: [--ignore-words, .codespellignore, --ignore-regex, "\\W(?:m_p*(?=[A-Z])|m_(?=\\w)|pp*(?=[A-Z])|k(?=[A-Z])|s_(?=\\w))"]
exclude: ^(packaging/wix/LICENSE.rtf|src/dialog/dlgabout\.cpp|.*\.(?:pot?|ts|wxl))$
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.12.0
rev: v8.14.0
hooks:
- id: eslint
args: [--fix, --report-unused-disable-directives]
Expand Down Expand Up @@ -107,7 +107,7 @@ repos:
hooks:
- id: markdownlint-cli2
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.14.1
rev: 0.14.3
hooks:
- id: check-github-workflows
- repo: local
Expand Down
42 changes: 10 additions & 32 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ set(CMAKE_PROJECT_DESCRIPTION "Mixxx is Free DJ software that gives you everythi

# Used for force control of color output
set(BUILD_COLORS "auto" CACHE STRING "Try to use colors auto/always/no")
# Option to disable symlinks
set(USE_SYMLINKS ON CACHE BOOL "Use symlinks in build directory when possible")

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
include(CMakeDependentOption)
Expand Down Expand Up @@ -924,7 +922,6 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL
src/util/performancetimer.cpp
src/util/rangelist.cpp
src/util/readaheadsamplebuffer.cpp
src/util/rlimit.cpp
src/util/rotary.cpp
src/util/runtimeloggingcategory.cpp
src/util/sample.cpp
Expand Down Expand Up @@ -1095,6 +1092,7 @@ endif()
set_target_properties(mixxx-lib PROPERTIES AUTOMOC ON AUTOUIC ON CXX_CLANG_TIDY "${CLANG_TIDY}")
target_include_directories(mixxx-lib PUBLIC src "${CMAKE_CURRENT_BINARY_DIR}/src")
if(UNIX AND NOT APPLE)
target_sources(mixxx-lib PRIVATE src/util/rlimit.cpp)
set(MIXXX_SETTINGS_PATH ".mixxx/")
endif()

Expand Down Expand Up @@ -1149,7 +1147,7 @@ if(MSVC)
endif()
else()
# TODO: Add -Wtrampolines, not yet supported by clazy
target_compile_options(mixxx-lib PUBLIC -Wall -Wextra -Woverloaded-virtual -Wfloat-conversion -Werror=return-type -Wformat=2 -Wformat-security -Wvla -Wundef)
target_compile_options(mixxx-lib PUBLIC -Wall -Wextra $<$<COMPILE_LANGUAGE:CXX>:-Woverloaded-virtual> -Wfloat-conversion -Werror=return-type -Wformat=2 -Wformat-security -Wvla -Wundef)
if(WARNINGS_PEDANTIC)
target_compile_options(mixxx-lib PUBLIC -pedantic)
endif()
Expand Down Expand Up @@ -1742,30 +1740,6 @@ add_custom_target(mixxx-benchmark
)
add_dependencies(mixxx-benchmark mixxx-test)

if(UNIX AND USE_SYMLINKS)
add_custom_target(mixxx-testdata
COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_CURRENT_SOURCE_DIR}/src/test" "${CMAKE_CURRENT_BINARY_DIR}/src/test"
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/res/controllers"
COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_CURRENT_SOURCE_DIR}/res/controllers/common-controller-scripts.js" "${CMAKE_CURRENT_BINARY_DIR}/res/controllers/common-controller-scripts.js"
COMMENT "Symlinking test data to build directory..."
)
elseif(WIN32)
file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/src/test" CMAKE_CURRENT_SOURCE_TESTDATA_DIR_NATIVE)
file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}/src/test/" CMAKE_CURRENT_BINARY_TESTDATA_DIR_NATIVE)
add_custom_target(mixxx-testdata
COMMAND xcopy ${CMAKE_CURRENT_SOURCE_TESTDATA_DIR_NATIVE} ${CMAKE_CURRENT_BINARY_TESTDATA_DIR_NATIVE} /s /d /q /y
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/res/controllers/common-controller-scripts.js" "${CMAKE_CURRENT_BINARY_DIR}/res/controllers/common-controller-scripts.js"
COMMENT "Copying missing or modified test data files to build directory..."
)
else()
add_custom_target(mixxx-testdata
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/src/test" "${CMAKE_CURRENT_BINARY_DIR}/src/test"
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/res/controllers/common-controller-scripts.js" "${CMAKE_CURRENT_BINARY_DIR}/res/controllers/common-controller-scripts.js"
COMMENT "Copying all test data files to build directory..."
)
endif()
add_dependencies(mixxx-test mixxx-testdata)

#
# Resources
#
Expand Down Expand Up @@ -2063,7 +2037,9 @@ target_link_libraries(mixxx-lib PRIVATE FLAC::FLAC)
# from -ffast-math optimized objects. The MSVC option /fp:fast does not suffer this issue
add_library(FpClassify STATIC EXCLUDE_FROM_ALL src/util/fpclassify.cpp)
if(GNU_GCC OR LLVM_CLANG)
target_compile_options(FpClassify PRIVATE -fno-fast-math)
# The option `-ffp-contract=on` must precede `-fno-fast-math`
# to silence a warning on Clang 14
target_compile_options(FpClassify PRIVATE -ffp-contract=on -fno-fast-math)
endif()
target_link_libraries(mixxx-lib PRIVATE FpClassify)

Expand Down Expand Up @@ -2710,7 +2686,7 @@ if(BROADCAST)
message(STATUS "Installed libshout version: ${Shout_VERSION} is suffering from bug lp1913579")
endif()
if(NOT Shoutidjc_FOUND OR Shoutidjc_VERSION VERSION_LESS 2.4.6)
# Fall back to internal libraray in the lib tree
# Fall back to internal library in the lib tree
message(STATUS "Using internal libshout-idjc")
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/lib/libshout-idjc")
target_include_directories(mixxx-lib SYSTEM PUBLIC lib/libshout-idjc/include)
Expand Down Expand Up @@ -2816,7 +2792,9 @@ find_package(LibUSB)
# USB HID controller support
option(HID "USB HID controller support" ON)
if(HID)
find_package(hidapi 0.10.1)
# hidapi 0.11.2 is the first release, that implements hid_get_input_report
# for the Linux hidraw backend.
find_package(hidapi 0.11.2)
if(NOT hidapi_FOUND)
message(STATUS "Linking internal libhidapi statically")
add_library(mixxx-hidapi STATIC EXCLUDE_FROM_ALL)
Expand Down Expand Up @@ -2978,7 +2956,7 @@ if (NOT CPACK_DEBIAN_PACKAGE_RELEASE)
set(CPACK_DEBIAN_PACKAGE_RELEASE 1)
endif()

set(CPACK_DEBIAN_DISTRIBUTION_RELEASES focal impish jammy)
set(CPACK_DEBIAN_DISTRIBUTION_RELEASES focal impish jammy kinetic)
set(CPACK_DEBIAN_SOURCE_DIR ${CMAKE_SOURCE_DIR})
set(CPACK_DEBIAN_UPLOAD_PPA_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/packaging/CPackDebUploadPPA.cmake")
set(CPACK_DEBIAN_INSTALL_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/packaging/CPackDebInstall.cmake")
Expand Down
4 changes: 2 additions & 2 deletions cmake/modules/Findhidapi.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL Linux)
endif()

# Version detection
if(PC_hidapi_VERSION)
if(DEFINED PC_hidapi_VERSION AND NOT PC_hidapi_VERSION STREQUAL "")
set(hidapi_VERSION "${PC_hidapi_VERSION}")
else()
if (EXISTS "${hidapi_INCLUDE_DIR}/hidapi.h")
if (EXISTS "${hidapi_LIBRARY}" AND EXISTS "${hidapi_INCLUDE_DIR}/hidapi.h")
file(READ "${hidapi_INCLUDE_DIR}/hidapi.h" hidapi_H_CONTENTS)
string(REGEX MATCH "#define HID_API_VERSION_MAJOR ([0-9]+)" _dummy "${hidapi_H_CONTENTS}")
set(hidapi_VERSION_MAJOR "${CMAKE_MATCH_1}")
Expand Down
95 changes: 48 additions & 47 deletions lib/apple/CADebugMacros.h
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
/*
File: CADebugMacros.h
Abstract: Part of CoreAudio Utility Classes
Version: 1.0.3
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
Inc. ("Apple") in consideration of your agreement to the following
terms, and your use, installation, modification or redistribution of
this Apple software constitutes acceptance of these terms. If you do
not agree with these terms, please do not use, install, modify or
redistribute this Apple software.
In consideration of your agreement to abide by the following terms, and
subject to these terms, Apple grants you a personal, non-exclusive
license, under Apple's copyrights in this original Apple software (the
"Apple Software"), to use, reproduce, modify and redistribute the Apple
Software, with or without modifications, in source and/or binary forms;
provided that if you redistribute the Apple Software in its entirety and
without modifications, you must retain this notice and the following
text and disclaimers in all such redistributions of the Apple Software.
Neither the name, trademarks, service marks or logos of Apple Inc. may
be used to endorse or promote products derived from the Apple Software
without specific prior written permission from Apple. Except as
expressly stated in this notice, no other rights or licenses, express or
implied, are granted by Apple herein, including but not limited to any
patent rights that may be infringed by your derivative works or by other
works in which the Apple Software may be incorporated.
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Copyright (C) 2013 Apple Inc. All Rights Reserved.
File: CADebugMacros.h
Abstract: Part of CoreAudio Utility Classes
Version: 1.1
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
Inc. ("Apple") in consideration of your agreement to the following
terms, and your use, installation, modification or redistribution of
this Apple software constitutes acceptance of these terms. If you do
not agree with these terms, please do not use, install, modify or
redistribute this Apple software.
In consideration of your agreement to abide by the following terms, and
subject to these terms, Apple grants you a personal, non-exclusive
license, under Apple's copyrights in this original Apple software (the
"Apple Software"), to use, reproduce, modify and redistribute the Apple
Software, with or without modifications, in source and/or binary forms;
provided that if you redistribute the Apple Software in its entirety and
without modifications, you must retain this notice and the following
text and disclaimers in all such redistributions of the Apple Software.
Neither the name, trademarks, service marks or logos of Apple Inc. may
be used to endorse or promote products derived from the Apple Software
without specific prior written permission from Apple. Except as
expressly stated in this notice, no other rights or licenses, express or
implied, are granted by Apple herein, including but not limited to any
patent rights that may be infringed by your derivative works or by other
works in which the Apple Software may be incorporated.
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Copyright (C) 2014 Apple Inc. All Rights Reserved.
*/
#if !defined(__CADebugMacros_h__)
#define __CADebugMacros_h__
Expand Down Expand Up @@ -88,6 +88,7 @@
// that have been added purely to avert -wshorten64-32 warnings on 64 bit platforms.
// For want of a better place to park this, we'll park it here.
#define ToUInt32(X) ((UInt32)(X))
#define ToSInt32(X) ((SInt32)(X))

#pragma mark Basic Definitions

Expand Down Expand Up @@ -362,7 +363,7 @@ void LogWarning(const char *fmt, ...); // writes to syslog (and stderr if debug

#define ThrowIfKernelError(inKernelError, inException, inMessage) \
{ \
unsigned int __Err = (inKernelError); \
int __Err = (inKernelError); \
if(__Err != 0) \
{ \
DebugMessageN1(inMessage ", Error: 0x%X", __Err); \
Expand All @@ -376,7 +377,7 @@ void LogWarning(const char *fmt, ...); // writes to syslog (and stderr if debug
if(__Err != 0) \
{ \
char __4CC[5] = CA4CCToCString(__Err); \
DebugMessageN2(inMessage ", Error: %d (%s)", (int)__Err, __4CC); \
DebugMessageN2(inMessage ", Error: %d (%s)", (int)__Err, __4CC); \
Throw(inException); \
} \
}
Expand Down Expand Up @@ -541,7 +542,7 @@ void LogWarning(const char *fmt, ...); // writes to syslog (and stderr if debug

#define ThrowIfKernelError(inKernelError, inException, inMessage) \
{ \
unsigned int __Err = (inKernelError); \
int __Err = (inKernelError); \
if(__Err != 0) \
{ \
Throw(inException); \
Expand Down
Loading

0 comments on commit 55ca7d9

Please sign in to comment.