mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
build step for pyodide
This commit is contained in:
committed by
Dion Moult
parent
a5d9fe551a
commit
3ad7c52cc4
+40
-3
@@ -22,13 +22,47 @@ include ../common.mk
|
||||
NODE_ENV ?= production
|
||||
WEBAPP_DIR := webapp
|
||||
WEBAPP_BUILD_DIR := $(WEBAPP_DIR)/dist
|
||||
PYODIDE_DIR := $(WEBAPP_DIR)/public/pyodide
|
||||
PYODIDE_VERSION := 0.28.0
|
||||
PYODIDE_URL := https://github.com/pyodide/pyodide/releases/download/$(PYODIDE_VERSION)/pyodide-$(PYODIDE_VERSION).tar.bz2
|
||||
|
||||
.PHONY: webapp-dev
|
||||
webapp-dev:
|
||||
cd $(WEBAPP_DIR) && npm run dev
|
||||
|
||||
.PHONY: pyodide-download
|
||||
pyodide-download:
|
||||
@if [ -d "$(PYODIDE_DIR)" ]; then \
|
||||
echo "Pyodide directory already exists at $(PYODIDE_DIR), skipping download"; \
|
||||
else \
|
||||
echo "Downloading and preparing Pyodide $(PYODIDE_VERSION)..."; \
|
||||
mkdir -p $(PYODIDE_DIR); \
|
||||
curl -L -o /tmp/pyodide-$(PYODIDE_VERSION).tar.bz2 $(PYODIDE_URL); \
|
||||
cd /tmp && tar -xjf pyodide-$(PYODIDE_VERSION).tar.bz2; \
|
||||
cp /tmp/pyodide/pyodide.asm.js $(PYODIDE_DIR)/; \
|
||||
cp /tmp/pyodide/pyodide.asm.wasm $(PYODIDE_DIR)/; \
|
||||
cp /tmp/pyodide/pyodide.mjs $(PYODIDE_DIR)/; \
|
||||
cp /tmp/pyodide/pyodide.mjs.map $(PYODIDE_DIR)/; \
|
||||
cp /tmp/pyodide/python_stdlib.zip $(PYODIDE_DIR)/; \
|
||||
cp /tmp/pyodide/pyodide-lock.json $(PYODIDE_DIR)/; \
|
||||
cp /tmp/pyodide/certifi-*-py3-none-any.whl $(PYODIDE_DIR)/ 2>/dev/null || true; \
|
||||
cp /tmp/pyodide/charset_normalizer-*-py3-none-any.whl $(PYODIDE_DIR)/ 2>/dev/null || true; \
|
||||
cp /tmp/pyodide/idna-*-py3-none-any.whl $(PYODIDE_DIR)/ 2>/dev/null || true; \
|
||||
cp /tmp/pyodide/micropip-*-py3-none-any.whl $(PYODIDE_DIR)/ 2>/dev/null || true; \
|
||||
cp /tmp/pyodide/numpy-*-cp313-cp313-pyodide_2025_0_wasm32.whl $(PYODIDE_DIR)/ 2>/dev/null || true; \
|
||||
cp /tmp/pyodide/python_dateutil-*-py2.py3-none-any.whl $(PYODIDE_DIR)/ 2>/dev/null || true; \
|
||||
cp /tmp/pyodide/requests-*-py3-none-any.whl $(PYODIDE_DIR)/ 2>/dev/null || true; \
|
||||
cp /tmp/pyodide/shapely-*-cp313-cp313-pyodide_2025_0_wasm32.whl $(PYODIDE_DIR)/ 2>/dev/null || true; \
|
||||
cp /tmp/pyodide/six-*-py2.py3-none-any.whl $(PYODIDE_DIR)/ 2>/dev/null || true; \
|
||||
cp /tmp/pyodide/typing_extensions-*-py3-none-any.whl $(PYODIDE_DIR)/ 2>/dev/null || true; \
|
||||
cp /tmp/pyodide/urllib3-*-py3-none-any.whl $(PYODIDE_DIR)/ 2>/dev/null || true; \
|
||||
rm -rf /tmp/pyodide; \
|
||||
rm -f /tmp/pyodide-$(PYODIDE_VERSION).tar.bz2; \
|
||||
echo "Pyodide $(PYODIDE_VERSION) prepared in $(PYODIDE_DIR)"; \
|
||||
fi
|
||||
|
||||
.PHONY: webapp-build
|
||||
webapp-build:
|
||||
webapp-build: pyodide-download
|
||||
cd $(WEBAPP_DIR) && npm install
|
||||
cd $(WEBAPP_DIR) && npm run build
|
||||
|
||||
@@ -36,10 +70,13 @@ webapp-build:
|
||||
webapp-serve: webapp-build
|
||||
cd $(WEBAPP_DIR) && $(PYTHON) serve.py
|
||||
|
||||
.PHONY: webapp-clean
|
||||
webapp-clean:
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf $(WEBAPP_BUILD_DIR)
|
||||
rm -rf $(WEBAPP_DIR)/node_modules
|
||||
rm -rf $(PYODIDE_DIR)
|
||||
rm -rf $(PACKAGE_NAME)/webapp
|
||||
rm -rf dist
|
||||
|
||||
.PHONY: dist
|
||||
dist: webapp-prepare
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user