2025-10-17 19:24:20 +05:00
|
|
|
|
|
|
|
|
There are two ways to build pyodide ifcopenshell Python wrapper wheel.
|
|
|
|
|
|
|
|
|
|
1. Using pyodide build system (`build_pyodide.yml` does it):
|
|
|
|
|
|
2025-10-22 12:01:31 +05:00
|
|
|
- install prebuilt pyodide build and emscripten environment (see `build_pyodide.sh`)
|
|
|
|
|
- clone IfcOpenShell to `IfcOpenShell` folder
|
2025-10-17 19:24:20 +05:00
|
|
|
- create `packages/ifcopenshell` folder that will be used by pyodide build system
|
|
|
|
|
- from `IfcOpenShell` move building recipe `pyodide/meta.yaml` to `packages/ifcopenshell`
|
|
|
|
|
- run `pyodide build-recipes ifcopenshell --install`, it will
|
|
|
|
|
- execute `meta.yaml` recipe - it will:
|
|
|
|
|
- copy IfcOpenShell source to build folder `packages/ifcopenhell/build/ifcopenshell-0.8.0`
|
|
|
|
|
- build ifcopenshell and its dependencies
|
|
|
|
|
- note that rerunning `pyodide build-recipes` will remove previous build folder and rebuild all dependencies.
|
|
|
|
|
The way to avoid it, if build fails, is to use `pyodide build-recipes-no-deps ifcopenshell --continue` instead.
|
2025-10-20 11:45:49 +05:00
|
|
|
- run `setup.py` in `IfcOpenShell` root, producing a wheel in `IfcOpenShell/dist`
|
2025-10-17 19:24:20 +05:00
|
|
|
- copy that wheel to `packages/ifcopenshell/dist`
|
|
|
|
|
- `--install` it to current build envrionment
|
|
|
|
|
- copy the wheel next to `dist` folder (in root directory, next to `packages`)
|
|
|
|
|
- add wheel to `dist/pyodide-lock.json`
|
|
|
|
|
|
2025-10-22 12:01:31 +05:00
|
|
|
2. Build it outside of pyodide build system.
|
2025-10-17 19:24:20 +05:00
|
|
|
|
|
|
|
|
Building inside pyodide build system should be preferred, option to build it outside is useful for debugging purposes,
|
|
|
|
|
since it's pure cmake without any additional moving parts.
|
|
|
|
|
|
2025-10-22 12:01:31 +05:00
|
|
|
- setup pyodide environment, see above
|
2025-10-17 19:24:20 +05:00
|
|
|
- clone IfcOpenShell repo next to it to `IfcOpenShell` folder
|
|
|
|
|
- run `python nix/build-all.py -wasm -py-313` in `IfcOpenShell`
|
|
|
|
|
- it will produce Python package in `IfcOpenShell/ifcopenshell`
|
|
|
|
|
- run `pyodide build`
|
|
|
|
|
- it will produce a wheel in `IfcOpenShell/dist`
|