From fde3b37f0162db72980febecfe65fffe98d0d3c6 Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Tue, 22 Jul 2025 20:55:03 +0800 Subject: [PATCH] Update bootstrap `Termux` --- README.md | 11 ++++++++++- bootstrap/README.md | 8 ++++---- bootstrap/Termux.bash | 7 +++++-- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 067ff19..962a7f3 100644 --- a/README.md +++ b/README.md @@ -306,8 +306,17 @@ clang -Iinclude -Ilib src/chsrc-main.c -o chsrc
Android/Termux +Termux 中默认无 `Wget`,我们都用 `cURL` 来下载安装 + ```bash -wget -O - https://gitee.com/RubyMetric/chsrc/raw/main/bootstrap/Termux.bash | bash +# arm64/aarch64 +curl -L https://gitee.com/RubyMetric/chsrc/releases/download/pre/chsrc-arm64-linux -o chsrc; chmod +x ./chsrc +``` + +如果你所在的处理器架构没有预编译版本,可以使用 [chsrc-bootstrap]: + +```bash +curl -L https://gitee.com/RubyMetric/chsrc/raw/main/bootstrap/Termux.bash | bash ```
diff --git a/bootstrap/README.md b/bootstrap/README.md index f8dfe67..297a0c5 100644 --- a/bootstrap/README.md +++ b/bootstrap/README.md @@ -7,14 +7,14 @@ ! Contributors : Nul None ! | ! Created On : <2025-07-12> - ! Last Modified : <2025-07-12> + ! Last Modified : <2025-07-22> ! ---------------------------------------------------------- --> # Bootstrap ```ruby begin - download_binary_for_my_platform + download_prebuilt_chsrc_binary_for_my_platform rescue NoReadyMadeBinary => e bootstrap! e.my_platform end @@ -24,7 +24,7 @@ end -## 鸡蛋困境 +## 预编译产生的死锁问题 我们支持预编译的操作系统目前只有 `Windows`, `Linux`, `macOS`,支持的架构请参考[项目 README](../README.md) @@ -36,7 +36,7 @@ end 2. C语言编译器 3. `GNU make` 或 `just` (这二者非强制,但是有了更好) -可是如果用户还没有换源,他/她又如何获得上述这些程序呢?**这是一把死锁,导致用户最终回到手动换源的原始农耕时代。这是一个 "鸡蛋问题",到底是先有鸡还是先有蛋?** +可是如果用户还没有换源,他/她又如何获得上述这些程序呢?**这是一把死锁,导致用户最终回到手动换源的原始农耕时代。**
diff --git a/bootstrap/Termux.bash b/bootstrap/Termux.bash index 6a4e681..964cfdf 100644 --- a/bootstrap/Termux.bash +++ b/bootstrap/Termux.bash @@ -6,7 +6,7 @@ # File Authors : Aoran Zeng # Contributors : Nul None # Created On : <2025-07-12> -# Last Modified : <2025-07-12> +# Last Modified : <2025-07-22> # # Termux: # @@ -24,7 +24,10 @@ bs_echo() { if command -v termux-change-repo &>/dev/null; then termux-change-repo else - # HELP: $PREFIX 有值吗? 是 "/data/data/com.termux/files/usr" 吗? + + # $PREFIX 的值为: /data/data/com.termux/files/usr + # 用户主目录 ~ 为: /data/data/com.termux/files/home + # 必要的 sed -i 's@^\(deb.*stable main\)$@#\1\ndeb https://mirrors.cernet.edu.cn/termux/apt/termux-main stable main@' $PREFIX/etc/apt/sources.list apt update