2025-10-20 11:40:45 +05:00
|
|
|
#!/usr/bin/bash
|
2025-10-22 12:01:31 +05:00
|
|
|
set -ex
|
|
|
|
|
|
2026-04-25 11:13:48 +02:00
|
|
|
PYODIDE_VERSION=0.29.3
|
|
|
|
|
PYODIDE_BUILD_VERSION=0.33.0
|
2026-04-25 11:34:31 +02:00
|
|
|
PYODIDE_XBUILDENV_ROOT="${HOME}/.cache/.pyodide-xbuildenv-${PYODIDE_BUILD_VERSION}"
|
|
|
|
|
PYODIDE_XBUILDENV="${PYODIDE_XBUILDENV_ROOT}/${PYODIDE_VERSION}"
|
2026-04-25 11:13:48 +02:00
|
|
|
|
2026-02-19 15:51:01 +05:00
|
|
|
# Script is assuming that it will be possible to execute it multiple times
|
|
|
|
|
# therefore we're clearing venv each time and ignoring existing 'emsdk' folder.
|
|
|
|
|
|
2025-10-22 12:01:31 +05:00
|
|
|
# Install uv.
|
|
|
|
|
curl -LsSf https://astral.sh/uv/install.sh | sh
|
2026-02-19 15:51:01 +05:00
|
|
|
uv venv --python 3.13 --clear
|
2025-10-22 12:01:31 +05:00
|
|
|
source .venv/bin/activate
|
|
|
|
|
|
|
|
|
|
# Install pyodide cross build environment.
|
|
|
|
|
# Instructions: https://pyodide.org/en/stable/development/building-packages.html
|
2026-04-25 11:13:48 +02:00
|
|
|
uv pip install "pyodide-build==${PYODIDE_BUILD_VERSION}"
|
2025-10-22 12:01:31 +05:00
|
|
|
# `uv run` is required, so xbuildenv would skip using `pip`.
|
2026-04-25 11:13:48 +02:00
|
|
|
uv run pyodide xbuildenv install "${PYODIDE_VERSION}"
|
2026-04-03 12:37:53 +05:00
|
|
|
uv run pyodide xbuildenv install-emscripten
|
2025-10-22 12:01:31 +05:00
|
|
|
|
2026-04-25 11:34:31 +02:00
|
|
|
EMSDK_ROOT="${PYODIDE_XBUILDENV}/emsdk"
|
2026-04-24 14:28:45 +02:00
|
|
|
[ -f "${EMSDK_ROOT}/emsdk_env.sh" ] && source "${EMSDK_ROOT}/emsdk_env.sh"
|
|
|
|
|
[ -f "${EMSDK_ROOT}/../../emsdk_env.sh" ] && source "${EMSDK_ROOT}/../../emsdk_env.sh"
|
2025-10-22 12:01:31 +05:00
|
|
|
which emcc
|
2026-04-25 11:34:31 +02:00
|
|
|
emcc --version
|
2025-10-22 12:01:31 +05:00
|
|
|
|
2025-10-20 11:40:45 +05:00
|
|
|
mkdir -p packages/ifcopenshell
|
2025-10-22 12:01:31 +05:00
|
|
|
VERSION=`cat IfcOpenShell/VERSION`
|
2025-10-20 11:40:45 +05:00
|
|
|
cp IfcOpenShell/pyodide/meta.yaml packages/ifcopenshell
|
2025-10-22 12:01:31 +05:00
|
|
|
sed -i s/0.8.0/$VERSION/g packages/ifcopenshell/meta.yaml
|
|
|
|
|
|
2025-10-21 12:42:56 +05:00
|
|
|
# Use custom build ifcopenshell directory in build-all to make caching simpler
|
|
|
|
|
# Otherwise pyodide build path typically includes package version, so cached cmake configs might break.
|
2025-10-22 12:01:31 +05:00
|
|
|
export BUILD_DIR=`readlink -f ifcopenshell_build`
|
|
|
|
|
|
2026-04-25 14:34:33 +02:00
|
|
|
# Sat, 25 Apr 2026 12:11:39 GMT 2026-04-25 12:11:39,173 - DEBUG - running
|
|
|
|
|
# command `make -j5 ifcopenshell_wrapper VERBOSE=1` in directory
|
|
|
|
|
# '/home/runner/work/IfcOpenShell/IfcOpenShell/ifcopenshell_build/Linux/wasm/build/ifcopenshell/build'
|
|
|
|
|
# Sat, 25 Apr 2026 12:18:01 GMT Error: Process completed with exit code 143.
|
|
|
|
|
export IFCOS_NUM_BUILD_PROCS=1
|
|
|
|
|
|
2025-10-21 17:34:06 +05:00
|
|
|
# Use build-recipes-no-deps first, so logs would be printed to stdout.
|
|
|
|
|
pyodide build-recipes-no-deps ifcopenshell
|
2025-10-20 11:40:45 +05:00
|
|
|
pyodide build-recipes ifcopenshell --install
|