Set up Rime Ice from the ISO's assets on China installs
This commit is contained in:
1 parent
b6bf851af4
commit
32ebf6b85b
6 files changed
+58
-2
No files matched your search
@@ -5,6 +5,7 @@ global)
|
||||
china)
|
||||
mkdir -p /etc/omarchy
|
||||
echo china >/etc/omarchy/region
|
||||
omarchy-pkg-add fcitx5-configtool fcitx5-rime librime opencc rime-ice-installer
|
||||
;;
|
||||
*)
|
||||
echo "Unknown OMARCHY_REGION: $OMARCHY_REGION" >&2
|
||||
|
||||
@@ -72,3 +72,11 @@ t2fanrd
|
||||
|
||||
# Framework 16
|
||||
qmk-hid
|
||||
|
||||
# China region input method (install/config/region.sh)
|
||||
dialog
|
||||
fcitx5-configtool
|
||||
fcitx5-rime
|
||||
librime
|
||||
opencc
|
||||
rime-ice-installer
|
||||
@@ -13,3 +13,4 @@ run_logged "$OMARCHY_INSTALL/user/hardware/vm-no-animations.sh"
|
||||
|
||||
run_logged "$OMARCHY_INSTALL/user/default-keyring.sh"
|
||||
run_logged "$OMARCHY_INSTALL/user/mise.sh"
|
||||
run_logged "$OMARCHY_INSTALL/user/region.sh"
|
||||
@@ -0,0 +1,9 @@
|
||||
region=$(omarchy-region)
|
||||
|
||||
if [[ $region == "China" ]]; then
|
||||
if [[ $OMARCHY_SETUP_CONTEXT == "iso-chroot" ]]; then
|
||||
rime-ice-installer --yes --asset-dir /opt/packages/rime-ice
|
||||
else
|
||||
echo "Skipping Rime Ice setup in $OMARCHY_SETUP_CONTEXT: only the ISO bundles its assets"
|
||||
fi
|
||||
fi
|
||||
+1
-1
@@ -15,7 +15,7 @@ Progress source of truth for the `omarchycn` branches of `omarchy`, `omarchy-iso
|
||||
|
||||
- [x] T0 Branches and this list
|
||||
- [x] T1 China package sources (PRD 1): region state, `omarchy-region` reader, `default/region/china/pacman.sed`, applied by `omarchy-refresh-pacman` and `install/post-install/pacman.sh`; tests
|
||||
- [ ] T2 Region choice in the installer (PRD 2): `omarchy_prompt_region` in `setup-form.sh`, ISO configurator screen, orchestrator passes `OMARCHY_REGION`, `install/config/region.sh` records it
|
||||
- [x] T2 Region choice in the installer (PRD 2): `omarchy_prompt_region` in `setup-form.sh`, ISO configurator screen, orchestrator passes `OMARCHY_REGION`, `install/config/region.sh` records it
|
||||
- [ ] T3 Input method (PRD 3): rime-ice-installer patch and PKGBUILD in omarchy-pkgs, IME packages in `omarchy-other.packages`, install-time package add, user step runs the installer from bundled assets, ISO build bundles assets and the package
|
||||
- [ ] T4 CJK fontconfig fix (PRD 4): rebuild PR 9693 on the current base
|
||||
- [ ] T5 AI (PRD 5): Dim and Kimi Code for every region (rebuild PR 9694), Claude Code third-party provider setup shown only in China
|
||||
|
||||
@@ -55,15 +55,33 @@ fi
|
||||
[[ $output == "Unknown region in $region_file: mars" ]] || fail "an unknown region names the file and value" "$output"
|
||||
pass "an unknown region fails and names the file and value"
|
||||
|
||||
stub_bin="$test_tmp/bin"
|
||||
calls="$test_tmp/calls"
|
||||
mkdir -p "$stub_bin"
|
||||
for command in omarchy-pkg-add rime-ice-installer; do
|
||||
printf '#!/bin/bash\necho "%s $*" >>"%s"\n' "$command" "$calls" >"$stub_bin/$command"
|
||||
done
|
||||
printf '#!/bin/bash\necho "$STUB_REGION"\n' >"$stub_bin/omarchy-region"
|
||||
chmod +x "$stub_bin"/*
|
||||
PATH="$stub_bin:$PATH"
|
||||
|
||||
region_setup="$test_tmp/region.sh"
|
||||
sed "s|/etc/omarchy|$test_tmp/etc-omarchy|g" "$ROOT/install/config/region.sh" >"$region_setup"
|
||||
|
||||
: >"$calls"
|
||||
OMARCHY_REGION=china bash -e "$region_setup"
|
||||
[[ $(<"$test_tmp/etc-omarchy/region") == "china" ]] || fail "install records the China region"
|
||||
pass "install records the China region"
|
||||
[[ $(<"$calls") == "omarchy-pkg-add fcitx5-configtool fcitx5-rime librime opencc rime-ice-installer" ]] ||
|
||||
fail "China installs the Rime input method packages" "$(<"$calls")"
|
||||
for package in fcitx5-configtool fcitx5-rime librime opencc rime-ice-installer; do
|
||||
grep -qx "$package" "$ROOT/install/omarchy-other.packages" || fail "the ISO mirror carries $package"
|
||||
done
|
||||
pass "install records the China region and installs the Rime packages the ISO carries"
|
||||
|
||||
: >"$calls"
|
||||
OMARCHY_REGION=global bash -e "$region_setup"
|
||||
[[ ! -e $test_tmp/etc-omarchy/region ]] || fail "install records Global by leaving no region file"
|
||||
[[ ! -s $calls ]] || fail "Global installs no input method packages" "$(<"$calls")"
|
||||
OMARCHY_REGION=china bash -e "$region_setup"
|
||||
env -u OMARCHY_REGION bash -e "$region_setup"
|
||||
[[ ! -e $test_tmp/etc-omarchy/region ]] || fail "an installer that passes no region installs Global"
|
||||
@@ -74,3 +92,22 @@ if output=$(OMARCHY_REGION=mars bash -e "$region_setup" 2>&1); then
|
||||
fi
|
||||
[[ $output == "Unknown OMARCHY_REGION: mars" ]] || fail "install names the unknown region" "$output"
|
||||
pass "install rejects an unknown region"
|
||||
|
||||
user_region="$ROOT/install/user/region.sh"
|
||||
|
||||
: >"$calls"
|
||||
STUB_REGION=China OMARCHY_SETUP_CONTEXT=iso-chroot bash -e "$user_region"
|
||||
[[ $(<"$calls") == "rime-ice-installer --yes --asset-dir /opt/packages/rime-ice" ]] ||
|
||||
fail "a China install sets up Rime Ice from the ISO's assets" "$(<"$calls")"
|
||||
pass "a China install sets up Rime Ice from the ISO's assets"
|
||||
|
||||
: >"$calls"
|
||||
output=$(STUB_REGION=China OMARCHY_SETUP_CONTEXT=provision-owner bash -e "$user_region")
|
||||
[[ ! -s $calls && $output == "Skipping Rime Ice setup in provision-owner: only the ISO bundles its assets" ]] ||
|
||||
fail "first-boot setup says why it skips Rime Ice" "$output $(<"$calls")"
|
||||
pass "first-boot setup says why it skips Rime Ice"
|
||||
|
||||
: >"$calls"
|
||||
output=$(STUB_REGION=Global OMARCHY_SETUP_CONTEXT=iso-chroot bash -e "$user_region")
|
||||
[[ ! -s $calls && -z $output ]] || fail "a Global install leaves the input method alone" "$output $(<"$calls")"
|
||||
pass "a Global install leaves the input method alone"
|
||||
Reference in new issue
Block a user