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
32 changes: 28 additions & 4 deletions .github/workflows/linux-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,45 @@ jobs:
run: |
docker run --rm -i -v "$PWD/out:/packages:ro" -v "$PWD:/source:ro" \
"fedora:$FEDORA_VERSION" bash -s -- "fedora-$FEDORA_VERSION" /packages < packaging/container-linux-test.sh
ubuntu:
ubuntu-compat:
needs: test
runs-on: ubuntu-24.04
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build and install-check the Ubuntu package, including OTA regression tests
- name: Build Ubuntu 26.04 FFmpeg compatibility artifacts
env:
VERSION: ${{ inputs.version || '1.5.3~ci' }}
UUWAY_BUILD_JOBS: 4
run: |
packaging/build-deb.sh --target ubuntu-26.04 --version "$VERSION" --output-dir out
- uses: actions/upload-artifact@v4
with:
name: ubuntu-compat-input
path: out/
ubuntu:
needs: ubuntu-compat
runs-on: ubuntu-24.04
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
name: ubuntu-compat-input
path: build/ubuntu26-input
- name: Build and install-check the universal Ubuntu package
env:
VERSION: ${{ inputs.version || '1.5.3~ci' }}
UUWAY_BUILD_JOBS: 4
run: |
packaging/build-deb.sh --version "$VERSION" --output-dir out
packaging/test-deb.sh "out/uuway_${VERSION}_amd64.deb"
packaging/build-deb.sh --target ubuntu-24.04 --version "$VERSION" \
--compat-package "build/ubuntu26-input/uuway_${VERSION}_amd64.deb" --output-dir out
packaging/test-deb.sh --target ubuntu-24.04 "out/uuway_${VERSION}_amd64.deb"
packaging/test-deb.sh --target ubuntu-26.04 "out/uuway_${VERSION}_amd64.deb"
- uses: actions/upload-artifact@v4
with:
name: uuway-ubuntu
Expand Down
2 changes: 1 addition & 1 deletion README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Mainline targets **GNOME Wayland**, with an NVIDIA GPU supporting NVENC or an AM

3. Setup looks for a UU Windows installer in your Downloads folder, then downloads it from UU's official endpoint if none is found. Use `--installer PATH` to supply a local file. Sign in to UU and allow screen sharing and the text service when prompted. Open **UUWay Console** from the application menu, then connect from your controller.

Ubuntu packages are built on Ubuntu 24.04; other distributions have [native packages](docs/linux-packages.md). [Build from source](docs/build.md) if dependencies differ. Setup installs and pins Wine 11, verifies the encoder and configures user services. It can be run again. NVIDIA is tried first, then AMD; GPU drivers are not installed or switched. After first enabling the Fcitx5 add-on, restart the input method with `fcitx5 -r`. The console and wizard currently use Chinese.
Ubuntu packages carry both the Ubuntu 24.04 and 26.04 FFmpeg ABIs and select the matching AMD runtime locally. Other distributions have [native packages](docs/linux-packages.md). [Build from source](docs/build.md) if dependencies differ. Setup installs and pins Wine 11, verifies the encoder and configures user services. It can be run again. NVIDIA is tried first, then AMD; GPU drivers are not installed or switched. After first enabling the Fcitx5 add-on, restart the input method with `fcitx5 -r`. The console and wizard currently use Chinese.

## Common commands

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ UUWay 让官方 Windows 版 UU 远程被控端在 Linux 上运行,用手机或

3. 向导会先查找下载目录中的 UU Windows 安装包,找不到时从 UU 官方下载。也可用 `uuway setup --installer 路径` 指定本地安装包。按提示登录 UU,允许屏幕共享和文字服务。完成后从应用菜单打开 **UUWay 控制台**,即可在控制端连接。

Ubuntu 安装包以 Ubuntu 24.04 构建;其他发行版请选用[对应安装包](docs/linux-packages.md),遇到依赖差异也可[从源码构建](docs/build.md)。向导会安装并固定 Wine 11、验证编码后端、配置用户服务;可重复运行。优先选择 NVIDIA,验证失败后尝试 AMD,不会安装或切换显卡驱动。Fcitx5 插件首次启用后需重启输入法:`fcitx5 -r`。
Ubuntu 安装包同时带有 Ubuntu 24.04 和 26.04 的 FFmpeg ABI,安装后会按本机系统自动选择 AMD 运行时;其他发行版请选用[对应安装包](docs/linux-packages.md),遇到依赖差异也可[从源码构建](docs/build.md)。向导会安装并固定 Wine 11、验证编码后端、配置用户服务;可重复运行。优先选择 NVIDIA,验证失败后尝试 AMD,不会安装或切换显卡驱动。Fcitx5 插件首次启用后需重启输入法:`fcitx5 -r`。

## 常用操作

Expand Down
3 changes: 3 additions & 0 deletions docs/linux-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ exceptions do not replace real GPU or logged-in desktop tests.

Install the package for your distribution:

Ubuntu 24.04 and 26.04 use the same release `.deb`. It contains both FFmpeg ABI
builds and selects the matching AMD files on the host.

```bash
# Debian 13
sudo apt install ./uuway_*_trixie_amd64.deb
Expand Down
14 changes: 9 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ step_title 1 "检查环境并安装依赖"
. /etc/os-release
command -v apt-get >/dev/null && command -v dpkg-query >/dev/null ||
die "源码安装脚本需要 apt;当前系统请使用原生包,见 docs/linux-packages.md。"
if [[ "${ID:-}" == ubuntu && "${VERSION_ID:-}" == 24.04 ]]; then
ok "Ubuntu 24.04"
if [[ "${ID:-}" == ubuntu && ("${VERSION_ID:-}" == 24.04 || "${VERSION_ID:-}" == 26.04) ]]; then
ok "Ubuntu ${VERSION_ID}"
else
warn "UUWay 只在 Ubuntu 24.04 上验证过(当前:${PRETTY_NAME:-未知}),继续但不保证可用。"
warn "UUWay 只在 Ubuntu 24.04 和 26.04 上验证过(当前:${PRETTY_NAME:-未知}),继续但不保证可用。"
fi
[[ "${XDG_SESSION_TYPE:-}" == wayland ]] || die "请在 Wayland 桌面会话中运行。"
if [[ "${XDG_CURRENT_DESKTOP:-}" == *Hyprland* ]]; then
Expand Down Expand Up @@ -166,7 +166,11 @@ if should_run 1; then
else
info "需要 WineHQ stable 11(安装在 /opt/wine-stable)。"
confirm "现在添加 WineHQ 软件源并安装 winehq-stable?" || die "缺少 WineHQ stable 11,已停止。"
run sudo dpkg --add-architecture i386
wine_packages=('winehq-stable=11.0.*' 'wine-stable=11.0.*')
if [[ "${VERSION_ID:-}" != 26.04 ]]; then
run sudo dpkg --add-architecture i386
wine_packages+=('wine-stable-amd64=11.0.*' 'wine-stable-i386:i386=11.0.*')
fi
run sudo mkdir -pm755 /etc/apt/keyrings
run sudo curl -fsSLo /etc/apt/keyrings/winehq-archive.asc https://dl.winehq.org/wine-builds/winehq.key
wine_source="$("$python" -c 'import sys; sys.path.insert(0, sys.argv[1]); from uuway_platform import winehq_source; print(*winehq_source())' "$repo_dir/scripts")" || die "没有当前系统的 WineHQ 安装适配,请使用原生包。"
Expand All @@ -175,7 +179,7 @@ if should_run 1; then
run sudo sed -i 's@winehq-archive.key@winehq-archive.asc@' "/etc/apt/sources.list.d/$wine_source_name"
run sudo install -m 0644 "$repo_dir/config/uuway-wine.preferences" /etc/apt/preferences.d/uuway-wine
run sudo apt-get update
run sudo apt-get install -y --install-recommends 'winehq-stable=11.0.*' 'wine-stable=11.0.*' 'wine-stable-amd64=11.0.*' 'wine-stable-i386:i386=11.0.*'
run sudo apt-get install -y --install-recommends "${wine_packages[@]}"
((dry_run)) || "$wine_dir/wine" --version | grep -Eq '^wine-11\.0(\.[0-9]+)?$' ||
die "装好的 WineHQ stable 不是 11 版($("$wine_dir/wine" --version))。"
fi
Expand Down
34 changes: 30 additions & 4 deletions packaging/build-deb.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env bash
# Build the uuway .deb in a throwaway Ubuntu 24.04 docker container.
# Build the uuway .deb in a throwaway Ubuntu container.
#
# packaging/build-deb.sh [--version 1.0.0] [--output-dir DIR] [--keep]
# packaging/build-deb.sh [--target ubuntu-24.04|ubuntu-26.04] [--version 1.0.0]
# [--compat-package PATH] [--output-dir DIR] [--keep]
#
# The source is the git-tracked and untracked-but-not-ignored files of this checkout, so
# local edits are included; build/ and the host toolchain are never used. --keep leaves
Expand All @@ -11,17 +12,30 @@ set -Eeuo pipefail
repo_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
output_dir="$repo_dir/build/deb"
version=""
target="ubuntu-24.04"
compat_package=""
keep=0
while (($#)); do
case "$1" in
--target) target="${2:?--target needs a value}"; shift 2 ;;
--version) version="${2:?--version needs a value}"; shift 2 ;;
--compat-package) compat_package="${2:?--compat-package needs a path}"; shift 2 ;;
--output-dir) output_dir="${2:?--output-dir needs a path}"; shift 2 ;;
--keep) keep=1; shift ;;
-h|--help) sed -n '2,8p' "${BASH_SOURCE[0]}"; exit 0 ;;
*) printf 'unknown option: %s\n' "$1" >&2; exit 2 ;;
esac
done
command -v docker >/dev/null || { printf 'docker is required\n' >&2; exit 1; }
case "$target" in
ubuntu-24.04) image=ubuntu:24.04 ;;
ubuntu-26.04) image=ubuntu:26.04 ;;
*) printf 'unsupported Ubuntu target: %s\n' "$target" >&2; exit 2 ;;
esac
if [[ -n "$compat_package" && ! -f "$compat_package" ]]; then
printf 'compatibility package does not exist: %s\n' "$compat_package" >&2
exit 2
fi

if [[ -z "$version" ]]; then
if tag="$(git -C "$repo_dir" describe --tags --exact-match 2>/dev/null)"; then
Expand All @@ -36,12 +50,24 @@ cleanup() { ((keep)) || docker rm -f "$name" >/dev/null 2>&1 || true; }
trap cleanup EXIT

printf 'Building uuway %s in container %s\n' "$version" "$name"
docker run -d --name "$name" ubuntu:24.04 sleep infinity >/dev/null
docker run -d --name "$name" "$image" sleep infinity >/dev/null
git -C "$repo_dir" ls-files -z --cached --others --exclude-standard --deduplicate |
tar -C "$repo_dir" --null -T - -cf - |
docker exec -i "$name" sh -c 'mkdir -p /work/UUWay && tar xf - -C /work/UUWay'
if [[ -n "$compat_package" ]]; then
docker cp "$compat_package" "$name:/tmp/ubuntu26-compat.deb"
docker exec -w /work/UUWay "$name" bash -Eeuo pipefail -c '
rm -rf /tmp/ubuntu26-compat
dpkg-deb -x /tmp/ubuntu26-compat.deb /tmp/ubuntu26-compat
mkdir -p build/compat/ubuntu26
for name in uurb-nvenc-encode.dll.so uu-pipewire-native-probe uu-vaapi-probe; do
install -m 0755 "/tmp/ubuntu26-compat/usr/lib/uuway/build/backends/amd/native-presenter/$name" \
"build/compat/ubuntu26/$name"
done
'
fi
docker exec -e "SOURCE_DATE_EPOCH=$(git -C "$repo_dir" log -1 --format=%ct)" -w /work/UUWay "$name" \
packaging/container-build.sh --version "$version" --output-dir /work/out
packaging/container-build.sh --target "$target" --version "$version" --output-dir /work/out
mkdir -p "$output_dir"
docker cp "$name:/work/out/." "$output_dir/"
printf '\nBuilt: %s\n' "$output_dir/uuway_${version}_amd64.deb"
51 changes: 37 additions & 14 deletions packaging/container-build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Build every native artifact and the uuway .deb inside a clean Ubuntu 24.04.
# Build every native artifact and the uuway .deb inside a clean Ubuntu release.
#
# Run as root from the repository root, in a container or a CI job:
# packaging/container-build.sh --version 1.0.0
Expand All @@ -13,15 +13,15 @@ set -Eeuo pipefail

repo_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
version=""
target="ubuntu-24.04"
output_dir="$repo_dir/build/deb"

wine_version='11.0.0.0~noble-1'
cuda_base='https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64'
cuda_debs=(
'cuda-cudart-dev-12-1_12.1.105-1_amd64.deb 531c1cc54bc76e383a4a43f04a60f5bb1b6e34e79fc3a4156422057e87031240'
'cuda-driver-dev-12-1_12.1.105-1_amd64.deb 49a0807b1f37da920a9417b3fa16d5e281c306595412e40ba4af04195d1655f4'
)
packages=(ca-certificates curl gnupg git ripgrep python3 build-essential gcc-11 g++-11
packages=(ca-certificates curl gnupg git ripgrep python3 build-essential
gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 meson ninja-build pkg-config
libjson-c-dev libx11-dev libxfixes-dev libpipewire-0.3-dev libspa-0.2-dev libvulkan-dev
glslang-tools libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
Expand All @@ -33,33 +33,54 @@ step() { printf '\n━━ %s\n' "$*"; }

while (($#)); do
case "$1" in
--target) target="${2:?--target needs a value}"; shift 2 ;;
--version) version="${2:?--version needs a value}"; shift 2 ;;
--output-dir) output_dir="${2:?--output-dir needs a path}"; shift 2 ;;
-h|--help) sed -n '2,10p' "${BASH_SOURCE[0]}"; exit 0 ;;
*) die "unknown option: $1" ;;
esac
done
case "$target" in
ubuntu-24.04) ubuntu_version=24.04; codename=noble ;;
ubuntu-26.04) ubuntu_version=26.04; codename=resolute ;;
*) ubuntu_version=""; codename="" ;;
esac
wine_version="11.0.0.0~${codename}-1"
[[ -n "$version" ]] || die "--version is required (for example 1.0.0)"
((EUID == 0)) || die "run as root inside a disposable Ubuntu 24.04 container"
[[ -n "$ubuntu_version" ]] || die "unsupported Ubuntu target: $target"
((EUID == 0)) || die "run as root inside a disposable Ubuntu container"
# shellcheck source=/dev/null
. /etc/os-release
[[ "${ID:-}" == ubuntu && "${VERSION_ID:-}" == 24.04 ]] || die "needs Ubuntu 24.04 (found ${PRETTY_NAME:-unknown})"
[[ "${ID:-}" == ubuntu && "${VERSION_ID:-}" == "$ubuntu_version" ]] || die "needs Ubuntu $ubuntu_version (found ${PRETTY_NAME:-unknown})"
export DEBIAN_FRONTEND=noninteractive

if [[ "$target" == ubuntu-24.04 ]]; then
packages+=(gcc-11 g++-11)
else
packages+=(gcc g++)
fi

step "Build packages"
apt-get update -qq
apt-get install -y -qq --no-install-recommends "${packages[@]}"

step "WineHQ stable $wine_version (winegcc and import libraries)"
if ! dpkg-query -W -f='${Version}' winehq-stable 2>/dev/null | grep -qx "$wine_version"; then
dpkg --add-architecture i386
if [[ "$target" == ubuntu-24.04 ]]; then
dpkg --add-architecture i386
fi
install -d -m 0755 /etc/apt/keyrings
curl -fsSLo /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
curl -fsSLo /etc/apt/sources.list.d/winehq-noble.sources \
https://dl.winehq.org/wine-builds/ubuntu/dists/noble/winehq-noble.sources
curl -fsSLo /etc/apt/keyrings/winehq-archive.asc https://dl.winehq.org/wine-builds/winehq.key
curl -fsSLo "/etc/apt/sources.list.d/winehq-${codename}.sources" \
"https://dl.winehq.org/wine-builds/ubuntu/dists/${codename}/winehq-${codename}.sources"
sed -i 's@winehq-archive.key@winehq-archive.asc@' \
"/etc/apt/sources.list.d/winehq-${codename}.sources"
apt-get update -qq
apt-get install -y -qq --no-install-recommends "winehq-stable=$wine_version" \
"wine-stable=$wine_version" "wine-stable-amd64=$wine_version" "wine-stable-i386:i386=$wine_version"
wine_packages=("winehq-stable=$wine_version" "wine-stable=$wine_version")
if [[ "$target" == ubuntu-24.04 ]]; then
wine_packages+=("wine-stable-amd64=$wine_version" "wine-stable-i386:i386=$wine_version")
fi
apt-get install -y -qq --no-install-recommends "${wine_packages[@]}"
fi
[[ "$(/opt/wine-stable/bin/wine --version)" == wine-11.0 ]] || die "Wine is not 11.0"

Expand All @@ -75,9 +96,11 @@ done
ln -sfn cuda-12.1 /usr/local/cuda
[[ -f /usr/local/cuda/include/cuda.h && -f /usr/local/cuda/lib64/stubs/libcuda.so ]] || die "CUDA headers missing"

step "Toolchain: gcc 11 first on PATH"
for tool in gcc cc; do ln -sf /usr/bin/gcc-11 "/usr/local/bin/$tool"; done
for tool in g++ c++; do ln -sf /usr/bin/g++-11 "/usr/local/bin/$tool"; done
step "Toolchain"
if [[ "$target" == ubuntu-24.04 ]]; then
for tool in gcc cc; do ln -sf /usr/bin/gcc-11 "/usr/local/bin/$tool"; done
for tool in g++ c++; do ln -sf /usr/bin/g++-11 "/usr/local/bin/$tool"; done
fi
export PATH="/usr/local/bin:$PATH"
gcc --version | head -1

Expand Down
18 changes: 15 additions & 3 deletions packaging/container-test.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#!/usr/bin/env bash
# Check the uuway .deb the way a user meets it, inside a clean Ubuntu 24.04 (root, no GPU,
# Check the uuway .deb the way a user meets it, inside a clean Ubuntu release (root, no GPU,
# no Wine, no desktop session). packaging/test-deb.sh runs this in a throwaway container.
#
# packaging/container-test.sh /path/uuway_X_amd64.deb
#
# What a container cannot show (live capture, NVENC, the phone) is covered by the manual
# acceptance on a real machine; everything that does not need a GPU is asserted here.
set -uo pipefail
. /etc/os-release
export VERSION_ID

deb="${1:?usage: container-test.sh path/to/uuway.deb}"
export DEBIAN_FRONTEND=noninteractive
Expand Down Expand Up @@ -78,7 +80,7 @@ need.add('build/native-presenter/uu-pipewire-dmabuf-probe')
have = {str(path.relative_to('/usr/lib/uuway')) for path in pathlib.Path('/usr/lib/uuway/build').rglob('*') if path.is_file()}
missing, extra = sorted(need - have), sorted(have - need - {f'build/helpers/{n}' for n in (
'uu-clipboard-bridge', 'uu-clipboard-files.exe', 'uu-conpty.dll', 'uu-terminal-bridge', 'uu-terminal-proxy.exe')})
extra = [path for path in extra if not path.startswith('build/backends/')]
extra = [path for path in extra if not path.startswith('build/backends/') and not path.startswith('build/compat/ubuntu26/')]
for backend in ('nvidia', 'amd'):
for required in (f'build/backends/{backend}/native-presenter',
f'build/backends/{backend}/dxvk-capture/stage',
Expand All @@ -94,7 +96,17 @@ elf_missing() {
# the Fcitx5 libraries (the add-on is only ever loaded by fcitx5, which has them).
local file
while IFS= read -r file; do
[ "$(head -c4 "$file" | tail -c3)" = ELF ] || continue
# The package carries both Ubuntu FFmpeg ABIs. Only the host-matching
# AMD files are loaded, so the other ABI is intentionally unresolved.
if [[ "${VERSION_ID:-}" != 26.04 && "$file" == "$lib/build/compat/ubuntu26/"* ]]; then
continue
fi
if [[ "${VERSION_ID:-}" == 26.04 && "$file" != "$lib/build/compat/ubuntu26/"* ]]; then
case "$(basename "$file")" in
uurb-nvenc-encode.dll.so|uu-pipewire-native-probe|uu-vaapi-probe) continue ;;
esac
fi
[ "$(od -An -tx1 -N4 "$file" | tr -d ' \n')" = 7f454c46 ] || continue
ldd "$file" 2>/dev/null | awk -v f="$file" '/not found/ {print f ": " $1}'
done < <(find "$lib" -type f)
}
Expand Down
2 changes: 1 addition & 1 deletion packaging/deb/control.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Version: @VERSION@
Architecture: amd64
Maintainer: GaryOAO <62834599+GaryOAO@users.noreply.github.com>
Installed-Size: @SIZE@
Depends: python3, python3-gi, python3-dbus, gir1.2-gtk-3.0, gir1.2-atspi-2.0, adwaita-icon-theme, librsvg2-common, xvfb, xauth, xclip, procps, libgtk-3-bin, udev, systemd, ca-certificates, curl@SHLIBS@
Depends: python3, python3-gi, python3-dbus, gir1.2-gtk-3.0, gir1.2-atspi-2.0, adwaita-icon-theme, librsvg2-common, xvfb, xauth, xclip, procps, libgtk-3-bin, udev, systemd, ca-certificates, curl, ffmpeg@SHLIBS@
Recommends: fcitx5
Suggests: winehq-stable (>= 11.0)
Section: utils
Expand Down
1 change: 1 addition & 0 deletions packaging/deb/lintian-overrides
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# starts, and they ship exactly as they were built and validated on real hardware.
uuway: unstripped-binary-or-object [usr/lib/uuway/build/native-presenter/*]
uuway: unstripped-binary-or-object [usr/lib/uuway/build/backends/*/native-presenter/*]
uuway: unstripped-binary-or-object [usr/lib/uuway/build/compat/ubuntu26/*]
uuway: unstripped-binary-or-object [usr/lib/uuway/fcitx5/libuurb-native-ime.so]
# prerm stops the *user* services of every logged-in user; deb-systemd-invoke only handles system units.
uuway: maintainer-script-calls-systemctl [prerm:*]
Expand Down
Loading
Loading