karnel-termux 4.9.2 → 4.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/karnel/tools/lang/bun/install.sh +37 -27
- package/karnel/utils/env.sh +1 -1
- package/package.json +1 -1
|
@@ -56,7 +56,7 @@ _bun_install_deps_native_impl() {
|
|
|
56
56
|
fi
|
|
57
57
|
fi
|
|
58
58
|
declare -A DEPS=(
|
|
59
|
-
["clang"]="clang"
|
|
59
|
+
["clang"]="clang-21"
|
|
60
60
|
["unzip"]="unzip"
|
|
61
61
|
["curl"]="curl"
|
|
62
62
|
)
|
|
@@ -122,32 +122,42 @@ _compile_bun_helper() {
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
_compile_bun_helper_impl() {
|
|
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
|
-
|
|
125
|
+
local CC
|
|
126
|
+
if command -v clang-21 &>/dev/null; then
|
|
127
|
+
CC="clang-21"
|
|
128
|
+
elif command -v clang &>/dev/null; then
|
|
129
|
+
CC="clang"
|
|
130
|
+
else
|
|
131
|
+
log_error "C compiler not found (install clang package)"
|
|
132
|
+
return 1
|
|
133
|
+
fi
|
|
134
|
+
|
|
135
|
+
local shim_src="$KARNEL_PATH/tools/lang/bun/src/bun-shim.c"
|
|
136
|
+
local wrapper_src="$KARNEL_PATH/tools/lang/bun/src/bun_wrapper.c"
|
|
137
|
+
if [ ! -f "$shim_src" ]; then
|
|
138
|
+
log_error "Shim source not found at $shim_src"
|
|
139
|
+
return 1
|
|
140
|
+
fi
|
|
141
|
+
if [ ! -f "$wrapper_src" ]; then
|
|
142
|
+
log_error "Wrapper source not found at $wrapper_src"
|
|
143
|
+
return 1
|
|
144
|
+
fi
|
|
145
|
+
mkdir -p "$PREFIX/lib"
|
|
146
|
+
if ! $CC -O2 -fPIC -shared -nostdlib -o "$PREFIX/lib/bun-shim.so" "$shim_src" &>>"$LOG_FILE"; then
|
|
147
|
+
log_error "Failed to compile bun shim"
|
|
148
|
+
return 1
|
|
149
|
+
fi
|
|
150
|
+
chmod +x "$PREFIX/lib/bun-shim.so"
|
|
151
|
+
local wrapper_tmp="$TMPDIR/bun_wrapper_$$.c"
|
|
152
|
+
sed "s|__BUN_REAL__|$BUN_DATA_DIR/bun.real|g" "$wrapper_src" >"$wrapper_tmp"
|
|
153
|
+
if ! $CC -O2 -o "$PREFIX/bin/bun" "$wrapper_tmp" &>>"$LOG_FILE"; then
|
|
154
|
+
rm -f "$wrapper_tmp"
|
|
155
|
+
log_error "Failed to compile bun wrapper"
|
|
156
|
+
return 1
|
|
157
|
+
fi
|
|
158
|
+
chmod +x "$PREFIX/bin/bun"
|
|
159
|
+
rm -f "$wrapper_tmp"
|
|
160
|
+
return 0
|
|
151
161
|
}
|
|
152
162
|
|
|
153
163
|
_install_bun_native() {
|
package/karnel/utils/env.sh
CHANGED
package/package.json
CHANGED