mirror of
https://github.com/RPCS3/hidapi.git
synced 2026-08-26 17:06:31 -04:00
ci: Docker build for Archlinux (#536)
Use GithubActions Docker build for Archlinux builds. To avoid using `builds.sr.ht`. Related: #476
This commit is contained in:
@@ -1,35 +0,0 @@
|
||||
image: archlinux
|
||||
packages:
|
||||
- autoconf
|
||||
- automake
|
||||
- libtool
|
||||
- libusb
|
||||
- libudev0
|
||||
- cmake
|
||||
- ninja
|
||||
sources:
|
||||
- https://github.com/libusb/hidapi
|
||||
tasks:
|
||||
- configure: |
|
||||
cd hidapi
|
||||
echo Configure Autotools build
|
||||
./bootstrap
|
||||
./configure
|
||||
echo Configure CMake build
|
||||
mkdir -p build install_cmake
|
||||
cmake -GNinja -B build -S . -DCMAKE_INSTALL_PREFIX=install_cmake
|
||||
- build-autotools: |
|
||||
cd hidapi
|
||||
make
|
||||
make DESTDIR=$PWD/root install
|
||||
make clean
|
||||
- build-cmake: |
|
||||
cd hidapi/build
|
||||
ninja
|
||||
ninja install
|
||||
ninja clean
|
||||
- build-manual: |
|
||||
cd hidapi/linux
|
||||
make -f Makefile-manual
|
||||
cd ../libusb
|
||||
make -f Makefile-manual
|
||||
@@ -382,3 +382,77 @@ jobs:
|
||||
"-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS}"
|
||||
cd build/static_test
|
||||
ninja install
|
||||
|
||||
|
||||
archlinux:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
container: archlinux:latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
path: hidapisrc
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pacman -Sy
|
||||
pacman -S --noconfirm gcc pkg-config autoconf automake libtool libusb libudev0 cmake make
|
||||
- name: Configure CMake
|
||||
run: |
|
||||
rm -rf build install
|
||||
cmake -B build/shared-cmake -S hidapisrc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install/shared-cmake -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS}"
|
||||
cmake -B build/static-cmake -S hidapisrc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install/static-cmake -DBUILD_SHARED_LIBS=FALSE -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS}"
|
||||
- name: Configure Automake
|
||||
working-directory: hidapisrc
|
||||
run: |
|
||||
./bootstrap
|
||||
./configure
|
||||
- name: Build CMake Shared
|
||||
working-directory: build/shared-cmake
|
||||
run: make install
|
||||
- name: Build CMake Static
|
||||
working-directory: build/static-cmake
|
||||
run: make install
|
||||
- name: Build Automake
|
||||
working-directory: hidapisrc
|
||||
run: |
|
||||
make
|
||||
make DESTDIR=$PWD/../install/automake install
|
||||
make clean
|
||||
- name: Build manual Makefile
|
||||
run: |
|
||||
cd hidapisrc/linux
|
||||
make -f Makefile-manual
|
||||
cd ../libusb
|
||||
make -f Makefile-manual
|
||||
- name: Check artifacts
|
||||
uses: andstor/file-existence-action@v2
|
||||
with:
|
||||
files: "install/shared-cmake/lib/libhidapi-libusb.so, \
|
||||
install/shared-cmake/lib/libhidapi-hidraw.so, \
|
||||
install/shared-cmake/include/hidapi/hidapi.h, \
|
||||
install/shared-cmake/include/hidapi/hidapi_libusb.h, \
|
||||
install/static-cmake/lib/libhidapi-libusb.a, \
|
||||
install/static-cmake/lib/libhidapi-hidraw.a, \
|
||||
install/static-cmake/include/hidapi/hidapi.h, \
|
||||
install/static-cmake/include/hidapi/hidapi_libusb.h"
|
||||
fail: true
|
||||
- name: Check CMake Export Package Shared
|
||||
run: |
|
||||
cmake \
|
||||
-B build/shared_test \
|
||||
-S hidapisrc/hidtest \
|
||||
-Dhidapi_ROOT=install/shared-cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=install/shared_test \
|
||||
"-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS}"
|
||||
cd build/shared_test
|
||||
make install
|
||||
- name: Check CMake Export Package Static
|
||||
run: |
|
||||
cmake \
|
||||
-B build/static_test \
|
||||
-S hidapisrc/hidtest \
|
||||
-Dhidapi_ROOT=install/static-cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=install/static_test \
|
||||
"-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS}"
|
||||
cd build/static_test
|
||||
make install
|
||||
|
||||
Reference in New Issue
Block a user