From efad2ce2eae1a6aeee82d0bcfe7d32db0d378d2d Mon Sep 17 00:00:00 2001 From: Chad Cassady Date: Fri, 14 Jun 2024 11:58:55 -0500 Subject: [PATCH] [hid_updates] fix builds in Github Actions to install system hidapi --- .github/workflows/actions.yml | 40 +++++++++++++++++++++++++----- HelpSource/Classes/HIDUsage.schelp | 2 ++ 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 56ba2add9a6..515a76fe348 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -149,7 +149,7 @@ jobs: - name: install dependencies run: | sudo apt-get update - sudo apt-get install --yes build-essential cmake pkg-config libjack-jackd2-dev libsndfile1-dev libasound2-dev libavahi-client-dev libreadline6-dev libfftw3-dev libicu-dev libxt-dev libudev-dev emacs ccache + sudo apt-get install --yes build-essential cmake pkg-config libjack-jackd2-dev libsndfile1-dev libasound2-dev libavahi-client-dev libreadline6-dev libfftw3-dev libicu-dev libxt-dev libudev-dev libusb-dev emacs ccache # install appropriate clang/gcc compilers if [[ "$CC" =~ clang-[1-9] ]]; then sudo apt-get install -y $CC # package names are clang-X @@ -162,10 +162,19 @@ jobs: run: sudo apt-get install --yes libboost-thread-dev libboost-system-dev libboost-filesystem-dev libboost-regex-dev libboost-test-dev libboost-program-options-dev libyaml-cpp-dev - name: install qt from apt run: sudo apt-get install qtbase5-dev qt5-qmake qttools5-dev qttools5-dev-tools qtdeclarative5-dev libqt5svg5-dev libqt5websockets5-dev qtwebengine5-dev + - name: install hidapi + shell: bash + env: + HIDAPI_VERSION: 0.14.0 + run: | + cd $LIBS_DOWNLOAD_PATH + curl -L https://github.com/libusb/hidapi/archive/refs/tags/hidapi-$HIDAPI_VERSION.zip -o hidapi.zip + 7z x hidapi.zip -y + mv hidapi-hidapi-$HIDAPI_VERSION $GITHUB_WORKSPACE/external_libraries/hidapi/hidapi - name: configure run: | mkdir $BUILD_PATH && cd $BUILD_PATH - + cmake $GITHUB_WORKSPACE/external_libraries/hidapi/hidapi EXTRA_CMAKE_FLAGS= if $USE_SYSLIBS; then EXTRA_CMAKE_FLAGS="-DSYSTEM_BOOST=ON -DSYSTEM_YAMLCPP=ON"; fi @@ -332,6 +341,8 @@ jobs: - name: install system libraries if: env.USE_SYSLIBS == 'true' run: brew install yaml-cpp boost + - name: install hidapi + run: brew install hidapi - name: install qt from homebrew if: matrix.cmake-architectures == 'x86_64' && !matrix.qt-version run: brew install qt5 @@ -348,11 +359,19 @@ jobs: version: ${{ matrix.qt-version }} cache: true cache-key-prefix: ${{ runner.os }}-v1-${{ matrix.os-version }}-${{ matrix.xcode-version }}-${{ matrix.use-syslibs }}-${{ matrix.shared-libscsynth }}-qt${{ matrix.qt-version }} - + - name: install hidapi + shell: bash + env: + HIDAPI_VERSION: 0.14.0 + run: | + cd $LIBS_DOWNLOAD_PATH + curl -L https://github.com/libusb/hidapi/archive/refs/tags/hidapi-$HIDAPI_VERSION.zip -o hidapi.zip + 7z x hidapi.zip -y + mv hidapi-hidapi-$HIDAPI_VERSION $GITHUB_WORKSPACE/external_libraries/hidapi/hidapi - name: configure run: | mkdir $BUILD_PATH && cd $BUILD_PATH - + cmake $GITHUB_WORKSPACE/external_libraries/hidapi/hidapi EXTRA_CMAKE_FLAGS= if $USE_SYSLIBS; then EXTRA_CMAKE_FLAGS="-DSYSTEM_BOOST=ON -DSYSTEM_YAMLCPP=ON $EXTRA_CMAKE_FLAGS"; fi @@ -526,6 +545,15 @@ jobs: shell: bash run: | vcpkg install readline --triplet="${{ matrix.vcpkg-triplet }}" --overlay-triplets="$GITHUB_WORKSPACE/vcpkg/triplets" + - name: install hidapi + shell: bash + env: + HIDAPI_VERSION: 0.14.0 + run: | + cd $LIBS_DOWNLOAD_PATH + curl -L https://github.com/libusb/hidapi/archive/refs/tags/hidapi-$HIDAPI_VERSION.zip -o hidapi.zip + 7z x hidapi.zip -y + mv hidapi-hidapi-$HIDAPI_VERSION $GITHUB_WORKSPACE/external_libraries/hidapi/hidapi - name: configure shell: bash run: | @@ -533,7 +561,7 @@ jobs: export VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT mkdir $BUILD_PATH && cd $BUILD_PATH - + cmake $GITHUB_WORKSPACE/external_libraries/hidapi/hidapi cmake -G "${{ matrix.cmake-generator }}" -A "${{ matrix.cmake-arch }}" -D CMAKE_PREFIX_PATH="$Qt5_DIR" -D SUPERNOVA=ON -D SC_USE_QTWEBENGINE=${{ matrix.use-qtwebengine }} -D CMAKE_BUILD_TYPE=Release -DVCPKG_TARGET_TRIPLET="${{ matrix.vcpkg-triplet }}" .. # build type is specified here for MinGW build and for vcpkg - name: build @@ -626,7 +654,7 @@ jobs: run: | # install dependencies sudo apt-get update - sudo apt-get install --yes libsndfile1 libavahi-client-dev libfftw3-dev libicu-dev libudev-dev qtbase5-dev qtwebengine5-dev jackd1 socat + sudo apt-get install --yes libsndfile1 libavahi-client-dev libfftw3-dev libicu-dev libudev-dev libusb-dev qtbase5-dev qtwebengine5-dev jackd1 socat libusb-dev # add bin to PATH so that scsynth can be found echo "$INSTALL_PATH/bin" >> $GITHUB_PATH diff --git a/HelpSource/Classes/HIDUsage.schelp b/HelpSource/Classes/HIDUsage.schelp index 2871deb410b..4066685be77 100644 --- a/HelpSource/Classes/HIDUsage.schelp +++ b/HelpSource/Classes/HIDUsage.schelp @@ -45,6 +45,8 @@ the usage name returns:: an Array with the page id and the usage id +NOTE:: +This method doesn't work for usage names that appear on multiple usage pages. METHOD:: idsToName Retrieve the standard usage name and pagename of an HID usage element or collection.