-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
config
168 lines (124 loc) · 4.29 KB
/
config
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
#!/bin/bash
if [[ -z ${CONFIG_ENV+z} ]]
then
export CONFIG_ENV=true
export LC_ALL=C
export ROOT=${ROOT:-$(pwd)}
export SDKROOT=${SDKROOT:-$ROOT}
export PYTHONDONTWRITEBYTECODE=1
export REBUILD=${REBUILD:-false}
export CI=${CI:-false}
export PYBUILD=${PYBUILD:-3.12}
export PYMAJOR=$(echo -n $PYBUILD|cut -d. -f1)
export PYMINOR=$(echo -n $PYBUILD|cut -d. -f2)
export HOST_PREFIX=${HOST_PREFIX:-${SDKROOT}/devices/$(arch)/usr}
export PREFIX=${PREFIX:-${SDKROOT}/devices/emsdk/usr}
mkdir -p ${SDKROOT}/build/pycache ${SDKROOT}/build/cache
export PYTHONPYCACHEPREFIX=${PYTHONPYCACHEPREFIX:-$(realpath ${SDKROOT}/build/pycache)}
export WHEELS=/data/git/archives/repo
export HOME=$(realpath ${SDKROOT})
export XDG_DATA_HOME=${HOME}/build/share
export XDG_CACHE_HOME=${HOME}/build/cache
export XDG_CONFIG_HOME=${HOME}/build/config
export XDG_DATA_DIRS=${HOME}/build/share
mkdir -p $XDG_DATA_HOME $XDG_CACHE_HOME $XDG_CONFIG_HOME
export PIP_ROOT_USER_ACTION=ignore
export PIP_NO_CACHE_DIR=1
export HPY=${HOST_PREFIX}/bin/python${PYBUILD}
export HPIP="${HPY} -mpip"
# base wasm features pure is "mvp" , "bi" is bigint
if [ -f /mvp ]
then
export WASM_FLAVOUR=mvp
export WASM_EXTRA="-sMIN_SAFARI_VERSION=120000"
export WASM_PURE=true
else
export WASM_FLAVOUR=bi
# extra features. Safari 140100 is expected to have BIGINT ? emsdk warnings ?
export WASM_EXTRA="-sWASM_BIGINT -sMIN_SAFARI_VERSION=150000"
# tell to not normalize modules.
export WASM_PURE=false
fi
EXTRABINS="/usr/local/bin /opt/bin"
# ============ emscripten ==============
# stable==latest dev==tot
export EMFLAVOUR=${EMFLAVOUR:latest}
export EMSDK_QUIET=1
export EMSDK_NOTTY=0
export EMSDK_VERBOSE=0
#temp fix for oom on CI (Error: Process completed with exit code 143.)
export EMSDK_NUM_CORES=1
# for shared modules
export PYDK_PYTHON_HOST_PLATFORM=wasm32-${WASM_FLAVOUR}-emscripten
export PYDK_SYSCONFIG_PLATFORM=$(echo -n $PYDK_PYTHON_HOST_PLATFORM|cut -d- -f1)-$(echo -n $PYDK_PYTHON_HOST_PLATFORM|cut -d- -f3)
# ============== wasi sdk ===============
# stable
export WASI_SDK=${WASI_SDK:-24.0}
export WASI_SDK_MAJOR=$(echo ${WASI_SDK}|cut -d. -f1)
export WASI_SDK_MINOR=$(echo ${WASI_SDK}|cut -d. -f2)
export WASI_URL=https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_MAJOR}/wasi-sdk-${WASI_SDK}-$(arch)-linux.tar.gz
export WASISDK="${SDKROOT}/wasisdk"
export WASMTIME_HOME=$WASISDK
# EXTRABINS="$EXTRABINS $WASISDK/bin"
# =============== Nimrod ====================
# stable
NIM_VERSION=nim-2.0.8
# testing
NIM_VERSION=nim-2.2.0
NIM_URL=https://nim-lang.org/download/${NIM_VERSION}-linux_x64.tar.xz
NIM_VERSION=nim-git
NIM_URL=https://github.com/nim-lang/Nim
export NIM_VERSION NIM_URL
export NIMSDK=${NIMSDK:-"${SDKROOT}/nimsdk"}
# EXTRABINS="$EXTRABINS $NIMSDK/bin"
# =============== rust ====================
export CARGO_HOME=${CARGO_HOME:-${SDKROOT}}/rust
export RUSTUP_HOME=${RUSTUP_HOME:-${SDKROOT}}/rust
mkdir -p ${CARGO_HOME}/bin
EXTRABINS="$EXTRABINS $CARGO_HOME/bin"
# ================ go =====================
export GOPRIVATE=*
export GONOPROXY=*
export GONOSUMDB=*
export GOMODCACHE=$XDG_CACHE_HOME
export GOPATH=$SDKROOT/go
export GOROOT=$SDKROOT/go
EXTRABINS="$EXTRABINS $GOROOT/bin"
# ============== wasmer =================
# curl https://get.wasmer.io -sSfL | sh
export WASMER_DIR==/opt/python-wasm-sdk/wasmer
# ================ bun ====================
export BUN_INSTALL=${SDKROOT}/bun
EXTRABINS="$EXTRABINS $BUN_INSTALL/bin"
# ================ aosp ===================
AOSP_NDK=25.2.9519653
# =========== panda3d =================
export PANDA_PRC_DIR=${SDKROOT}/support
PATH=/usr/bin:/bin
for extrabin in $EXTRABINS
do
if echo $PATH|grep -q ":$extrabin"
then
continue
fi
if [ -d $extrabin ]
then
PATH=$extrabin:$PATH
fi
done
export SYS_NODE=$(echo -n $SDKROOT/emsdk/node/??.??.*/bin/node)
# this is python used for emsdk : ${SYS_PYTHON} -> ${EMSDK_PYTHON}
# sane default
export SYS_PYTHON=python${PYMAJOR}
for py in 10 9 8
do
if command -v python${PYMAJOR}.${py} >/dev/null
then
export SYS_PYTHON=$(command -v python${PYMAJOR}.${py})
break
fi
done
export CLONE="git clone --recursive --no-tags --depth 1 --single-branch --branch"
export LD_LIBRARY_PATH="${HOST_PREFIX}/lib:$LD_LIBRARY_PATH"
export PATH="${HOST_PREFIX}/bin:$PATH"
fi