From 1ee048629d5e89efd2085d3783a389225bf082c1 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 | 35 +++++++++++++++++++++++++++--- HelpSource/Classes/HIDUsage.schelp | 2 ++ 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 56ba2add9a6..532b7d0e920 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -162,6 +162,15 @@ 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_* $GITHUB_WORKSPACE/external_libraries/hidapi/hidapi - name: configure run: | mkdir $BUILD_PATH && cd $BUILD_PATH @@ -172,7 +181,7 @@ jobs: if $SHARED_LIBSCSYNTH; then EXTRA_CMAKE_FLAGS="-DLIBSCSYNTH=ON $EXTRA_CMAKE_FLAGS"; fi - cmake $EXTRA_CMAKE_FLAGS -DSC_EL=ON -DSC_VIM=ON -DSC_ED=ON -DSC_QT=ON -DSC_IDE=ON -DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PATH -DCMAKE_BUILD_TYPE=Release .. # --debug-output + cmake $EXTRA_CMAKE_FLAGS -Dhidapi_DIR=$GITHUB_WORKSPACE/external_libraries/hidapi/hidapi -DSC_EL=ON -DSC_VIM=ON -DSC_ED=ON -DSC_QT=ON -DSC_IDE=ON -DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PATH -DCMAKE_BUILD_TYPE=Release .. # --debug-output - name: build run: | cd $BUILD_PATH @@ -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,6 +359,15 @@ 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_* $GITHUB_WORKSPACE/external_libraries/hidapi/hidapi - name: configure run: | @@ -372,7 +392,7 @@ jobs: echo "EXTRA_CMAKE_FLAGS:" $EXTRA_CMAKE_FLAGS - cmake -G"Xcode" -DRULE_LAUNCH_COMPILE=ccache -DSUPERNOVA=ON $EXTRA_CMAKE_FLAGS .. + cmake -G"Xcode" -DRULE_LAUNCH_COMPILE=ccache -DSUPERNOVA=ON -Dhidapi_DIR=$GITHUB_WORKSPACE/external_libraries/hidapi/hidapi $EXTRA_CMAKE_FLAGS .. - name: build run: cmake --build $BUILD_PATH --config Release --target install - name: create archive @@ -526,6 +546,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_* $GITHUB_WORKSPACE/external_libraries/hidapi/hidapi - name: configure shell: bash run: | @@ -534,7 +563,7 @@ jobs: mkdir $BUILD_PATH && cd $BUILD_PATH - 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 + cmake -G -Dhidapi_DIR=$GITHUB_WORKSPACE/external_libraries/hidapi/hidapi "${{ 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 shell: bash 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.