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 efad2ce
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 6 deletions.
40 changes: 34 additions & 6 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -526,14 +545,23 @@ 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: |
export PATH=$Qt5_DIR/bin:$PATH
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
Expand Down Expand Up @@ -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
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 efad2ce

Please sign in to comment.