karnel-termux 4.9.1 → 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.
@@ -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
- local shim_src="$KARNEL_PATH/tools/lang/bun/src/bun-shim.c"
126
- local wrapper_src="$KARNEL_PATH/tools/lang/bun/src/bun_wrapper.c"
127
- if [ ! -f "$shim_src" ]; then
128
- log_error "Shim source not found at $shim_src"
129
- return 1
130
- fi
131
- if [ ! -f "$wrapper_src" ]; then
132
- log_error "Wrapper source not found at $wrapper_src"
133
- return 1
134
- fi
135
- mkdir -p "$PREFIX/lib"
136
- if ! clang -O2 -fPIC -shared -nostdlib -o "$PREFIX/lib/bun-shim.so" "$shim_src" &>>"$LOG_FILE"; then
137
- log_error "Failed to compile bun shim"
138
- return 1
139
- fi
140
- chmod +x "$PREFIX/lib/bun-shim.so"
141
- local wrapper_tmp="$TMPDIR/bun_wrapper_$$.c"
142
- sed "s|__BUN_REAL__|$BUN_DATA_DIR/bun.real|g" "$wrapper_src" >"$wrapper_tmp"
143
- if ! clang -O2 -o "$PREFIX/bin/bun" "$wrapper_tmp" &>>"$LOG_FILE"; then
144
- rm -f "$wrapper_tmp"
145
- log_error "Failed to compile bun wrapper"
146
- return 1
147
- fi
148
- chmod +x "$PREFIX/bin/bun"
149
- rm -f "$wrapper_tmp"
150
- return 0
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() {
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- KARNEL_VERSION="4.9.1"
3
+ KARNEL_VERSION="4.9.3"
4
4
 
5
5
  # -------------------------
6
6
  # Directorios del usuario
@@ -556,6 +556,7 @@ progress_start() {
556
556
  local total=$1
557
557
  local message="${2:-Progress}"
558
558
  _progress_current=0
559
+ _progress_filled=0
559
560
  _progress_total=$total
560
561
  _progress_width=50
561
562
  printf " ${D_CYAN}%s${D_NC}" "$message"
@@ -572,15 +573,22 @@ progress_update() {
572
573
  local current=$1
573
574
  local total=$2
574
575
  local width="${_progress_width:-50}"
575
- local percentage=$((current * 100 / total))
576
- local filled=$((current * width / total))
577
- local empty=$((width - filled))
578
-
579
- local bar=""
580
- for ((i = 0; i < filled; i++)); do bar+="█"; done
581
- for ((i = 0; i < empty; i++)); do bar+="░"; done
576
+ local target_filled=$((current * width / total))
577
+
578
+ local prev="${_progress_filled:-0}"
579
+ [[ "$target_filled" -lt "$prev" ]] && prev=0
580
+
581
+ local anim i j bar pct
582
+ for ((i = prev + 1; i <= target_filled; i++)); do
583
+ bar=""
584
+ for ((j = 0; j < i; j++)); do bar="${bar}█"; done
585
+ for ((j = i; j < width; j++)); do bar="${bar}░"; done
586
+ pct=$((i * 100 / width))
587
+ printf "\r ${D_CYAN}[${D_NC}${D_GREEN}%s${D_NC}${D_CYAN}]${D_NC} %3d%%" "$bar" "$pct"
588
+ sleep 0.003 2>/dev/null || true
589
+ done
582
590
 
583
- printf "\r ${D_CYAN}[${D_NC}${D_GREEN}%s${D_NC}${D_CYAN}]${D_NC} %3d%%" "$bar" "$percentage"
591
+ _progress_filled="$target_filled"
584
592
  }
585
593
 
586
594
  progress_done() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "karnel-termux",
3
- "version": "4.9.1",
3
+ "version": "4.9.3",
4
4
  "description": "Modular Dev Environment for Termux — install languages, databases, AI agents, editors, and more with one command",
5
5
  "bin": {
6
6
  "karnel": "karnel/bin/karnel"