karnel-termux 0.0.1 → 0.0.2
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/README.md +1 -1
- package/karnel/tools/ai/antigravity-cli/install.sh +4 -2
- package/karnel/tools/ai/claude-code/install.sh +7 -6
- package/karnel/tools/ai/cline/install.sh +2 -6
- package/karnel/tools/ai/codegraph/install.sh +9 -9
- package/karnel/tools/ai/codex/install.sh +2 -7
- package/karnel/tools/ai/command-code/install.sh +2 -12
- package/karnel/tools/ai/crush/install.sh +4 -5
- package/karnel/tools/ai/ctx7/install.sh +5 -5
- package/karnel/tools/ai/engram/install.sh +2 -7
- package/karnel/tools/ai/freebuff/install.sh +4 -2
- package/karnel/tools/ai/gemini-cli/install.sh +2 -7
- package/karnel/tools/ai/gentle-ai/install.sh +4 -4
- package/karnel/tools/ai/gga/install.sh +7 -7
- package/karnel/tools/ai/hermes-agent/install.sh +2 -5
- package/karnel/tools/ai/kilocode-cli/install.sh +2 -9
- package/karnel/tools/ai/kimchi-code/bin/kimchi +27 -0
- package/karnel/tools/ai/kimchi-code/helper/kimchi_helper.c +47 -0
- package/karnel/tools/ai/kimchi-code/install.sh +4 -3
- package/karnel/tools/ai/kimi-code/install.sh +2 -12
- package/karnel/tools/ai/kiro/install.sh +4 -5
- package/karnel/tools/ai/mimocode/install.sh +4 -3
- package/karnel/tools/ai/minimax-cli/install.sh +2 -12
- package/karnel/tools/ai/mistral-vibe/install.sh +2 -7
- package/karnel/tools/ai/odysseus/install.sh +5 -3
- package/karnel/tools/ai/ollama/install.sh +2 -7
- package/karnel/tools/ai/omni-route/install.sh +5 -4
- package/karnel/tools/ai/openclaude/install.sh +2 -7
- package/karnel/tools/ai/openclaw/install.sh +2 -7
- package/karnel/tools/ai/opencode/install.sh +9 -8
- package/karnel/tools/ai/openspec/install.sh +5 -5
- package/karnel/tools/ai/pi/install.sh +2 -7
- package/karnel/tools/ai/qwen-code/install.sh +2 -7
- package/karnel/tools/auto/n8n/install.sh +2 -2
- package/karnel/tools/db/all.sh +0 -2
- package/karnel/tools/db/mariadb/install.sh +2 -2
- package/karnel/tools/db/mongodb/install.sh +2 -2
- package/karnel/tools/db/postgresql/install.sh +2 -2
- package/karnel/tools/db/redis/install.sh +0 -1
- package/karnel/tools/db/sqlite/install.sh +2 -2
- package/karnel/tools/deploy/netlify/install.sh +6 -2
- package/karnel/tools/deploy/railway/install.sh +5 -6
- package/karnel/tools/deploy/vercel/install.sh +6 -2
- package/karnel/tools/dev/bat/install.sh +2 -6
- package/karnel/tools/dev/bc/install.sh +2 -6
- package/karnel/tools/dev/cloudflared/install.sh +2 -6
- package/karnel/tools/dev/curl/install.sh +2 -6
- package/karnel/tools/dev/fzf/install.sh +2 -6
- package/karnel/tools/dev/gh/install.sh +2 -6
- package/karnel/tools/dev/html2text/install.sh +2 -6
- package/karnel/tools/dev/imagemagick/install.sh +2 -6
- package/karnel/tools/dev/jq/install.sh +2 -6
- package/karnel/tools/dev/lsd/install.sh +2 -6
- package/karnel/tools/dev/make/install.sh +2 -6
- package/karnel/tools/dev/ncurses/install.sh +2 -6
- package/karnel/tools/dev/proot/install.sh +2 -6
- package/karnel/tools/dev/shfmt/install.sh +2 -6
- package/karnel/tools/dev/tmate/install.sh +2 -6
- package/karnel/tools/dev/translate/install.sh +2 -6
- package/karnel/tools/dev/tree/install.sh +2 -6
- package/karnel/tools/dev/udocker/install.sh +2 -6
- package/karnel/tools/dev/wget/install.sh +2 -6
- package/karnel/tools/editor/code-server/install.sh +7 -2
- package/karnel/tools/editor/nvchad/install.sh +1 -1
- package/karnel/tools/lang/clang/install.sh +2 -5
- package/karnel/tools/lang/golang/install.sh +2 -5
- package/karnel/tools/lang/nodejs/install.sh +2 -5
- package/karnel/tools/lang/perl/install.sh +2 -5
- package/karnel/tools/lang/php/install.sh +2 -5
- package/karnel/tools/lang/python/install.sh +2 -5
- package/karnel/tools/lang/rust/install.sh +2 -5
- package/karnel/tools/npm/live-server/install.sh +2 -6
- package/karnel/tools/npm/localtunnel/install.sh +2 -6
- package/karnel/tools/npm/markserv/install.sh +2 -6
- package/karnel/tools/npm/ncu/install.sh +2 -6
- package/karnel/tools/npm/nestjs/install.sh +2 -6
- package/karnel/tools/npm/ngrok/install.sh +2 -6
- package/karnel/tools/npm/prettier/install.sh +2 -6
- package/karnel/tools/npm/psqlformat/install.sh +2 -6
- package/karnel/tools/npm/turbopack/bin/next-turbopack +55 -0
- package/karnel/tools/npm/turbopack/bin/node-glibc.sh +9 -0
- package/karnel/tools/npm/turbopack/bin/patch-interp.py +101 -0
- package/karnel/tools/npm/turbopack/bin/precheck-native.js +96 -0
- package/karnel/tools/npm/turbopack/install.sh +101 -31
- package/karnel/tools/npm/typescript/install.sh +2 -6
- package/karnel/tools/npm/vercel/install.sh +2 -6
- package/karnel/tools/shell/better-npm/install.sh +2 -1
- package/karnel/tools/shell/fzf-tab/install.sh +2 -1
- package/karnel/tools/shell/history-substring/install.sh +2 -1
- package/karnel/tools/shell/powerlevel10k/install.sh +2 -1
- package/karnel/tools/shell/you-should-use/install.sh +2 -1
- package/karnel/tools/shell/zsh-autopair/install.sh +2 -1
- package/karnel/tools/shell/zsh-autosuggestions/install.sh +2 -1
- package/karnel/tools/shell/zsh-completions/install.sh +2 -1
- package/karnel/tools/shell/zsh-defer/install.sh +2 -1
- package/karnel/tools/shell/zsh-syntax-highlighting/install.sh +2 -1
- package/karnel/utils/banner.sh +11 -0
- package/package.json +1 -1
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
import struct, sys, os
|
|
3
|
+
|
|
4
|
+
ELFCLASS64 = 2
|
|
5
|
+
ELFDATA2LSB = 1
|
|
6
|
+
PT_INTERP = 3
|
|
7
|
+
SHT_PROGBITS = 1
|
|
8
|
+
SHT_STRTAB = 3
|
|
9
|
+
|
|
10
|
+
def align_up(val, alignment):
|
|
11
|
+
return (val + alignment - 1) & ~(alignment - 1)
|
|
12
|
+
|
|
13
|
+
def patch_interp(path, new_interp):
|
|
14
|
+
data = bytearray(os.path.getsize(path))
|
|
15
|
+
with open(path, 'rb') as f:
|
|
16
|
+
f.readinto(data)
|
|
17
|
+
|
|
18
|
+
if data[:4] != b'\x7fELF':
|
|
19
|
+
sys.stderr.write(f"{path}: not an ELF\n")
|
|
20
|
+
return 1
|
|
21
|
+
if data[4] != ELFCLASS64 or data[5] != ELFDATA2LSB:
|
|
22
|
+
sys.stderr.write(f"{path}: only 64-bit LE supported\n")
|
|
23
|
+
return 1
|
|
24
|
+
|
|
25
|
+
e_phoff = struct.unpack_from('<Q', data, 32)[0]
|
|
26
|
+
e_phentsize = struct.unpack_from('<H', data, 54)[0]
|
|
27
|
+
e_phnum = struct.unpack_from('<H', data, 56)[0]
|
|
28
|
+
e_shoff = struct.unpack_from('<Q', data, 40)[0]
|
|
29
|
+
e_shentsize = struct.unpack_from('<H', data, 58)[0]
|
|
30
|
+
e_shnum = struct.unpack_from('<H', data, 60)[0]
|
|
31
|
+
e_shstrndx = struct.unpack_from('<H', data, 62)[0]
|
|
32
|
+
|
|
33
|
+
interp_idx = None
|
|
34
|
+
for i in range(e_phnum):
|
|
35
|
+
off = e_phoff + i * e_phentsize
|
|
36
|
+
p_type = struct.unpack_from('<I', data, off)[0]
|
|
37
|
+
if p_type == PT_INTERP:
|
|
38
|
+
interp_idx = i
|
|
39
|
+
break
|
|
40
|
+
|
|
41
|
+
if interp_idx is None:
|
|
42
|
+
sys.stderr.write(f"{path}: no PT_INTERP\n")
|
|
43
|
+
return 1
|
|
44
|
+
|
|
45
|
+
ph_off = e_phoff + interp_idx * e_phentsize
|
|
46
|
+
p_offset = struct.unpack_from('<Q', data, ph_off + 8)[0]
|
|
47
|
+
p_vaddr = struct.unpack_from('<Q', data, ph_off + 16)[0]
|
|
48
|
+
p_filesz = struct.unpack_from('<Q', data, ph_off + 32)[0]
|
|
49
|
+
|
|
50
|
+
current = data[p_offset:p_offset + p_filesz].rstrip(b'\x00').decode()
|
|
51
|
+
sys.stderr.write(f"current: {current}\nnew: {new_interp}\n")
|
|
52
|
+
|
|
53
|
+
new_data = new_interp.encode() + b'\x00'
|
|
54
|
+
new_filesz = len(new_data)
|
|
55
|
+
|
|
56
|
+
if new_filesz <= p_filesz:
|
|
57
|
+
data[p_offset:p_offset + p_filesz] = new_data.ljust(p_filesz, b'\x00')
|
|
58
|
+
sys.stderr.write("patched in place\n")
|
|
59
|
+
else:
|
|
60
|
+
old_len = len(data)
|
|
61
|
+
new_offset = align_up(old_len, 8)
|
|
62
|
+
pad = new_offset - old_len
|
|
63
|
+
data.extend(b'\x00' * pad)
|
|
64
|
+
data.extend(new_data)
|
|
65
|
+
|
|
66
|
+
struct.pack_into('<Q', data, ph_off + 8, new_offset)
|
|
67
|
+
struct.pack_into('<Q', data, ph_off + 16, new_offset)
|
|
68
|
+
struct.pack_into('<Q', data, ph_off + 32, new_filesz)
|
|
69
|
+
|
|
70
|
+
if e_shstrndx < e_shnum:
|
|
71
|
+
strtab_off = e_shoff + e_shstrndx * e_shentsize
|
|
72
|
+
strs_off = struct.unpack_from('<Q', data, strtab_off + 24)[0]
|
|
73
|
+
|
|
74
|
+
for i in range(e_shnum):
|
|
75
|
+
sh_off = e_shoff + i * e_shentsize
|
|
76
|
+
sh_name = struct.unpack_from('<I', data, sh_off)[0]
|
|
77
|
+
end = data.find(b'\x00', strs_off + sh_name)
|
|
78
|
+
name = data[strs_off + sh_name:end].decode('latin-1')
|
|
79
|
+
|
|
80
|
+
if name == '.interp':
|
|
81
|
+
struct.pack_into('<Q', data, sh_off + 24, new_offset)
|
|
82
|
+
struct.pack_into('<Q', data, sh_off + 32, new_filesz)
|
|
83
|
+
sys.stderr.write(f"updated .interp section (index {i})\n")
|
|
84
|
+
break
|
|
85
|
+
|
|
86
|
+
sys.stderr.write(f"extended: off {p_offset} -> {new_offset}, sz {p_filesz} -> {new_filesz}\n")
|
|
87
|
+
|
|
88
|
+
with open(path, 'wb') as f:
|
|
89
|
+
f.write(data)
|
|
90
|
+
|
|
91
|
+
st = os.stat(path)
|
|
92
|
+
if not st.st_mode & os.X_OK:
|
|
93
|
+
os.chmod(path, st.st_mode | 0o111)
|
|
94
|
+
|
|
95
|
+
return 0
|
|
96
|
+
|
|
97
|
+
if __name__ == '__main__':
|
|
98
|
+
if len(sys.argv) != 3:
|
|
99
|
+
sys.stderr.write(f"Usage: {sys.argv[0]} <binary> <new-interpreter>\n")
|
|
100
|
+
sys.exit(1)
|
|
101
|
+
sys.exit(patch_interp(sys.argv[1], sys.argv[2]))
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { execSync } = require("child_process");
|
|
3
|
+
const path = require("path");
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
|
|
6
|
+
const PROJECT = process.cwd();
|
|
7
|
+
|
|
8
|
+
const BINDINGS = {
|
|
9
|
+
"lightningcss": { android: "lightningcss-android-arm64", linux: "lightningcss-linux-arm64-gnu" },
|
|
10
|
+
"@tailwindcss/oxide": { android: "@tailwindcss/oxide-android-arm64", linux: "@tailwindcss/oxide-linux-arm64-gnu" },
|
|
11
|
+
"@unrs/resolver-binding": { android: "@unrs/resolver-binding-android-arm64", linux: "@unrs/resolver-binding-linux-arm64-gnu" },
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
function detectPM() {
|
|
15
|
+
if (fs.existsSync(path.join(PROJECT, "pnpm-lock.yaml"))) return "pnpm";
|
|
16
|
+
if (fs.existsSync(path.join(PROJECT, "yarn.lock"))) return "yarn";
|
|
17
|
+
if (fs.existsSync(path.join(PROJECT, "bun.lockb"))) return "bun";
|
|
18
|
+
return "npm";
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function findPnpmParentDir(pkg) {
|
|
22
|
+
const pnpmDir = path.join(PROJECT, "node_modules", ".pnpm");
|
|
23
|
+
if (!fs.existsSync(pnpmDir)) return null;
|
|
24
|
+
try {
|
|
25
|
+
const entries = fs.readdirSync(pnpmDir);
|
|
26
|
+
const prefix = pkg.replace("/", "+") + "@";
|
|
27
|
+
for (const e of entries) {
|
|
28
|
+
if (e.startsWith(prefix)) {
|
|
29
|
+
const inner = path.join(pnpmDir, e, "node_modules", pkg, "node_modules");
|
|
30
|
+
return fs.existsSync(inner) ? inner : null;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
} catch {}
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function variantExists(pkg, variant) {
|
|
38
|
+
if (fs.existsSync(path.join(PROJECT, "node_modules", variant))) return true;
|
|
39
|
+
const pnpmParent = findPnpmParentDir(pkg);
|
|
40
|
+
if (pnpmParent && fs.existsSync(path.join(pnpmParent, variant))) return true;
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function getAndroidVersion(pkg) {
|
|
45
|
+
const pnpmParent = findPnpmParentDir(pkg);
|
|
46
|
+
if (pnpmParent) {
|
|
47
|
+
const androidDir = path.join(pnpmParent, BINDINGS[pkg].android);
|
|
48
|
+
const pkgFile = path.join(androidDir, "package.json");
|
|
49
|
+
if (fs.existsSync(pkgFile)) {
|
|
50
|
+
return JSON.parse(fs.readFileSync(pkgFile, "utf8")).version;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const dir = path.join(PROJECT, "node_modules", BINDINGS[pkg].android);
|
|
54
|
+
const pkgFile = path.join(dir, "package.json");
|
|
55
|
+
if (fs.existsSync(pkgFile)) {
|
|
56
|
+
return JSON.parse(fs.readFileSync(pkgFile, "utf8")).version;
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function main() {
|
|
62
|
+
if (process.platform !== "linux") process.exit(0);
|
|
63
|
+
|
|
64
|
+
const pm = detectPM();
|
|
65
|
+
if (!pm) process.exit(0);
|
|
66
|
+
|
|
67
|
+
let changed = false;
|
|
68
|
+
|
|
69
|
+
for (const [parentPkg, pair] of Object.entries(BINDINGS)) {
|
|
70
|
+
const parentDir = path.join(PROJECT, "node_modules", parentPkg);
|
|
71
|
+
if (!fs.existsSync(parentDir)) {
|
|
72
|
+
const pnpmParent = findPnpmParentDir(parentPkg);
|
|
73
|
+
if (!pnpmParent) continue;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (variantExists(parentPkg, pair.linux)) continue;
|
|
77
|
+
if (!variantExists(parentPkg, pair.android)) continue;
|
|
78
|
+
|
|
79
|
+
const ver = getAndroidVersion(parentPkg);
|
|
80
|
+
if (!ver) continue;
|
|
81
|
+
|
|
82
|
+
const spec = `${pair.linux}@${ver}`;
|
|
83
|
+
process.stdout.write(` Installing ${spec}... `);
|
|
84
|
+
try {
|
|
85
|
+
execSync(`${pm} add ${spec}`, { cwd: PROJECT, stdio: "pipe", timeout: 60000 });
|
|
86
|
+
process.stdout.write("\u2713\n");
|
|
87
|
+
changed = true;
|
|
88
|
+
} catch (e) {
|
|
89
|
+
process.stdout.write(`\u2717 (${e.message.split("\n")[0]})\n`);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (changed) process.stdout.write("\n");
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
main();
|
|
@@ -1,42 +1,112 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
1
|
import "@/utils/log"
|
|
2
|
+
import "@/utils/colors"
|
|
4
3
|
|
|
5
4
|
LOG_FILE="$KARNEL_CACHE/install_npm.log"
|
|
5
|
+
TURBO_DATA_DIR="$HOME/.local/share/karnel-data/node-glibc"
|
|
6
|
+
NODE_VERSION="22.14.0"
|
|
7
|
+
NODE_URL="https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-arm64.tar.xz"
|
|
8
|
+
GLIBC_LIBDIR="/data/data/com.termux/files/usr/glibc/lib"
|
|
9
|
+
GLIBC_BINDIR="/data/data/com.termux/files/usr/glibc/bin"
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
log_info "Turbopack is already installed"
|
|
10
|
-
return 2
|
|
11
|
-
fi
|
|
12
|
-
log_info "Installing Turbopack..."
|
|
13
|
-
npm install -g turbo &>>"$LOG_FILE" || {
|
|
14
|
-
log_error "Failed to install Turbopack"
|
|
15
|
-
return 1
|
|
16
|
-
}
|
|
17
|
-
_fix_npm_shebang "turbo"
|
|
18
|
-
log_success "Turbopack installed"
|
|
11
|
+
_has_glibc_node() {
|
|
12
|
+
[[ -x "$TURBO_DATA_DIR/bin/node" ]]
|
|
19
13
|
}
|
|
20
14
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
_installed_version() {
|
|
16
|
+
_has_glibc_node && "$TURBO_DATA_DIR/bin/node" --version 2>/dev/null || echo ""
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
_install_deps() {
|
|
20
|
+
loading "Installing dependencies" _install_deps_impl
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
_install_deps_impl() {
|
|
24
|
+
declare -A DEPS=(
|
|
25
|
+
["curl"]="curl"
|
|
26
|
+
["tar"]="tar"
|
|
27
|
+
["binutils"]="aarch64-linux-android-strip"
|
|
28
|
+
["python"]="python3"
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
local pkg_name bin_name
|
|
32
|
+
for pkg_name in "${!DEPS[@]}"; do
|
|
33
|
+
bin_name="${DEPS[$pkg_name]}"
|
|
34
|
+
if ! command -v "$bin_name" &>/dev/null; then
|
|
35
|
+
if ! yes | pkg install "$pkg_name" &>>"$LOG_FILE"; then
|
|
36
|
+
log_error "Failed to install $pkg_name"
|
|
37
|
+
return 1
|
|
38
|
+
fi
|
|
39
|
+
fi
|
|
40
|
+
done
|
|
41
|
+
|
|
42
|
+
return 0
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
_download() {
|
|
46
|
+
mkdir -p "$TURBO_DATA_DIR" "$(dirname "$LOG_FILE")"
|
|
47
|
+
local archive="$TURBO_DATA_DIR/node-v${NODE_VERSION}-linux-arm64.tar.xz"
|
|
48
|
+
if [[ ! -f "$archive" ]]; then
|
|
49
|
+
curl -fsSL "$NODE_URL" -o "$archive" || { log_error "download failed"; return 1; }
|
|
50
|
+
fi
|
|
51
|
+
tar -xf "$archive" -C "$TURBO_DATA_DIR" --strip-components=1 || { log_error "extract failed"; return 1; }
|
|
52
|
+
rm -f "$archive"
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
_strip() {
|
|
56
|
+
[[ -f "$TURBO_DATA_DIR/bin/node" ]] || { log_error "node binary not found"; return 1; }
|
|
57
|
+
cp "$TURBO_DATA_DIR/bin/node" "$TURBO_DATA_DIR/bin/node.stripped" || return 1
|
|
58
|
+
aarch64-linux-android-strip "$TURBO_DATA_DIR/bin/node.stripped" &>>"$LOG_FILE"
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
_patch() {
|
|
62
|
+
[[ -f "$TURBO_DATA_DIR/bin/node.stripped" ]] || { log_error "stripped binary not found"; return 1; }
|
|
63
|
+
local patch_script="$KARNEL_PATH/tools/npm/turbopack/bin/patch-interp.py"
|
|
64
|
+
python3 "$patch_script" \
|
|
65
|
+
"$TURBO_DATA_DIR/bin/node.stripped" \
|
|
66
|
+
"$GLIBC_LIBDIR/ld-linux-aarch64.so.1" &>>"$LOG_FILE" || {
|
|
67
|
+
log_error "patch failed — see $LOG_FILE"
|
|
68
|
+
return 1
|
|
69
|
+
}
|
|
70
|
+
mv "$TURBO_DATA_DIR/bin/node.stripped" "$TURBO_DATA_DIR/bin/node"
|
|
71
|
+
chmod +x "$TURBO_DATA_DIR/bin/node"
|
|
28
72
|
}
|
|
29
73
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
74
|
+
_install_wrappers() {
|
|
75
|
+
local src="$KARNEL_PATH/tools/npm/turbopack/bin"
|
|
76
|
+
cp "$src/node-glibc.sh" "$PREFIX/bin/node-glibc" && chmod +x "$PREFIX/bin/node-glibc"
|
|
77
|
+
cp "$src/next-turbopack" "$PREFIX/bin/next-turbopack" && chmod +x "$PREFIX/bin/next-turbopack"
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
_uninstall_node() { rm -rf "$TURBO_DATA_DIR" 2>/dev/null; }
|
|
81
|
+
_uninstall_wrappers() { rm -f "$PREFIX/bin/node-glibc" "$PREFIX/bin/next-turbopack" 2>/dev/null; }
|
|
82
|
+
|
|
83
|
+
install_turbopack() {
|
|
84
|
+
if _has_glibc_node; then
|
|
85
|
+
log_info "Turbopack toolchain already installed"
|
|
86
|
+
read_confirm_default "Reinstall?" "n" REINSTALL
|
|
87
|
+
[[ "$REINSTALL" != "y" ]] && { log_warn "Skipped"; return 0; }
|
|
88
|
+
fi
|
|
89
|
+
|
|
90
|
+
_install_deps || return 1
|
|
91
|
+
mkdir -p "$(dirname "$LOG_FILE")"
|
|
92
|
+
|
|
93
|
+
loading "Downloading Node.js linux-arm64" _download || return 1
|
|
94
|
+
loading "Stripping debug symbols" _strip || { log_error "strip failed"; return 1; }
|
|
95
|
+
loading "Patching ELF interpreter" _patch || return 1
|
|
96
|
+
loading "Installing CLI wrappers" _install_wrappers || { log_error "wrappers failed"; return 1; }
|
|
97
|
+
log_success "Turbopack toolchain installed"
|
|
37
98
|
}
|
|
38
99
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
100
|
+
uninstall_turbopack() {
|
|
101
|
+
if ! _has_glibc_node; then
|
|
102
|
+
log_warn "Turbopack is not installed"
|
|
103
|
+
return 1
|
|
104
|
+
fi
|
|
105
|
+
|
|
106
|
+
loading "Removing Node.js glibc" _uninstall_node
|
|
107
|
+
loading "Removing CLI wrappers" _uninstall_wrappers
|
|
108
|
+
log_success "Turbopack toolchain removed"
|
|
42
109
|
}
|
|
110
|
+
|
|
111
|
+
update_turbopack() { uninstall_turbopack && install_turbopack; }
|
|
112
|
+
reinstall_turbopack() { uninstall_turbopack && install_turbopack; }
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
3
|
import "@/utils/log"
|
|
4
|
+
import "@/utils/version"
|
|
4
5
|
|
|
5
6
|
LOG_FILE="$KARNEL_CACHE/install_npm.log"
|
|
6
7
|
|
|
@@ -81,12 +82,7 @@ _update_typescript_npm_impl() {
|
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
update_typescript() {
|
|
84
|
-
|
|
85
|
-
mkdir -p "$(dirname "$LOG_FILE")"
|
|
86
|
-
|
|
87
|
-
_update_typescript_npm || return 1
|
|
88
|
-
log_success "TypeScript updated"
|
|
89
|
-
return 0
|
|
85
|
+
_check_update_needed "TypeScript" "$(_get_installed_npm_version typescript)" "$(_get_remote_npm_version typescript)" _update_typescript_npm
|
|
90
86
|
}
|
|
91
87
|
|
|
92
88
|
reinstall_typescript() {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
3
|
import "@/utils/log"
|
|
4
|
+
import "@/utils/version"
|
|
4
5
|
|
|
5
6
|
LOG_FILE="$KARNEL_CACHE/install_npm.log"
|
|
6
7
|
|
|
@@ -81,12 +82,7 @@ _update_vercel_npm_impl() {
|
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
update_vercel() {
|
|
84
|
-
|
|
85
|
-
mkdir -p "$(dirname "$LOG_FILE")"
|
|
86
|
-
|
|
87
|
-
_update_vercel_npm || return 1
|
|
88
|
-
log_success "Vercel CLI updated"
|
|
89
|
-
return 0
|
|
85
|
+
_check_update_needed "Vercel CLI" "$(_get_installed_npm_version vercel)" "$(_get_remote_npm_version vercel)" _update_vercel_npm
|
|
90
86
|
}
|
|
91
87
|
|
|
92
88
|
reinstall_vercel() {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
3
|
import "@/utils/log"
|
|
4
|
+
import "@/utils/version"
|
|
4
5
|
|
|
5
6
|
LOG_FILE="$KARNEL_CACHE/install_shell.log"
|
|
6
7
|
ZSH_PLUGINS_DIR="$HOME/.zsh-plugins"
|
|
@@ -76,7 +77,7 @@ _update_better_npm_impl() {
|
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
update_better_npm() {
|
|
79
|
-
|
|
80
|
+
_check_update_needed "zsh-better-npm-completion" "$(_get_installed_git_version "$ZSH_PLUGINS_DIR/zsh-better-npm-completion")" "$(_get_remote_github_version lukechilds/zsh-better-npm-completion)" _update_better_npm_impl
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
reinstall_better_npm() {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
3
|
import "@/utils/log"
|
|
4
|
+
import "@/utils/version"
|
|
4
5
|
|
|
5
6
|
LOG_FILE="$KARNEL_CACHE/install_shell.log"
|
|
6
7
|
ZSH_PLUGINS_DIR="$HOME/.zsh-plugins"
|
|
@@ -76,7 +77,7 @@ _update_fzf_tab_impl() {
|
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
update_fzf_tab() {
|
|
79
|
-
|
|
80
|
+
_check_update_needed "fzf-tab" "$(_get_installed_git_version "$ZSH_PLUGINS_DIR/fzf-tab")" "$(_get_remote_github_version Aloxaf/fzf-tab)" _update_fzf_tab_impl
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
reinstall_fzf_tab() {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
3
|
import "@/utils/log"
|
|
4
|
+
import "@/utils/version"
|
|
4
5
|
|
|
5
6
|
LOG_FILE="$KARNEL_CACHE/install_shell.log"
|
|
6
7
|
ZSH_PLUGINS_DIR="$HOME/.zsh-plugins"
|
|
@@ -76,7 +77,7 @@ _update_history_substring_impl() {
|
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
update_history_substring() {
|
|
79
|
-
|
|
80
|
+
_check_update_needed "zsh-history-substring-search" "$(_get_installed_git_version "$ZSH_PLUGINS_DIR/zsh-history-substring-search")" "$(_get_remote_github_version zsh-users/zsh-history-substring-search)" _update_history_substring_impl
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
reinstall_history_substring() {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
3
|
import "@/utils/log"
|
|
4
|
+
import "@/utils/version"
|
|
4
5
|
|
|
5
6
|
LOG_FILE="$KARNEL_CACHE/install_shell.log"
|
|
6
7
|
ZSH_PLUGINS_DIR="$HOME/.zsh-plugins"
|
|
@@ -76,7 +77,7 @@ _update_powerlevel10k_impl() {
|
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
update_powerlevel10k() {
|
|
79
|
-
|
|
80
|
+
_check_update_needed "powerlevel10k" "$(_get_installed_git_version "$ZSH_PLUGINS_DIR/powerlevel10k")" "$(_get_remote_github_version romkatv/powerlevel10k)" _update_powerlevel10k_impl
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
reinstall_powerlevel10k() {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
3
|
import "@/utils/log"
|
|
4
|
+
import "@/utils/version"
|
|
4
5
|
|
|
5
6
|
LOG_FILE="$KARNEL_CACHE/install_shell.log"
|
|
6
7
|
ZSH_PLUGINS_DIR="$HOME/.zsh-plugins"
|
|
@@ -76,7 +77,7 @@ _update_you_should_use_impl() {
|
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
update_you_should_use() {
|
|
79
|
-
|
|
80
|
+
_check_update_needed "zsh-you-should-use" "$(_get_installed_git_version "$ZSH_PLUGINS_DIR/zsh-you-should-use")" "$(_get_remote_github_version MichaelAquilina/zsh-you-should-use)" _update_you_should_use_impl
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
reinstall_you_should_use() {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
3
|
import "@/utils/log"
|
|
4
|
+
import "@/utils/version"
|
|
4
5
|
|
|
5
6
|
LOG_FILE="$KARNEL_CACHE/install_shell.log"
|
|
6
7
|
ZSH_PLUGINS_DIR="$HOME/.zsh-plugins"
|
|
@@ -76,7 +77,7 @@ _update_zsh_autopair_impl() {
|
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
update_zsh_autopair() {
|
|
79
|
-
|
|
80
|
+
_check_update_needed "zsh-autopair" "$(_get_installed_git_version "$ZSH_PLUGINS_DIR/zsh-autopair")" "$(_get_remote_github_version hlissner/zsh-autopair)" _update_zsh_autopair_impl
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
reinstall_zsh_autopair() {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
3
|
import "@/utils/log"
|
|
4
|
+
import "@/utils/version"
|
|
4
5
|
|
|
5
6
|
LOG_FILE="$KARNEL_CACHE/install_shell.log"
|
|
6
7
|
ZSH_PLUGINS_DIR="$HOME/.zsh-plugins"
|
|
@@ -76,7 +77,7 @@ _update_zsh_autosuggestions_impl() {
|
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
update_zsh_autosuggestions() {
|
|
79
|
-
|
|
80
|
+
_check_update_needed "zsh-autosuggestions" "$(_get_installed_git_version "$ZSH_PLUGINS_DIR/zsh-autosuggestions")" "$(_get_remote_github_version zsh-users/zsh-autosuggestions)" _update_zsh_autosuggestions_impl
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
reinstall_zsh_autosuggestions() {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
3
|
import "@/utils/log"
|
|
4
|
+
import "@/utils/version"
|
|
4
5
|
|
|
5
6
|
LOG_FILE="$KARNEL_CACHE/install_shell.log"
|
|
6
7
|
ZSH_PLUGINS_DIR="$HOME/.zsh-plugins"
|
|
@@ -76,7 +77,7 @@ _update_zsh_completions_impl() {
|
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
update_zsh_completions() {
|
|
79
|
-
|
|
80
|
+
_check_update_needed "zsh-completions" "$(_get_installed_git_version "$ZSH_PLUGINS_DIR/zsh-completions")" "$(_get_remote_github_version zsh-users/zsh-completions)" _update_zsh_completions_impl
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
reinstall_zsh_completions() {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
3
|
import "@/utils/log"
|
|
4
|
+
import "@/utils/version"
|
|
4
5
|
|
|
5
6
|
LOG_FILE="$KARNEL_CACHE/install_shell.log"
|
|
6
7
|
ZSH_PLUGINS_DIR="$HOME/.zsh-plugins"
|
|
@@ -76,7 +77,7 @@ _update_zsh_defer_impl() {
|
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
update_zsh_defer() {
|
|
79
|
-
|
|
80
|
+
_check_update_needed "zsh-defer" "$(_get_installed_git_version "$ZSH_PLUGINS_DIR/zsh-defer")" "$(_get_remote_github_version romkatv/zsh-defer)" _update_zsh_defer_impl
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
reinstall_zsh_defer() {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
3
|
import "@/utils/log"
|
|
4
|
+
import "@/utils/version"
|
|
4
5
|
|
|
5
6
|
LOG_FILE="$KARNEL_CACHE/install_shell.log"
|
|
6
7
|
ZSH_PLUGINS_DIR="$HOME/.zsh-plugins"
|
|
@@ -63,7 +64,7 @@ _update_zsh_syntax_highlighting_impl() {
|
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
update_zsh_syntax_highlighting() {
|
|
66
|
-
|
|
67
|
+
_check_update_needed "zsh-syntax-highlighting" "$(_get_installed_git_version "$ZSH_PLUGINS_DIR/zsh-syntax-highlighting")" "$(_get_remote_github_version zsh-users/zsh-syntax-highlighting)" _update_zsh_syntax_highlighting_impl
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
reinstall_zsh_syntax_highlighting() {
|
package/karnel/utils/banner.sh
CHANGED
|
@@ -487,6 +487,17 @@ KARNEL_TIPS=(
|
|
|
487
487
|
"Init Express: ${TP[3]}cd api && karnel init express${NC}"
|
|
488
488
|
)
|
|
489
489
|
|
|
490
|
+
_block_input() {
|
|
491
|
+
_OLD_STTY=$(stty -g 2>/dev/null || true)
|
|
492
|
+
stty -echo -icanon min 0 time 0 2>/dev/null || true
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
_unblock_input() {
|
|
496
|
+
stty "${_OLD_STTY:-sane}" 2>/dev/null || true
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
_block_input
|
|
490
500
|
_render_animated
|
|
501
|
+
_unblock_input
|
|
491
502
|
|
|
492
503
|
echo
|
package/package.json
CHANGED