Skip to content

Commit

Permalink
[hid_updates] fix builds in Github Actions to install system hidapi
Browse files Browse the repository at this point in the history
  • Loading branch information
beatboxchad committed Jun 16, 2024
1 parent 0eff1b2 commit bd0512a
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
42 changes: 38 additions & 4 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,17 @@ 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
cd $GITHUB_WORKSPACE/external_libraries/hidapi/hidapi
cmake .
- name: configure
run: |
mkdir $BUILD_PATH && cd $BUILD_PATH
Expand All @@ -172,7 +183,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/export_generated -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
Expand Down Expand Up @@ -332,6 +343,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
Expand All @@ -348,7 +361,17 @@ 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
cd $GITHUB_WORKSPACE/external_libraries/hidapi/hidapi
cmake .
- name: configure
run: |
mkdir $BUILD_PATH && cd $BUILD_PATH
Expand All @@ -372,7 +395,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/export_generated $EXTRA_CMAKE_FLAGS ..
- name: build
run: cmake --build $BUILD_PATH --config Release --target install
- name: create archive
Expand Down Expand Up @@ -526,6 +549,17 @@ 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
cd $GITHUB_WORKSPACE/external_libraries/hidapi/hidapi
cmake .
- name: configure
shell: bash
run: |
Expand All @@ -534,7 +568,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/export_generated "${{ 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
Expand Down
2 changes: 2 additions & 0 deletions HelpSource/Classes/HIDUsage.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit bd0512a

Please sign in to comment.