-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·43 lines (34 loc) · 1.19 KB
/
build.sh
File metadata and controls
executable file
·43 lines (34 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
set -e
# Check if Python 3.12 is installed
if ! command -v python3.12 &> /dev/null; then
echo "Error: Python 3.12 is required but not installed."
exit 1
fi
# Create Python virtual environment
if [ ! -d ".venv" ]; then
echo "Creating Python virtual environment (.venv)..."
python3.12 -m venv .venv
else
echo "Using existing Python virtual environment (.venv)..."
fi
# Create pyodide virtual environment if it doesn't exist
if [ ! -d ".venv-pyodide" ]; then
# Activate the Python virtual environment
echo "Activating Python virtual environment..."
source .venv/bin/activate
# Install pyodide-build in the Python venv
echo "Installing pyodide-build..."
pip install pyodide-build
echo "Creating pyodide virtual environment (.venv-pyodide)..."
pyodide venv .venv-pyodide
# Deactivate the virtual environment
echo "Deactivating Python virtual environment..."
deactivate
else
echo "Using existing pyodide virtual environment (.venv-pyodide)..."
fi
# Download vendored packages
echo "Installing vendored packages from vendor.txt..."
.venv-pyodide/bin/pip install -t src/vendor -r vendor.txt
echo "Build completed successfully!"