Skip to content

Commit

Permalink
bump sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
pmp-p committed Jan 17, 2024
1 parent d516a80 commit 4d768b2
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 42 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ jobs:
build:
runs-on: ubuntu-22.04
env:
SDK_VERSION: 3.1.52.0bi
SDK_VERSION: 3.1.52.2bi
SYS_PYTHON: /usr/bin/python3
PACKAGES: emsdk hpy _ctypes pygame
BUILD_STATIC: emsdk _ctypes hpy
STATIC: false
BUILDS: 3.11 3.12
BUILDS: 3.11 3.12 3.13
CYTHON: Cython-3.0.8-py2.py3-none-any.whl
LD_VENDOR: -sUSE_GLFW=3

Expand Down Expand Up @@ -40,33 +40,33 @@ jobs:
- name: build 3.11 packages
run: |
cd $GITHUB_WORKSPACE
PYBUILD=3.11 bash ./scripts/build-pkg.sh
PYBUILD=3.11 PACKAGES="emsdk hpy _ctypes pygame" BUILD_STATIC="emsdk _ctypes hpy" bash ./scripts/build-pkg.sh
- name: build 3.11 loader
run: |
cd $GITHUB_WORKSPACE
PYBUILD=3.11 bash ./scripts/build-loader.sh
PYBUILD=3.11 PACKAGES="emsdk hpy _ctypes pygame" BUILD_STATIC="emsdk _ctypes hpy" bash ./scripts/build-loader.sh
- name: build 3.12 packages
run: |
cd $GITHUB_WORKSPACE
PYBUILD=3.12 PACKAGES="emsdk hpy pygame" BUILD_STATIC="emsdk hpy" bash ./scripts/build-pkg.sh
PYBUILD=3.12 bash ./scripts/build-pkg.sh
- name: build 3.12 loader
run: |
cd $GITHUB_WORKSPACE
PYBUILD=3.12 PACKAGES="emsdk hpy pygame" BUILD_STATIC="emsdk hpy" bash ./scripts/build-loader.sh
PYBUILD=3.12 bash ./scripts/build-loader.sh
- name: build 3.13 packages
run: |
cd $GITHUB_WORKSPACE
PYBUILD=3.13 PACKAGES="emsdk hpy pygame" BUILD_STATIC="emsdk hpy" bash ./scripts/build-pkg.sh
PYBUILD=3.13 bash ./scripts/build-pkg.sh
- name: build 3.13 loader
run: |
cd $GITHUB_WORKSPACE
PYBUILD=3.13 PACKAGES="emsdk hpy pygame" BUILD_STATIC="emsdk hpy" bash ./scripts/build-loader.sh
PYBUILD=3.13 bash ./scripts/build-loader.sh
- name: build PkPy loader
run: |
Expand Down
17 changes: 0 additions & 17 deletions packages.d/pygame/pygame.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,6 @@ then
#unsure
wget -O- https://patch-diff.githubusercontent.com/raw/pmp-p/pygame-ce-wasm/pull/3.diff | patch -p1

patch -p1 << END
diff --git a/buildconfig/Setup.Emscripten.SDL2.in b/buildconfig/Setup.Emscripten.SDL2.in
index 0bd60a30..e74effe9 100644
--- a/buildconfig/Setup.Emscripten.SDL2.in
+++ b/buildconfig/Setup.Emscripten.SDL2.in
@@ -6,7 +6,8 @@
#MIXER = -lSDL2_mixer
#SCRAP =
#FREETYPE = -lfreetype -lharfbuzz
-
+PNG= -lpng
+JPEG= -ljpeg
DEBUG =
# these can build alone and object files merged with ar
END

patch -p1 << END
diff --git a/src_c/static.c b/src_c/static.c
index 03cc7c61..a00a51a7 100644
Expand Down
15 changes: 9 additions & 6 deletions src/pygbag/support/cpythonrc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1463,18 +1463,21 @@ def log(*argv, **kw):
# DO NOT ADD ANYTHING FROM HERE OR APP RECYCLING WILL TRASH IT

#

LOCK = False
try:
LOCK
except:
import builtins
builtins.LOCK = False


async def import_site(__file__, run=True):
global LOCK
if LOCK:
print("1728: import_site IS NOT RE ENTRANT")
import builtins
if builtins.LOCK:
platform.window.console.error("1473: import_site IS NOT RE ENTRANT")
return
builtins.LOCK = True

try:
LOCK = True
from pathlib import Path

embed = False
Expand Down
26 changes: 16 additions & 10 deletions static/mobile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,25 @@ import aio.fetch
#""")

import asyncio
import builtins
try:
re_entered
except:
builtins.re_entered = False

# do not rename, it has a special meaning for asyncio.run()
async def custom_site():
global app
await aio.fetch.preload(chdir=False, isolated=True)
sys.path.append('/tmp')

# TODO remove later
if re_entered:
platform.window.console.warn(" @@@@@@@@@@@@@@@@ ERROR @@@@@@@@@@@@@@ ")
return

builtins.re_entered = True
platform.window.console.warn(" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ")

import pygbag_app
import pygbag_ux as ux
Expand All @@ -64,7 +76,6 @@ async def custom_site():




console = app.console.get()

platform.document.body.style.background = "#555555"
Expand All @@ -75,7 +86,7 @@ async def custom_site():

# the C or js loader could do that but be explicit.
appdir = Path(f"/data/data/{bundle}") # /data/data/{{cookiecutter.archive}}
appdir.mkdir()
appdir.mkdir() #parents=True, exist_ok=True)


# mount apk
Expand Down Expand Up @@ -178,17 +189,16 @@ async def custom_site():
while not platform.window.MM.UME:
await asyncio.sleep(.1)


# unlock async for main.py loop ( 2nd asyncio.run call )
embed.run()




loop = asyncio.get_event_loop()


# mypyc/hpy require modules.
print("mobile.tmpl: running main ( as a __main__ module")
print("mobile.tmpl: running 'main' as a module", __name__, __file__, os.getcwd(), sys.modules.get('main','ok'))

# get symbols of "main" for REPL "__main__"
import main
Expand Down Expand Up @@ -309,7 +319,7 @@ async def custom_site():
aio.exit_now(0)



platform.window.console.warn(" ************************************** ")
asyncio.run( custom_site() )


Expand All @@ -319,10 +329,6 @@ asyncio.run( custom_site() )







# BEGIN BLOCK
#
# now this is the html part you can (and should) customize
Expand Down
2 changes: 1 addition & 1 deletion static/pythons.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ const vm = {
async function run_pyrc(content) {
const base = "/data/data/org.python/assets/"
const pyrc_file = base + "pythonrc.py"
const main_file = base + "main.py"
const main_file = base + "__main__.py"
vm.FS.writeFile(pyrc_file, content )

// embedded canvas
Expand Down

0 comments on commit 4d768b2

Please sign in to comment.