Skip to content

build gphoto2 macOS x86_64 #22

build gphoto2 macOS x86_64

build gphoto2 macOS x86_64 #22

Workflow file for this run

name: Build MacOS binary wheels
on: workflow_dispatch
jobs:
build:
runs-on: macos-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- 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/cibuildwheel@v2.16.2
env:
CIBW_ARCHS: x86_64
CIBW_SKIP: pp3*
CIBW_ENVIRONMENT: GPHOTO2_ROOT=$PWD/libgphoto2/local_install
CIBW_BEFORE_ALL: >
brew install libexif jpeg-turbo libtool libusb gd gettext &&
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@v3
with:
name: macos-wheels
path: wheelhouse/*.whl
test:
needs: build
runs-on: macos-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Fetch wheel files
uses: actions/download-artifact@v3
with:
name: macos-wheels
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Install wheel
run: pip3 install --disable-pip-version-check --no-index
--find-links=. gphoto2
- name: Test installation
run: python3 -m unittest discover tests -v