Add a Linux version (IBus) for Bazzite / SteamOS desktop mode
linux/autozhuyin_ibus.py is an IBus engine on top of the shared Python core: preedit with the cursor and blue English segments, lookup table, Shift tap for English mode, candidate clicks. install.sh puts everything in the home folder (works on read-only systems) and an autostart entry registers the engine with ibus-daemon and selects it. Tested with a stand-in IBus module. Also fixes Windows: wants() did not claim the backtick, so backtick + punctuation never reached the engine under PIME. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
# Builds build/AutoZhuyin-Linux-<version>.tar.gz: the IBus engine, the shared Python
|
||||
# core and data, and install/uninstall scripts (per-user install, no root needed).
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
VERSION="$(python3 -I -c 'import json,sys; print(json.load(open(sys.argv[1]))["version"])' windows/autozhuyin/ime.json)"
|
||||
NAME="AutoZhuyin-Linux-$VERSION"
|
||||
OUT="build/$NAME"
|
||||
|
||||
python3 -I windows/tools/build_data.py
|
||||
(cd windows && python3 -m unittest discover -q tests)
|
||||
python3 -m unittest discover -q -s linux/tests
|
||||
|
||||
if [ ! -f build/icon.tiff ]; then
|
||||
DEVELOPER_DIR="${DEVELOPER_DIR:-/Applications/Xcode.app/Contents/Developer}" xcrun swift scripts/make-icon.swift build/icon.tiff
|
||||
fi
|
||||
|
||||
rm -rf "$OUT" "$OUT.tar.gz"
|
||||
mkdir -p "$OUT/autozhuyin"
|
||||
rsync -a --exclude __pycache__ --exclude '*.pyc' \
|
||||
windows/autozhuyin/__init__.py windows/autozhuyin/core windows/autozhuyin/data "$OUT/autozhuyin/"
|
||||
cp linux/autozhuyin_ibus.py linux/installer/install.sh linux/installer/uninstall.sh linux/installer/README.txt \
|
||||
THIRD_PARTY_LICENSES.txt "$OUT/"
|
||||
echo "$VERSION" > "$OUT/version.txt"
|
||||
sips -s format png -z 64 64 build/icon.tiff --out "$OUT/icon.png" >/dev/null
|
||||
chmod +x "$OUT/install.sh" "$OUT/uninstall.sh" "$OUT/autozhuyin_ibus.py"
|
||||
|
||||
# Plain ustar without macOS extended attributes, so GNU tar doesn't warn.
|
||||
(cd build && COPYFILE_DISABLE=1 tar --no-xattrs --format ustar -czf "$NAME.tar.gz" "$NAME")
|
||||
echo "Built build/$NAME.tar.gz"
|
||||
+5
-3
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
# One-step release: bump the version, run all tests, build both installers, then
|
||||
# One-step release: bump the version, run all tests, build all installers, then
|
||||
# commit the version change and tag it.
|
||||
#
|
||||
# Usage: scripts/release.sh [patch|minor|major] [--push] (default: patch)
|
||||
@@ -38,14 +38,16 @@ xcrun swift test -q 2>&1 | tail -3
|
||||
echo "==> Packaging (runs the Python tests too)"
|
||||
scripts/package.sh >/dev/null
|
||||
scripts/package-windows.sh >/dev/null
|
||||
scripts/package-linux.sh >/dev/null
|
||||
|
||||
trap - ERR
|
||||
git add Resources/Info.plist windows/autozhuyin/ime.json
|
||||
git commit -q -m "Release v$VERSION"
|
||||
git tag -a "v$VERSION" -m "AutoZhuyin v$VERSION"
|
||||
echo "==> Tagged v$VERSION"
|
||||
ls -lh "build/AutoZhuyin-$VERSION.pkg" "build/AutoZhuyin-Windows-$VERSION.zip"
|
||||
shasum -a 256 "build/AutoZhuyin-$VERSION.pkg" "build/AutoZhuyin-Windows-$VERSION.zip"
|
||||
FILES=("build/AutoZhuyin-$VERSION.pkg" "build/AutoZhuyin-Windows-$VERSION.zip" "build/AutoZhuyin-Linux-$VERSION.tar.gz")
|
||||
ls -lh "${FILES[@]}"
|
||||
shasum -a 256 "${FILES[@]}"
|
||||
|
||||
if [ "$PUSH" = 1 ]; then
|
||||
git push origin HEAD "v$VERSION"
|
||||
|
||||
Reference in New Issue
Block a user