2024-01-23 00:32:09 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Do not keep running on errors
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
# from https://pyodide.org/en/stable/development/building-from-sources.html#using-make:
|
|
|
|
# - build-essential
|
|
|
|
# we install pkg-config with apt because it is commented out in environment.yml
|
|
|
|
sudo apt-get update && sudo apt-get install --yes build-essential pkg-config
|
|
|
|
|
|
|
|
conda env create -n pyodide-env -f environment.yml
|
|
|
|
conda init bash
|
|
|
|
echo "conda activate pyodide-env" >> ~/.bashrc
|
|
|
|
|
|
|
|
# conda run -n pyodide-env make -C emsdk clean
|
|
|
|
# conda run -n pyodide-env make -C cpython clean
|
|
|
|
|
|
|
|
# https://pyodide.org/en/stable/development/building-from-sources.html#using-docker
|
|
|
|
export EMSDK_NUM_CORE=12 EMCC_CORES=12 PYODIDE_JOBS=12
|
|
|
|
echo "export EMSDK_NUM_CORE=12 EMCC_CORES=12 PYODIDE_JOBS=12" >> ~/.bashrc
|
2024-01-27 02:02:22 +00:00
|
|
|
|
|
|
|
export PYODIDE_RECIPE_BUILD_DIR=/tmp/pyodide-build
|
|
|
|
mkdir -p "$PYODIDE_RECIPE_BUILD_DIR"
|
|
|
|
echo "export PYODIDE_RECIPE_BUILD_DIR=$PYODIDE_RECIPE_BUILD_DIR" >> ~/.bashrc
|
|
|
|
ln -sf "$PYODIDE_RECIPE_BUILD_DIR" packages/.build || echo "Note: Could not create convenience symlink packages/.build"
|
2024-01-23 00:32:09 +00:00
|
|
|
|
|
|
|
conda run -n pyodide-env --live-stream pip install -r requirements.txt
|
|
|
|
|
|
|
|
# https://pyodide.org/en/stable/development/new-packages.html#prerequisites
|
|
|
|
conda run -n pyodide-env --live-stream pip install -e ./pyodide-build
|
|
|
|
|
|
|
|
# Building emsdk and cpython takes a few minutes to run, so we do not run it here.
|
|
|
|
#
|
|
|
|
# conda run -n pyodide-env --live-stream make -C emsdk
|
|
|
|
# conda run -n pyodide-env --live-stream make -C cpython
|