From cd3b35b14c75a83f6a8240747fdfaf18281a288f Mon Sep 17 00:00:00 2001 From: Olivier Martin Date: Thu, 22 Feb 2024 09:35:15 +0100 Subject: [PATCH] ci: Generate Python package with cibuildwheel --- .github/workflows/github-actions.yml | 2 ++ ci/generate-python-package.sh | 4 ++-- ci/install-bluez.sh | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100755 ci/install-bluez.sh diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 13d4f909..ed02905a 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -35,6 +35,8 @@ jobs: with: python-version: ${{ matrix.python-version }} - run: ./ci/generate-python-package.sh + env: + CIBW_BEFORE_BUILD_LINUX: "./ci/install-bluez.sh" - name: Archive Python packages uses: actions/upload-artifact@v4 with: diff --git a/ci/generate-python-package.sh b/ci/generate-python-package.sh index 8cbac500..25cc6508 100755 --- a/ci/generate-python-package.sh +++ b/ci/generate-python-package.sh @@ -34,13 +34,13 @@ include CrossCompilation.cmake EOT # Install requirements -python3 -m pip install wheel +python3 -m pip install cibuildwheel==2.16.5 # Generate packages pushd ${gattlib_py_package_dir} # Binary package -python3 setup.py bdist_wheel +python3 -m cibuildwheel --output-dir dist # Source package python setup.py sdist diff --git a/ci/install-bluez.sh b/ci/install-bluez.sh new file mode 100755 index 00000000..97d2380e --- /dev/null +++ b/ci/install-bluez.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Exit immediately if a command exits with a non-zero status. +set -e + +# Install dependencies +yum -y install wget dbus-devel + +# +# +# +wget http://www.kernel.org/pub/linux/bluetooth/bluez-5.66.tar.xz +tar -xf bluez-5.66.tar.xz +pushd bluez-5.66 +./configure --prefix=/usr --disable-obex --disable-udev --disable-cups --disable-client --disable-manpages --disable-tools --disable-obex --disable-monitor --disable-hog --disable-hid --disable-network --disable-a2dp --disable-avrcp --disable-bap --disable-mcp --disable-vcp --enable-library +make +make install +popd +rm -Rf bluez-5.66