Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/linux-ime.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Linux IME

on:
pull_request:
push:
workflow_dispatch:

permissions:
contents: read

jobs:
linux:
runs-on: ubuntu-24.04
container: ubuntu:22.04
timeout-minutes: 60
env:
CARGO_HOME: /root/.cargo
RUSTUP_HOME: /root/.rustup
CARGO_BUILD_JOBS: 2
CARGO_PROFILE_DEV_DEBUG: 0
CARGO_INCREMENTAL: 0
steps:
- name: Prepare the clean Linux test environment
env:
HOME: /root
run: |
apt-get update
apt-get install -y --no-install-recommends build-essential ca-certificates curl git \
pkg-config libwayland-dev libxkbcommon-dev libxkbcommon-x11-dev \
libxcb1-dev libx11-xcb-dev libfontconfig-dev libfreetype-dev zsh fish xvfb
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
sh -s -- -y --no-modify-path --default-toolchain none
echo /root/.cargo/bin >> "$GITHUB_PATH"
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5
with:
path: |
/root/.cargo/registry
/root/.cargo/git
target
key: linux-ime-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml', 'vendor/xim-ctext/**') }}
restore-keys: linux-ime-
- name: Check the application and decoder as a regular user
run: |
rustup toolchain install --no-self-update
useradd --create-home ci
chmod o+x /root
chown -R ci "$GITHUB_WORKSPACE" /root/.cargo /root/.rustup
runuser -u ci -- env HOME=/home/ci CARGO_HOME=/root/.cargo \
RUSTUP_HOME=/root/.rustup PATH="$PATH" sh -eu -c \
'scripts/check.sh; cargo test -p xim-ctext --locked; cargo build --locked'
97 changes: 97 additions & 0 deletions .github/workflows/linux-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Linux packages

on:
pull_request:
push:
workflow_dispatch:

permissions:
contents: read

jobs:
packages:
runs-on: ubuntu-24.04
timeout-minutes: 90
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Check shell syntax
run: |
for script in scripts/linux-*.sh packaging/linux/AppRun; do sh -n "$script"; done
git diff --check
- name: Read the current package version
run: |
. scripts/linux-common.sh
linux_version
echo "PACKAGE_VERSION=$version" >> "$GITHUB_ENV"
- name: Reuse Cargo downloads and release compilation
uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5
with:
path: |
target/linux-cargo
target/linux-build
target/linux-tools
key: linux-x86_64-rust-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml', 'packaging/linux/Dockerfile', 'scripts/linux-appimage.sh') }}
restore-keys: linux-x86_64-rust-
- name: Build the shared binary and four packages
run: scripts/linux-packages.sh
- name: Lint packaging scripts
run: |
docker run --rm -v "$PWD:/src:ro" -w /src elyterminal-release \
sh -c 'shellcheck -x scripts/linux-*.sh packaging/linux/AppRun'
- name: Lint the DEB
run: |
docker run --rm -v "$PWD/target/release:/packages:ro" elyterminal-release \
lintian --fail-on error "/packages/elyterminal_${PACKAGE_VERSION}_amd64.deb"
- name: Verify package checksums
run: |
cd target/release
sha256sum -c "ELYTerminal-$PACKAGE_VERSION-linux-x86_64.sha256"
- name: Validate the AppImage without FUSE
run: |
docker run --rm \
-v "$PWD/target/release:/packages:ro" \
-v "$PWD/scripts/linux-package-test.sh:/test.sh:ro" \
elyterminal-release sh /test.sh "/packages/ELYTerminal-$PACKAGE_VERSION-linux-x86_64.AppImage"
- name: Install, reinstall and remove the DEB on its target systems
run: |
for image in ubuntu:22.04 ubuntu:24.04 debian:12; do
docker run --rm \
-v "$PWD/target/release:/packages:ro" \
-v "$PWD/scripts/linux-package-test.sh:/test.sh:ro" \
"$image" sh /test.sh "/packages/elyterminal_${PACKAGE_VERSION}_amd64.deb"
done
- name: Install, reinstall and remove the RPM on Fedora
run: |
docker run --rm \
-v "$PWD/target/release:/packages:ro" \
-v "$PWD/scripts/linux-package-test.sh:/test.sh:ro" \
fedora:43 sh /test.sh "/packages/elyterminal-$PACKAGE_VERSION-1.x86_64.rpm"
- name: Run the installed DEB and AppImage GUI on Ubuntu 22.04
run: |
docker build --build-arg TEST_UID="$(id -u)" \
-f packaging/linux/Dockerfile.test -t elyterminal-gui-test packaging/linux
mkdir -p target/linux-validation
for package in "elyterminal_${PACKAGE_VERSION}_amd64.deb" "ELYTerminal-$PACKAGE_VERSION-linux-x86_64.AppImage"; do
docker run --rm --init -e LINUX_GUI_TEST=1 -e LINUX_TEST_OUTPUT=/validation \
-v "$PWD/target/release:/packages:ro" -v "$PWD/scripts:/tests:ro" \
-v "$PWD/target/linux-validation:/validation" \
elyterminal-gui-test sh /tests/linux-package-test.sh "/packages/$package"
done
- name: Keep the packages for review
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: ELYTerminal-linux-x86_64
if-no-files-found: error
compression-level: 0
retention-days: 14
path: |
target/release/ELYTerminal-${{ env.PACKAGE_VERSION }}-linux-x86_64.tar.gz
target/release/elyterminal_${{ env.PACKAGE_VERSION }}_amd64.deb
target/release/ELYTerminal-${{ env.PACKAGE_VERSION }}-linux-x86_64.AppImage
target/release/elyterminal-${{ env.PACKAGE_VERSION }}-1.x86_64.rpm
target/release/ELYTerminal-${{ env.PACKAGE_VERSION }}-linux-x86_64.sha256
target/linux-validation/**/app.log
target/linux-validation/**/window.png
3 changes: 1 addition & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ wayland-protocols = { version = "0.32", features = ["client", "staging"] }
x11rb = { version = "0.13", features = ["randr"] }

[target.'cfg(target_os = "linux")'.dev-dependencies]
xim-ctext = "=0.3.0"
wayland-protocols = { version = "0.32", features = ["server", "staging"] }
wayland-server = "0.31"

Expand All @@ -69,6 +70,9 @@ windows-sys = { version = "0.61", features = ["Win32_Security", "Win32_System_IO
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(feature, values("cargo-clippy"))'] }

[patch.crates-io]
xim-ctext = { path = "vendor/xim-ctext" }

[lints.clippy]
all = { level = "warn", priority = -1 }

Expand Down
50 changes: 47 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,53 @@ A terminal for macOS, Windows and Linux, in Rust on GPUI and Ely components. Ses

## Install

A [release on GitHub](https://github.com/ELY-Open-Source/ELYTerminal/releases) carries three builds.
A [release on GitHub](https://github.com/ELY-Open-Source/ELYTerminal/releases) carries builds for each platform.

- macOS 11 or later, Apple silicon: open `ELYTerminal-VERSION.dmg` and drag ELYTerminal into Applications. The app is signed with Developer ID and notarized.
- Windows 10 or later, x86_64: unzip `ELYTerminal-VERSION-windows-x86_64.zip` and run `elyterminal.exe`. It is unsigned; if SmartScreen stops it, press More info, then Run anyway.
- Linux, x86_64, glibc 2.35 or later, with libxkbcommon, libxkbcommon-x11 and libxcb:
- Linux, x86_64: choose a package below.

### Linux

Replace `VERSION` with the release's version. Linux builds need glibc 2.35 or
later, an X11 or Wayland desktop and working graphics drivers. Native packages
install the runtime libraries, desktop entry and icon through the package manager.
The formats below can be built with `scripts/linux-packages.sh`. Use the assets
actually listed for your selected release; packaging CI artifacts are separate
downloads.

On Ubuntu 22.04, Ubuntu 24.04 or Debian 12:

```sh
sudo apt install ./elyterminal_VERSION_amd64.deb
```

On Fedora 43:

```sh
sudo dnf install ./elyterminal-VERSION-1.x86_64.rpm
```

Install a newer package the same way to update. To remove it, use
`sudo apt remove elyterminal` or `sudo dnf remove elyterminal`.
Package operations leave `~/.config/ELYTerminal` alone.

The AppImage runs without a system installation:

```sh
chmod +x ELYTerminal-VERSION-linux-x86_64.AppImage
./ELYTerminal-VERSION-linux-x86_64.AppImage
```

It bundles the keyboard libraries, but uses the host's glibc, X11/Wayland and
graphics libraries, and installed fonts. Install `git`, `curl` and `xdg-utils`
on the host for Git, update checks and desktop links. Without FUSE, run
`./ELYTerminal-VERSION-linux-x86_64.AppImage --appimage-extract-and-run`.
Replace the file to update; delete it to uninstall. Other distributions and
Wayland desktops need testing with their own graphics stack.

The tarball remains available. Install libxkbcommon, libxkbcommon-x11, libxcb,
the desktop's runtime libraries and the tools above first:

```sh
tar -xzf ELYTerminal-VERSION-linux-x86_64.tar.gz
Expand All @@ -19,6 +61,8 @@ install -Dm644 com.zacharyzhang.elyterminal.svg -t ~/.local/share/icons/hicolor/
```

The desktop entry runs `elyterminal`, so `~/.local/bin` must be on `PATH`.
Repeat these commands with a newer tarball to update. To uninstall, remove
the three installed files; settings stay in the config folder.

## Build and run

Expand All @@ -28,7 +72,7 @@ Rust 1.95.0, which `rust-toolchain.toml` pins; rustup installs it on the first b
cargo run --release
```

Each platform's script builds its release in `target/release`: on macOS, `scripts/mac-app.sh` builds `ELYTerminal.app`, with its icon, and a disk image of it; on Windows, `scripts/windows-zip.ps1` zips `elyterminal.exe`, its icon inside; on Linux, `scripts/linux-tar.sh` builds in Docker and packs the binary with its desktop entry and icon.
Each platform's script builds its release in `target/release`: on macOS, `scripts/mac-app.sh` builds `ELYTerminal.app`, with its icon, and a disk image of it; on Windows, `scripts/windows-zip.ps1` zips `elyterminal.exe`, its icon inside; on Linux, `scripts/linux-packages.sh` builds once in Docker on Ubuntu 22.04 and packs the same binary as tar.gz, DEB, AppImage and RPM. `scripts/linux-tar.sh` still builds the tarball on its own. [Linux packaging](packaging/linux/README.md) covers individual scripts, validation and release uploads.

On Linux, install the libraries gpui links first. On Debian and Ubuntu:

Expand Down
4 changes: 4 additions & 0 deletions packaging/linux/AppRun
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
set -eu
appdir=$(CDPATH='' cd "$(dirname "$0")" && pwd)
exec "$appdir/usr/bin/elyterminal" "$@"
16 changes: 16 additions & 0 deletions packaging/linux/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM rust:1.95.0-bookworm AS rust
FROM ubuntu:22.04

COPY --from=rust /usr/local/cargo /usr/local/cargo
COPY --from=rust /usr/local/rustup /usr/local/rustup
COPY --from=rust /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
ENV PATH=/usr/local/cargo/bin:$PATH RUSTUP_HOME=/usr/local/rustup
RUN sed -i 's|http://|https://|g' /etc/apt/sources.list \
&& apt-get update -o APT::Update::Error-Mode=any -o Acquire::Retries=3 \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends -o Acquire::Retries=3 \
build-essential ca-certificates curl pkg-config libwayland-dev libxkbcommon-dev \
libxkbcommon-x11-dev libxcb1-dev libx11-xcb-dev libfontconfig-dev libfreetype-dev \
dpkg-dev rpm patchelf file xz-utils desktop-file-utils shellcheck lintian xvfb \
&& rm -rf /var/lib/apt/lists/* \
&& rustup component add clippy rustfmt
WORKDIR /src
12 changes: 12 additions & 0 deletions packaging/linux/Dockerfile.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM ubuntu:22.04
COPY --from=elyterminal-release /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
ARG TEST_UID=1000
RUN sed -i 's|http://|https://|g' /etc/apt/sources.list \
&& apt-get update -o APT::Update::Error-Mode=any -o Acquire::Retries=3 \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends -o Acquire::Retries=3 \
ca-certificates desktop-file-utils file git curl xdg-utils python3 python3-pil \
xvfb xauth x11-utils x11-apps dbus-x11 libgl1-mesa-dri mesa-vulkan-drivers \
libxkbcommon0 libxkbcommon-x11-0 libxcb1 libwayland-client0 libwayland-egl1 \
libegl1 libvulkan1 fonts-noto-cjk \
&& rm -rf /var/lib/apt/lists/* \
&& useradd --create-home --uid "$TEST_UID" ci
Loading