Skip to content

Commit

Permalink
fix pygame.freetype
Browse files Browse the repository at this point in the history
  • Loading branch information
pmp-p committed Sep 29, 2024
1 parent 567f9ff commit 0504945
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 21 deletions.
30 changes: 15 additions & 15 deletions packages.d/pygame/pygame.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ then
# to upstream after tests
# done wget -O- https://patch-diff.githubusercontent.com/raw/pmp-p/pygame-ce-wasm/pull/7.diff | patch -p1

#unsure
wget -O- https://patch-diff.githubusercontent.com/raw/pmp-p/pygame-ce-wasm/pull/3.diff | patch -p1
# unsure : wasm pygame.freetype hack
#wget -O- https://patch-diff.githubusercontent.com/raw/pmp-p/pygame-ce-wasm/pull/3.diff | patch -p1
wget -O- https://patch-diff.githubusercontent.com/raw/pygame-community/pygame-ce/pull/1967.diff | patch -p1

# new cython (git)
wget -O- https://patch-diff.githubusercontent.com/raw/pmp-p/pygame-ce-wasm/pull/8.diff | patch -p1
Expand Down Expand Up @@ -267,9 +268,11 @@ SDL2="-sUSE_ZLIB=1 -sUSE_BZIP2=1 -sUSE_LIBPNG -sUSE_SDL=2 -sUSE_SDL_MIXER=2 -lSD
SDL2="$SDL2 -lssl -lcrypto -lffi -lbz2 -lz -ldl -lm"


if [ -d testing/pygame_static-1.0-cp${TAG}-cp${TAG}-wasm32_mvp_emscripten ]
TARGET_FOLDER=$(pwd)/testing/pygame_static-1.0-cp${TAG}-cp${TAG}-wasm32_${WASM_FLAVOUR}_emscripten

if [ -d ${TARGET_FOLDER} ]
then
TARGET_FOLDER=$(pwd)/testing/pygame_static-1.0-cp${TAG}-cp${TAG}-wasm32_${WASM_FLAVOUR}_emscripten

TARGET_FILE=${TARGET_FOLDER}/pygame_static.cpython-${TAG}-wasm32-emscripten.so

. ${SDKROOT}/emsdk/emsdk_env.sh
Expand All @@ -279,29 +282,26 @@ then
emcc -shared -Os -g0 -fpic -o ${TARGET_FILE} $SDKROOT/prebuilt/emsdk/libpygame${PYMAJOR}.${PYMINOR}.a $SDL2

# github CI does not build wheel for now.
if [ -d /data/git/archives/repo/cp${TAG} ]
echo ${WHEEL_DIR}
if [ -d ${WHEEL_DIR} ]
then
mkdir -p $TARGET_FOLDER
/bin/cp -rf testing/pygame_static-1.0-cp${TAG}-cp${TAG}-wasm32_mvp_emscripten/. ${TARGET_FOLDER}/

if pushd testing/pygame_static-1.0-cp${TAG}-cp${TAG}-wasm32_${WASM_FLAVOUR}_emscripten
then
rm ${TARGET_FILE}.map
if $WASM_PURE
then
/data/git/archives/repo/norm.sh
else
whl=/data/git/archives/repo/cp${TAG}/$(basename $(pwd)).whl
[ -f $whl ] && rm $whl
zip $whl -r .
fi
WHEEL_PATH=${WHEEL_DIR}/$(basename $(pwd)).whl
[ -f $WHEEL_PATH ] && rm $WHEEL_PATH
zip $WHEEL_PATH -r .
rm ${TARGET_FILE}
popd
fi
else
echo " =========== no wheel build from ${TARGET_FOLDER} ==========="
fi
fi


fi



Expand Down
13 changes: 11 additions & 2 deletions scripts/build-pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ then
echo " vendor build"
if ${ABI3:-false}
then
echo " vendor build (abi3) $PYBUILD"
if echo $PYBUILD|grep -v -q 3.12$
echo " vendor build (abi3) $PYBUILD"
if echo $PYBUILD|grep -v -q 3.13$
then
echo "abi3 vendor build only, skipping $PYBUILD"
exit 0
Expand All @@ -18,6 +18,7 @@ fi

export PYMAJOR=$(echo -n $PYBUILD|cut -d. -f1)
export PYMINOR=$(echo -n $PYBUILD|cut -d. -f2)
export PYGBAG_VERSION=$(PYTHONPATH=${WORKSPACE}/src $SYS_PYTHON -c "print(__import__('pygbag').VERSION)")

. /etc/lsb-release

Expand Down Expand Up @@ -215,6 +216,14 @@ END

export pkg

# TODO: get wheel file from script and move it to the right place

export TAG=${PYMAJOR}${PYMINOR}
export WHEEL_DIR_PURE=/data/git/archives/repo/pkg
export WHEEL_DIR_ABI3=/data/git/archives/repo/${PYGBAG_VERSION}
export WHEEL_DIR=/data/git/archives/repo/cp${TAG}-${PYGBAG_VERSION}


if ./${PKG_PATH}.sh
then

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pygame_static.cpython-311-wasm32-emscripten.so,sha256=VI2P91vjs-8NVN9iR_jXRa5YV086EScXY9QByO50YnU,1534170
pygame_static-1.0.dist-info/METADATA,sha256=KMH0iQMqmadqsTWPuUIh-AYrXYErS8IwkF8q_-ctibE,56
pygame_static-1.0.dist-info/WHEEL,sha256=dTMH2xpSTRj2z-1P9CdDjF2zDTgehuqUnpMNL4sk9FE,112
pygame_static-1.0.dist-info/top_level.txt,sha256=6yKokpjdGqAeyv-X-5j3BuYYbVWpgcDQRNHCI5BxWDM,14
pygame_static.cpython-311-wasm32-emscripten.so,,
pygame_static-1.0.dist-info/METADATA,,
pygame_static-1.0.dist-info/WHEEL,,
pygame_static-1.0.dist-info/top_level.txt,,
pygame_static-1.0.dist-info/PKG-INFO,,
pygame_static-1.0.dist-info/RECORD,,

0 comments on commit 0504945

Please sign in to comment.