mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-12 11:24:04 +02:00
Add serve-wasm.py to the emscripten bundle
This commit is contained in:
3
.github/build.sh
vendored
3
.github/build.sh
vendored
@@ -521,7 +521,8 @@ if [[ $BSH_HOST_PLATFORM == darwin ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
elif [[ $PACKAGE_MODE == emscripten ]]; then
|
elif [[ $PACKAGE_MODE == emscripten ]]; then
|
||||||
tar cvf $ASSET_PATH $APP_EXE.js $APP_EXE.wasm
|
cp resources/serve-wasm.py .
|
||||||
|
tar cvf $ASSET_PATH $APP_EXE.js $APP_EXE.wasm serve-wasm.py
|
||||||
elif [[ $PACKAGE_MODE == appimage ]]; then
|
elif [[ $PACKAGE_MODE == appimage ]]; then
|
||||||
# so far this can only happen with $BSH_HOST_PLATFORM-$BSH_HOST_LIBC == linux-gnu, but this may change later
|
# so far this can only happen with $BSH_HOST_PLATFORM-$BSH_HOST_LIBC == linux-gnu, but this may change later
|
||||||
case $BSH_HOST_ARCH in
|
case $BSH_HOST_ARCH in
|
||||||
|
15
resources/serve-wasm.template.py
Normal file → Executable file
15
resources/serve-wasm.template.py
Normal file → Executable file
@@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
from OpenSSL import crypto
|
from OpenSSL import crypto
|
||||||
import http.server
|
import http.server
|
||||||
import json
|
import json
|
||||||
@@ -7,12 +9,13 @@ import ssl
|
|||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
(
|
if len(sys.argv) >= 2:
|
||||||
script,
|
# chdir if invoked through meson; assume that we're in the correct dir already otherwise
|
||||||
build_root,
|
(
|
||||||
) = sys.argv
|
script,
|
||||||
|
build_root,
|
||||||
os.chdir(build_root)
|
) = sys.argv
|
||||||
|
os.chdir(build_root)
|
||||||
|
|
||||||
HTTP_HOST = '127.0.0.1'
|
HTTP_HOST = '127.0.0.1'
|
||||||
HTTP_PORT = 8000
|
HTTP_PORT = 8000
|
||||||
|
Reference in New Issue
Block a user