Skip to content

Commit 2109e53

Browse files
committed
Build Pyodide wheel
1 parent 740357d commit 2109e53

File tree

4 files changed

+33
-6
lines changed

4 files changed

+33
-6
lines changed

.github/workflows/python-package.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,30 @@ jobs:
321321
retention-days: 7
322322
compression-level: 0
323323

324+
pyodide:
325+
runs-on: ubuntu-24.04
326+
steps:
327+
- uses: actions/checkout@v4
328+
with:
329+
fetch-depth: ${{ env.git-depth }}
330+
- name: Checkout submodules
331+
run: git submodule update --init --recursive --depth 1
332+
- uses: libsdl-org/setup-sdl@6574e20ac65ce362cd12f9c26b3a5e4d3cd31dee
333+
with:
334+
install-linux-dependencies: true
335+
build-type: "Debug"
336+
version: ${{ env.sdl-version }}
337+
- uses: pypa/cibuildwheel@v3.0.0
338+
env:
339+
CIBW_PLATFORM: pyodide
340+
- name: Archive wheel
341+
uses: actions/upload-artifact@v4
342+
with:
343+
name: wheels-pyodide
344+
path: wheelhouse/*.whl
345+
retention-days: 30
346+
compression-level: 0
347+
324348
publish:
325349
needs: [sdist, build, build-macos, linux-wheels]
326350
runs-on: ubuntu-latest

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@
350350
"pycall",
351351
"pycparser",
352352
"pyinstaller",
353+
"pyodide",
353354
"pypa",
354355
"PYPI",
355356
"pypiwin",

build_sdl.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,9 @@ def get_cdef() -> tuple[str, dict[str, str]]:
350350
libraries: list[str] = []
351351
library_dirs: list[str] = []
352352

353-
354-
if sys.platform == "darwin":
353+
if "PYODIDE" in os.environ:
354+
pass
355+
elif sys.platform == "darwin":
355356
extra_link_args += ["-framework", "SDL3"]
356357
else:
357358
libraries += ["SDL3"]
@@ -382,6 +383,7 @@ def get_cdef() -> tuple[str, dict[str, str]]:
382383
extra_compile_args += (
383384
subprocess.check_output(["pkg-config", "sdl3", "--cflags"], universal_newlines=True).strip().split()
384385
)
385-
extra_link_args += (
386-
subprocess.check_output(["pkg-config", "sdl3", "--libs"], universal_newlines=True).strip().split()
387-
)
386+
if "PYODIDE" not in os.environ:
387+
extra_link_args += (
388+
subprocess.check_output(["pkg-config", "sdl3", "--libs"], universal_newlines=True).strip().split()
389+
)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ requires = [
66
"setuptools_scm[toml]>=6.2",
77
"packaging>=24.2",
88
"wheel>=0.37.1",
9-
"cffi>=1.15",
9+
"cffi @ https://github.com/python-cffi/cffi/archive/refs/heads/main.zip", #"cffi>=1.15",
1010
"pycparser>=2.14",
1111
"pcpp==1.30",
1212
"requests>=2.28.1",

0 commit comments

Comments
 (0)