Skip to content

Commit

Permalink
ci: More wheel hell
Browse files Browse the repository at this point in the history
  • Loading branch information
nvictus committed Oct 18, 2024
1 parent 22c84ce commit e9379b5
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/buildwheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-12, macos-14]
# macos-13 is an intel runner, macos-14 is apple silicon
os: [ubuntu-latest, macos-13, macos-14]
steps:
- uses: actions/checkout@v4

Expand All @@ -25,6 +26,8 @@ jobs:
platforms: all

- name: Build wheels
env:
CIBW_ENVIRONMENT: MACOSX_DEPLOYMENT_TARGET=11
uses: pypa/[email protected]

- uses: actions/upload-artifact@v3
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
platforms: all

- name: Build wheels
env:
CIBW_ENVIRONMENT: MACOSX_DEPLOYMENT_TARGET=11
uses: pypa/[email protected]

- uses: actions/upload-artifact@v3
Expand Down
30 changes: 29 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,33 @@ before-all = "yum install -y gcc make zlib-devel openssl-devel libpng-devel"
[tool.cibuildwheel.macos]
archs = ["auto"] # "arm64" needs M1 runner on GitHub Actions
before-all = """
brew install pkg-config openssl libpng # -> /usr/local (x86_64)
# We can't use brew if we want backwards compatibility with older macOS versions
# See: https://cibuildwheel.pypa.io/en/stable/faq/#macos-library-dependencies-do-not-satisfy-target-macos
# Build pkg-config
curl -LO https://pkg-config.freedesktop.org/releases/pkg-config-0.29.2.tar.gz
tar -xzf pkg-config-0.29.2.tar.gz
cd pkg-config-0.29.2
./configure --with-internal-glib
make
sudo make install
cd ..
# Build OpenSSL
curl -LO https://www.openssl.org/source/openssl-1.1.1u.tar.gz
tar -xzf openssl-1.1.1u.tar.gz
cd openssl-1.1.1u
./Configure darwin64-x86_64-cc -mmacosx-version-min=11
make
sudo make install
cd ..
# Build libpng
curl -LO https://download.sourceforge.net/libpng/libpng-1.6.40.tar.gz
tar -xzf libpng-1.6.40.tar.gz
cd libpng-1.6.40
./configure --prefix=/usr/local
make
sudo make install
cd ..
"""

0 comments on commit e9379b5

Please sign in to comment.