Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 11 additions & 89 deletions packages/pygame-ce/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,101 +1,23 @@
package:
name: pygame-ce
version: 2.4.1
# Need newer version for 3.13 compat see https://github.com/pyodide/pyodide/pull/5522
_disabled: true
version: 2.5.6.dev2
top-level:
- pygame
source:
url: https://files.pythonhosted.org/packages/dc/b1/64fffc2c8664497ae82b2afb4f5efe0130d38b39f2d25af0288c4261df3e/pygame-ce-2.4.1.tar.gz
sha256: 70a84aa1417c633a0fd6754ffa5dc92ee1b9aeb70baaa52c8c8c94a7c6db9cf0
patches:
- patches/0001-Replace-OpenAudioDevice-with-OpenAudio.patch
- patches/0001-freetype-init.patch
- patches/0001-wasm_unify_pygame_web_pyodide_static_Freetype_init.patch
requirements:
constraint:
- setuptools < 75
url: https://files.pythonhosted.org/packages/ab/98/911c3287c42a774a48271758990cd7d57cce148866f4126a41314223ab98/pygame_ce-2.5.6.dev2.tar.gz
sha256: a1303cd212a3e92253712293480f2b7741fd7ac6e29981c5ff1ded1d554d030c
build:
script: |
embuilder build sdl2 sdl2_ttf sdl2_image sdl2_mixer sdl2_gfx libjpeg libpng giflib harfbuzz vorbis mpg123 libmodplug freetype libhtml5 --pic
export SDL_CONFIG=$(em-config CACHE)/sysroot/bin/sdl2-config
cflags: |
-sRELOCATABLE=1
-DSDL_NO_COMPAT
-DBUILD_STATIC
-ferror-limit=1
-sUSE_SDL=2
-sUSE_SDL_MIXER=2
-sSDL2_MIXER_FORMATS=mid,mod,mpg,ogg
-sUSE_SDL_TTF=2
-sUSE_SDL_IMAGE=2
-sSDL2_IMAGE_FORMATS=bmp,gif,jpg,png
-sUSE_SDL_GFX=2
-sUSE_FREETYPE=1
-sUSE_LIBJPEG=1
-sUSE_LIBPNG=1
-sUSE_GIFLIB=1
-sUSE_HARFBUZZ=1
-Wno-unreachable-code-fallthrough
ldflags: |
-sRELOCATABLE=1
-sUSE_SDL=2
-sUSE_SDL_MIXER=2
-sSDL2_MIXER_FORMATS=mid,mod,mpg,ogg
-sUSE_SDL_TTF=2
-sUSE_SDL_IMAGE=2
-sSDL2_IMAGE_FORMATS=bmp,gif,jpg,png
-sUSE_SDL_GFX=2
-sUSE_FREETYPE=1
-sUSE_LIBJPEG=1
-sUSE_LIBPNG=1
-sUSE_GIFLIB=1
-sUSE_HARFBUZZ=1
post: |
# Remove docs to reduce the size of a wheel
# (Perhaps also remove typeshed and examples too?)
rm -rf ./pygame/docs
# formats should be the same as the cibuildwheel config in pygame-ce
# https://github.com/pygame-community/pygame-ce/blob/e197e353fd33448abeed384dd4098e163c4998a5/pyproject.toml#L107

# WASM version of pygame uses a single module 'pygame_static',
# and pygame_static calls PyInit_* functions from other modules.
# This is okay when all these modules are bundled in a single module: libpython.
# But as we don't do that, we need to load these modules globally, so that
# pygame_static can see the symbols.
STATIC_OBJS=$(find ${PKG_BUILD_DIR} -name "*.o")
echo "build dir: " $PKG_BUILD_DIR
echo "static objs: " $STATIC_OBJS
# workaround to build wasm-exception-enabled port of sdl2_image (See: https://github.com/pygame-community/pygame-ce/pull/3588#issuecomment-3352072309)
touch dummy_src_for_port.c
emcc dummy_src_for_port.c -sSUPPORT_LONGJMP="wasm" -sRELOCATABLE=1 -fpic "--use-port=sdl2_image:formats=bmp,gif,jpg,lbm,pcx,png,pnm,qoi,svg,tga,xcf,xpm,xv"

SHARED_LIBS=$(find ${WHEELDIR} -name "*.so" ! -name "static*.so")
echo "shared libs: " $SHARED_LIBS

emcc \
-shared \
${SIDE_MODULE_LDFLAGS} \
-fPIC \
-lSDL2 \
-lSDL2_image-bmp-gif-jpg-png-wasm-sjlj \
-lSDL2_ttf \
-lSDL2_mixer_mid-mod-mpg-ogg \
-lSDL2_gfx \
-lfreetype-legacysjlj \
-lharfbuzz \
-lpng-legacysjlj \
-ljpeg \
-lgif \
-lvorbis \
-lmodplug \
-lmpg123 \
-logg \
-lhtml5 \
${STATIC_OBJS} \
${SHARED_LIBS} \
-sSUPPORT_LONGJMP=wasm \
-o pygame_static.so

# Remove duplicated static.so module
rm -f ./pygame/static*.so
embuilder --pic build sdl2 libhtml5 sdl2_ttf 'sdl2_mixer:formats=ogg,mp3,mod,mid'
about:
home: https://www.pygame.org
PyPI: https://pypi.org/project/pygame
home: https://pyga.me
PyPI: https://pypi.org/project/pygame-ce
summary: Python Game Development
license: LGPL-2.1

This file was deleted.

247 changes: 0 additions & 247 deletions packages/pygame-ce/patches/0001-freetype-init.patch

This file was deleted.

Loading
Loading