Skip to content

Commit 0534258

Browse files
authored
Add wheels for macOS arm64 (#118)
1 parent 894352e commit 0534258

File tree

6 files changed

+68
-7
lines changed

6 files changed

+68
-7
lines changed

.github/scripts/build-macos.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ pip freeze
3737
# By default, wheels are tagged with the architecture of the Python
3838
# installation, which would produce universal2 even if only building
3939
# for x86_64. The following line overrides that behavior.
40-
export _PYTHON_HOST_PLATFORM="macosx-${MACOS_MIN_VERSION}-x86_64"
40+
export _PYTHON_HOST_PLATFORM="macosx-${MACOS_MIN_VERSION}-$ARCH"
4141

4242
export CC=clang
4343
export CXX=clang++
44-
export CFLAGS="-arch x86_64"
44+
export CFLAGS="-arch $ARCH"
4545
export CXXFLAGS=$CFLAGS
4646
export LDFLAGS=$CFLAGS
4747
export ARCHFLAGS=$CFLAGS
@@ -54,7 +54,7 @@ python setup.py bdist_wheel
5454
# no shared library dependencies that have to be bundled.
5555

5656
delocate-listdeps --all --depending dist/*.whl # lists library dependencies
57-
delocate-wheel --verbose --require-archs=x86_64 dist/*.whl # copies library dependencies into wheel
57+
delocate-wheel --verbose --require-archs=$ARCH dist/*.whl # copies library dependencies into wheel
5858
delocate-listdeps --all --depending dist/*.whl # verify
5959

6060
# Dump target versions of dependend libraries.

.github/scripts/install-macos-obs-virtual-cam.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@ set -e -x
33

44
VERSION="28.0.2"
55

6-
DMG_FILENAME="obs-studio-${VERSION}-macos-x86_64.dmg"
6+
if [[ "$ARCH" == "arm64" ]]; then
7+
ARCH_MOUNT="Apple"
8+
else
9+
ARCH_MOUNT="Intel"
10+
fi
11+
12+
DMG_FILENAME="obs-studio-${VERSION}-macos-${ARCH}.dmg"
713
DMG_URL="https://cdn-fastly.obsproject.com/downloads/${DMG_FILENAME}"
8-
MOUNT_PATH="/Volumes/OBS-${VERSION}-macOS-Intel"
14+
MOUNT_PATH="/Volumes/OBS-${VERSION}-macOS-${ARCH_MOUNT}"
915
INSTALL_PATH="/Library/CoreMediaIO/Plug-Ins/DAL"
1016

1117
sudo mkdir -p "${INSTALL_PATH}"

.github/scripts/test-macos.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ python -m venv env/$VENV
99
source env/$VENV/bin/activate
1010

1111
# Install pyvirtualcam
12-
pip install dist/pyvirtualcam*cp${PYVER}*macosx*.whl
12+
pip install dist/pyvirtualcam*cp${PYVER}*macosx*${ARCH}*.whl
1313

1414
# Test installed pyvirtualcam
1515
pip install -r dev-requirements.txt

.github/workflows/ci.yml

+50
Original file line numberDiff line numberDiff line change
@@ -65,30 +65,54 @@ jobs:
6565

6666
- os-image: macos-11
6767
os-name: mac
68+
arch: x86_64
6869
macos-min-version: '10.9'
6970
python-version: '3.8'
7071
numpy-version: '1.17.*'
7172
- os-image: macos-11
7273
os-name: mac
74+
arch: x86_64
7375
macos-min-version: '10.9'
7476
python-version: '3.9'
7577
numpy-version: '1.19.*'
7678
- os-image: macos-11
7779
os-name: mac
80+
arch: x86_64
7881
macos-min-version: '10.9'
7982
python-version: '3.10'
8083
numpy-version: '1.21.*'
8184
- os-image: macos-11
8285
os-name: mac
86+
arch: x86_64
8387
macos-min-version: '10.9'
8488
python-version: '3.11'
8589
numpy-version: '1.23.*'
8690
- os-image: macos-11
8791
os-name: mac
92+
arch: x86_64
8893
macos-min-version: '10.9'
8994
python-version: '3.12'
9095
numpy-version: '1.26.*'
9196

97+
- os-image: macos-14 # M1
98+
os-name: mac
99+
arch: arm64
100+
macos-min-version: '11.0'
101+
python-version: '3.10'
102+
numpy-version: '1.21.*'
103+
- os-image: macos-14 # M1
104+
os-name: mac
105+
arch: arm64
106+
macos-min-version: '11.0'
107+
python-version: '3.11'
108+
numpy-version: '1.23.*'
109+
- os-image: macos-14 # M1
110+
os-name: mac
111+
arch: arm64
112+
macos-min-version: '11.0'
113+
python-version: '3.12'
114+
numpy-version: '1.26.*'
115+
92116
- os-image: windows-latest
93117
os-name: windows
94118
python-version: '3.8'
@@ -159,6 +183,7 @@ jobs:
159183
if: matrix.config.os-name == 'mac'
160184
run: .github/scripts/build-macos.sh
161185
env:
186+
ARCH: ${{ matrix.config.arch }}
162187
MACOS_MIN_VERSION: ${{ matrix.config.macos-min-version }}
163188
PYTHON_VERSION: ${{ matrix.config.python-version }}
164189
NUMPY_VERSION: ${{ matrix.config.numpy-version }}
@@ -210,30 +235,54 @@ jobs:
210235

211236
- os-image: macos-11
212237
os-name: mac
238+
arch: x86_64
213239
macos-min-version: '10.9'
214240
python-version: '3.8'
215241
numpy-version: '1.17.*'
216242
- os-image: macos-11
217243
os-name: mac
244+
arch: x86_64
218245
macos-min-version: '10.9'
219246
python-version: '3.9'
220247
numpy-version: '1.19.*'
221248
- os-image: macos-11
222249
os-name: mac
250+
arch: x86_64
223251
macos-min-version: '10.9'
224252
python-version: '3.10'
225253
numpy-version: '1.21.*'
226254
- os-image: macos-11
227255
os-name: mac
256+
arch: x86_64
228257
macos-min-version: '10.9'
229258
python-version: '3.11'
230259
numpy-version: '1.23.*'
231260
- os-image: macos-11
232261
os-name: mac
262+
arch: x86_64
233263
macos-min-version: '10.9'
234264
python-version: '3.12'
235265
numpy-version: '1.26.*'
236266

267+
- os-image: macos-14 # M1
268+
os-name: mac
269+
arch: arm64
270+
macos-min-version: '11.0'
271+
python-version: '3.10'
272+
numpy-version: '1.21.*'
273+
- os-image: macos-14 # M1
274+
os-name: mac
275+
arch: arm64
276+
macos-min-version: '11.0'
277+
python-version: '3.11'
278+
numpy-version: '1.23.*'
279+
- os-image: macos-14 # M1
280+
os-name: mac
281+
arch: arm64
282+
macos-min-version: '11.0'
283+
python-version: '3.12'
284+
numpy-version: '1.26.*'
285+
237286
- os-image: windows-latest
238287
os-name: windows
239288
python-version: '3.8'
@@ -311,6 +360,7 @@ jobs:
311360
.github/scripts/install-macos-obs-virtual-cam.sh
312361
.github/scripts/test-macos.sh
313362
env:
363+
ARCH: ${{ matrix.config.arch }}
314364
PYTHON_VERSION: ${{ matrix.config.python-version }}
315365

316366
- name: Store test captures as artifacts

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.11.1] - 2023-02-08
8+
### Added
9+
- macOS arm64 support (Python 3.10 and higher).
10+
711
## [0.11.0] - 2023-12-10
812
### Added
913
- Python 3.12 support.
@@ -131,6 +135,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
131135
- Windows only, Python 3.5 - 3.8.
132136
- Support for [OBS-VirtualCam](https://github.com/CatxFish/obs-virtual-cam).
133137

138+
[0.11.1]: https://github.com/letmaik/pyvirtualcam/compare/v0.11.0...v0.11.1
134139
[0.11.0]: https://github.com/letmaik/pyvirtualcam/compare/v0.10.2...v0.11.0
135140
[0.10.2]: https://github.com/letmaik/pyvirtualcam/compare/v0.10.1...v0.10.2
136141
[0.10.1]: https://github.com/letmaik/pyvirtualcam/compare/v0.10.0...v0.10.1

pyvirtualcam/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.11.0"
1+
__version__ = "0.11.1"

0 commit comments

Comments
 (0)