build gphoto2 macOS arm64 #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build gphoto2 macOS arm64 | |
on: workflow_dispatch | |
jobs: | |
build: | |
runs-on: macos-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Download libgphoto2 | |
run: wget -nv | |
https://github.com/gphoto/libgphoto2/releases/download/v2.5.31/libgphoto2-2.5.31.tar.xz | |
-O libgphoto2.tar.xz | |
- name: Extract libgphoto2 | |
run: | | |
mkdir $PWD/libgphoto2 | |
tar xf libgphoto2.tar.xz \ | |
--directory $PWD/libgphoto2 --strip-components=1 | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_ARCHS: arm64 | |
CIBW_SKIP: pp3* | |
CIBW_ENVIRONMENT: > | |
GPHOTO2_ROOT=$PWD/libgphoto2/local_install | |
MACOSX_DEPLOYMENT_TARGET="14.0" | |
SYSTEM_VERSION_COMPAT=0 | |
CIBW_TEST_COMMAND: > | |
python3 -m gphoto2 -v && | |
python3 -m unittest discover {project}/tests -v | |
CIBW_BEFORE_ALL: > | |
brew install libexif libtool gd && | |
pushd $PWD/libgphoto2 && | |
./configure --prefix=$PWD/local_install --disable-internal-docs \ | |
--enable-vusb \ | |
CFLAGS="-D_DARWIN_C_SOURCE -I$(brew --prefix)/include" && | |
make && | |
make install && | |
popd | |
- name: Store results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: macos-arm64-wheels | |
path: wheelhouse/*.whl |