From 0534258cdf1b385a35176e86502d38a823743016 Mon Sep 17 00:00:00 2001 From: Maik Riechert Date: Fri, 9 Feb 2024 08:26:51 +0000 Subject: [PATCH] Add wheels for macOS arm64 (#118) --- .github/scripts/build-macos.sh | 6 +-- .../scripts/install-macos-obs-virtual-cam.sh | 10 +++- .github/scripts/test-macos.sh | 2 +- .github/workflows/ci.yml | 50 +++++++++++++++++++ CHANGELOG.md | 5 ++ pyvirtualcam/_version.py | 2 +- 6 files changed, 68 insertions(+), 7 deletions(-) diff --git a/.github/scripts/build-macos.sh b/.github/scripts/build-macos.sh index c0d514b..3dd341d 100755 --- a/.github/scripts/build-macos.sh +++ b/.github/scripts/build-macos.sh @@ -37,11 +37,11 @@ pip freeze # By default, wheels are tagged with the architecture of the Python # installation, which would produce universal2 even if only building # for x86_64. The following line overrides that behavior. -export _PYTHON_HOST_PLATFORM="macosx-${MACOS_MIN_VERSION}-x86_64" +export _PYTHON_HOST_PLATFORM="macosx-${MACOS_MIN_VERSION}-$ARCH" export CC=clang export CXX=clang++ -export CFLAGS="-arch x86_64" +export CFLAGS="-arch $ARCH" export CXXFLAGS=$CFLAGS export LDFLAGS=$CFLAGS export ARCHFLAGS=$CFLAGS @@ -54,7 +54,7 @@ python setup.py bdist_wheel # no shared library dependencies that have to be bundled. delocate-listdeps --all --depending dist/*.whl # lists library dependencies -delocate-wheel --verbose --require-archs=x86_64 dist/*.whl # copies library dependencies into wheel +delocate-wheel --verbose --require-archs=$ARCH dist/*.whl # copies library dependencies into wheel delocate-listdeps --all --depending dist/*.whl # verify # Dump target versions of dependend libraries. diff --git a/.github/scripts/install-macos-obs-virtual-cam.sh b/.github/scripts/install-macos-obs-virtual-cam.sh index 95c9245..48c93c3 100755 --- a/.github/scripts/install-macos-obs-virtual-cam.sh +++ b/.github/scripts/install-macos-obs-virtual-cam.sh @@ -3,9 +3,15 @@ set -e -x VERSION="28.0.2" -DMG_FILENAME="obs-studio-${VERSION}-macos-x86_64.dmg" +if [[ "$ARCH" == "arm64" ]]; then + ARCH_MOUNT="Apple" +else + ARCH_MOUNT="Intel" +fi + +DMG_FILENAME="obs-studio-${VERSION}-macos-${ARCH}.dmg" DMG_URL="https://cdn-fastly.obsproject.com/downloads/${DMG_FILENAME}" -MOUNT_PATH="/Volumes/OBS-${VERSION}-macOS-Intel" +MOUNT_PATH="/Volumes/OBS-${VERSION}-macOS-${ARCH_MOUNT}" INSTALL_PATH="/Library/CoreMediaIO/Plug-Ins/DAL" sudo mkdir -p "${INSTALL_PATH}" diff --git a/.github/scripts/test-macos.sh b/.github/scripts/test-macos.sh index 3b78776..d3a21aa 100755 --- a/.github/scripts/test-macos.sh +++ b/.github/scripts/test-macos.sh @@ -9,7 +9,7 @@ python -m venv env/$VENV source env/$VENV/bin/activate # Install pyvirtualcam -pip install dist/pyvirtualcam*cp${PYVER}*macosx*.whl +pip install dist/pyvirtualcam*cp${PYVER}*macosx*${ARCH}*.whl # Test installed pyvirtualcam pip install -r dev-requirements.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c2ac55e..0d0438d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,30 +65,54 @@ jobs: - os-image: macos-11 os-name: mac + arch: x86_64 macos-min-version: '10.9' python-version: '3.8' numpy-version: '1.17.*' - os-image: macos-11 os-name: mac + arch: x86_64 macos-min-version: '10.9' python-version: '3.9' numpy-version: '1.19.*' - os-image: macos-11 os-name: mac + arch: x86_64 macos-min-version: '10.9' python-version: '3.10' numpy-version: '1.21.*' - os-image: macos-11 os-name: mac + arch: x86_64 macos-min-version: '10.9' python-version: '3.11' numpy-version: '1.23.*' - os-image: macos-11 os-name: mac + arch: x86_64 macos-min-version: '10.9' python-version: '3.12' numpy-version: '1.26.*' + - os-image: macos-14 # M1 + os-name: mac + arch: arm64 + macos-min-version: '11.0' + python-version: '3.10' + numpy-version: '1.21.*' + - os-image: macos-14 # M1 + os-name: mac + arch: arm64 + macos-min-version: '11.0' + python-version: '3.11' + numpy-version: '1.23.*' + - os-image: macos-14 # M1 + os-name: mac + arch: arm64 + macos-min-version: '11.0' + python-version: '3.12' + numpy-version: '1.26.*' + - os-image: windows-latest os-name: windows python-version: '3.8' @@ -159,6 +183,7 @@ jobs: if: matrix.config.os-name == 'mac' run: .github/scripts/build-macos.sh env: + ARCH: ${{ matrix.config.arch }} MACOS_MIN_VERSION: ${{ matrix.config.macos-min-version }} PYTHON_VERSION: ${{ matrix.config.python-version }} NUMPY_VERSION: ${{ matrix.config.numpy-version }} @@ -210,30 +235,54 @@ jobs: - os-image: macos-11 os-name: mac + arch: x86_64 macos-min-version: '10.9' python-version: '3.8' numpy-version: '1.17.*' - os-image: macos-11 os-name: mac + arch: x86_64 macos-min-version: '10.9' python-version: '3.9' numpy-version: '1.19.*' - os-image: macos-11 os-name: mac + arch: x86_64 macos-min-version: '10.9' python-version: '3.10' numpy-version: '1.21.*' - os-image: macos-11 os-name: mac + arch: x86_64 macos-min-version: '10.9' python-version: '3.11' numpy-version: '1.23.*' - os-image: macos-11 os-name: mac + arch: x86_64 macos-min-version: '10.9' python-version: '3.12' numpy-version: '1.26.*' + - os-image: macos-14 # M1 + os-name: mac + arch: arm64 + macos-min-version: '11.0' + python-version: '3.10' + numpy-version: '1.21.*' + - os-image: macos-14 # M1 + os-name: mac + arch: arm64 + macos-min-version: '11.0' + python-version: '3.11' + numpy-version: '1.23.*' + - os-image: macos-14 # M1 + os-name: mac + arch: arm64 + macos-min-version: '11.0' + python-version: '3.12' + numpy-version: '1.26.*' + - os-image: windows-latest os-name: windows python-version: '3.8' @@ -311,6 +360,7 @@ jobs: .github/scripts/install-macos-obs-virtual-cam.sh .github/scripts/test-macos.sh env: + ARCH: ${{ matrix.config.arch }} PYTHON_VERSION: ${{ matrix.config.python-version }} - name: Store test captures as artifacts diff --git a/CHANGELOG.md b/CHANGELOG.md index fd25d23..103fe62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.11.1] - 2023-02-08 +### Added +- macOS arm64 support (Python 3.10 and higher). + ## [0.11.0] - 2023-12-10 ### Added - Python 3.12 support. @@ -131,6 +135,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Windows only, Python 3.5 - 3.8. - Support for [OBS-VirtualCam](https://github.com/CatxFish/obs-virtual-cam). +[0.11.1]: https://github.com/letmaik/pyvirtualcam/compare/v0.11.0...v0.11.1 [0.11.0]: https://github.com/letmaik/pyvirtualcam/compare/v0.10.2...v0.11.0 [0.10.2]: https://github.com/letmaik/pyvirtualcam/compare/v0.10.1...v0.10.2 [0.10.1]: https://github.com/letmaik/pyvirtualcam/compare/v0.10.0...v0.10.1 diff --git a/pyvirtualcam/_version.py b/pyvirtualcam/_version.py index ae6db5f..fee46bd 100644 --- a/pyvirtualcam/_version.py +++ b/pyvirtualcam/_version.py @@ -1 +1 @@ -__version__ = "0.11.0" +__version__ = "0.11.1"