From eec492bdf5532d847899ae23169bfedd5ba5bfe3 Mon Sep 17 00:00:00 2001 From: GaryOAO <62834599+GaryOAO@users.noreply.github.com> Date: Fri, 20 Nov 2026 12:55:19 +0800 Subject: [PATCH 1/6] fix: select Ubuntu FFmpeg runtime by host --- .github/workflows/linux-packages.yml | 32 ++++++++++++++++--- README.en.md | 2 +- README.md | 2 +- docs/linux-packages.md | 3 ++ install.sh | 14 ++++++--- packaging/build-deb.sh | 34 +++++++++++++++++--- packaging/container-build.sh | 47 ++++++++++++++++++++-------- packaging/container-test.sh | 15 +++++++-- packaging/deb/control.in | 2 +- packaging/deb_manifest.py | 6 ++++ packaging/release-notes.md | 2 ++ packaging/stage-deb.py | 13 ++++++-- packaging/test-deb.sh | 26 +++++++++------ scripts/uuway_cli.py | 12 ++++--- scripts/uuway_platform.py | 20 ++++++++---- tests/test_fedora_bundle.py | 13 ++++++++ 16 files changed, 189 insertions(+), 54 deletions(-) diff --git a/.github/workflows/linux-packages.yml b/.github/workflows/linux-packages.yml index 1c75d6a..9ce3db2 100644 --- a/.github/workflows/linux-packages.yml +++ b/.github/workflows/linux-packages.yml @@ -106,7 +106,7 @@ 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 @@ -114,13 +114,37 @@ jobs: - 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 diff --git a/README.en.md b/README.en.md index 3fe30eb..f57d463 100644 --- a/README.en.md +++ b/README.en.md @@ -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 diff --git a/README.md b/README.md index e69c6d1..3404960 100644 --- a/README.md +++ b/README.md @@ -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`。 ## 常用操作 diff --git a/docs/linux-packages.md b/docs/linux-packages.md index cd09aff..cd5847d 100644 --- a/docs/linux-packages.md +++ b/docs/linux-packages.md @@ -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 diff --git a/install.sh b/install.sh index ea15e72..dd917fe 100755 --- a/install.sh +++ b/install.sh @@ -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 @@ -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 安装适配,请使用原生包。" @@ -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 diff --git a/packaging/build-deb.sh b/packaging/build-deb.sh index 1662363..6af99a2 100755 --- a/packaging/build-deb.sh +++ b/packaging/build-deb.sh @@ -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 @@ -11,10 +12,14 @@ 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 ;; @@ -22,6 +27,15 @@ while (($#)); do 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 @@ -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" diff --git a/packaging/container-build.sh b/packaging/container-build.sh index 01cc281..bdc7d4f 100755 --- a/packaging/container-build.sh +++ b/packaging/container-build.sh @@ -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 @@ -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 @@ -33,33 +33,52 @@ 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/sources.list.d/winehq-${codename}.sources" \ + "https://dl.winehq.org/wine-builds/ubuntu/dists/${codename}/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" @@ -75,9 +94,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 diff --git a/packaging/container-test.sh b/packaging/container-test.sh index 453dfde..213c350 100755 --- a/packaging/container-test.sh +++ b/packaging/container-test.sh @@ -1,5 +1,5 @@ #!/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 @@ -7,6 +7,7 @@ # 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 deb="${1:?usage: container-test.sh path/to/uuway.deb}" export DEBIAN_FRONTEND=noninteractive @@ -78,7 +79,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', @@ -94,6 +95,16 @@ 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 + # 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/backends/amd/native-presenter/"* || "$file" == "$lib/build/native-presenter/"*) ]]; then + case "$(basename "$file")" in + uurb-nvenc-encode.dll.so|uu-pipewire-native-probe|uu-vaapi-probe) continue ;; + esac + fi [ "$(head -c4 "$file" | tail -c3)" = ELF ] || continue ldd "$file" 2>/dev/null | awk -v f="$file" '/not found/ {print f ": " $1}' done < <(find "$lib" -type f) diff --git a/packaging/deb/control.in b/packaging/deb/control.in index d76eac5..6bf5a8d 100644 --- a/packaging/deb/control.in +++ b/packaging/deb/control.in @@ -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 diff --git a/packaging/deb_manifest.py b/packaging/deb_manifest.py index 55f3e86..0478781 100644 --- a/packaging/deb_manifest.py +++ b/packaging/deb_manifest.py @@ -158,6 +158,12 @@ def files(): for name in HELPERS: mode = 0o755 if name in EXECUTABLE_HELPERS else 0o644 entries.append((f'build/helpers/{name}', f'{LIB}/build/helpers/{name}', mode)) + # Ubuntu 26.04 ships a newer FFmpeg ABI. Keep its three ABI-dependent AMD + # binaries beside the Ubuntu 24.04 build and select them at runtime. + compat_names = sorted(AMD_BACKEND_EXTRA + ('uurb-nvenc-encode.dll.so', 'uu-pipewire-native-probe')) + compat = [f'build/compat/ubuntu26/{name}' for name in compat_names] + if all((Path(__file__).resolve().parents[1] / source).is_file() for source in compat): + entries.extend((source, f'{LIB}/{source}', 0o755) for source in compat) return entries diff --git a/packaging/release-notes.md b/packaging/release-notes.md index bf33279..af995fd 100644 --- a/packaging/release-notes.md +++ b/packaging/release-notes.md @@ -1,5 +1,6 @@ ## 中文 +- Ubuntu 安装包同时携带 Ubuntu 24.04 和 26.04 的 FFmpeg ABI,按本机系统自动选择 AMD 运行时,修复 Ubuntu 26.04 无法安装旧版依赖的问题。(#24) - 提高原生桥接在高负载和 UU 4.46 启动较慢时的稳定性,延长显示拓扑查询、输入就绪检测和启动等待时间。(#23) - 为显示、文本和桥接用户服务补齐会话 D-Bus 环境,并为直接启动增加环境回退。 - 将桥接服务内存软限制/硬限制提高至 5/6 GiB,允许最多 2 GiB swap,减少 4K/NVENC 与内置 WebView 同时运行时的内存回收停顿。 @@ -12,6 +13,7 @@ ## English +- Carry both Ubuntu 24.04 and 26.04 FFmpeg ABIs in the Ubuntu package and select the matching AMD runtime locally, fixing installation on Ubuntu 26.04 with the old dependency set. (#24) - Improve native bridge startup under load and during slower UU 4.46 initialization, with longer display-topology, input-readiness and startup deadlines. (#23) - Supply session D-Bus environment variables to display, text and bridge user services, with an environment fallback for direct launches. - Raise the bridge memory high/max limits to 5/6 GiB and allow up to 2 GiB swap, reducing reclaim stalls with 4K/NVENC and the embedded WebView. diff --git a/packaging/stage-deb.py b/packaging/stage-deb.py index 3d4e294..fd8ee7a 100755 --- a/packaging/stage-deb.py +++ b/packaging/stage-deb.py @@ -26,6 +26,7 @@ CONFFILES = () # nothing under /etc: the package must not change apt's behaviour on its own # Provided by the NVIDIA driver on the user's machine, never by a package we depend on. DRIVER_LIBS = re.compile(r'libcuda\.so|libnvidia-') +FFMPEG_LIBS = re.compile(r'lib(?:avcodec|avutil|swscale)') ELF_MAGIC = b'\x7fELF' PE_MAGIC = b'MZ' @@ -72,6 +73,8 @@ def elf_files(stage): for path in sorted(stage.rglob('*')): if path.is_symlink() or not path.is_file(): continue + if 'compat' in path.relative_to(stage).parts: + continue # The Fcitx5 add-on is only ever loaded by fcitx5, which brings its own libraries; # fcitx5 stays a Recommends so a UUWay install does not pull the framework in. if 'fcitx5' in path.relative_to(stage).parts: @@ -82,7 +85,7 @@ def elf_files(stage): return found -def shlibs_depends(stage): +def shlibs_depends(stage, *, exclude_ffmpeg=False): """Let dpkg-shlibdeps name the packages that provide the native libraries.""" binaries = elf_files(stage) if not binaries or not shutil.which('dpkg-shlibdeps'): @@ -110,7 +113,8 @@ def shlibs_depends(stage): sys.stderr.write(result.stderr) match = re.search(r'^shlibs:Depends=(.*)$', result.stdout, re.M) names = [item.strip() for item in match.group(1).split(',')] if match else [] - return [item for item in names if item and not DRIVER_LIBS.search(item)] + return [item for item in names if item and not DRIVER_LIBS.search(item) + and not (exclude_ffmpeg and FFMPEG_LIBS.search(item))] DAYS = ('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun') @@ -186,7 +190,10 @@ def main(): (stage / 'usr/lib/uuway/package-info.json').write_text(json.dumps(dict( version=args.version, target='ubuntu', format='deb', ota=True, wine='11.0'), indent=2) + '\n') write_changelog(stage, args.version, epoch) - depends = None if args.no_shlibs else shlibs_depends(stage) + # FFmpeg is a generic runtime dependency. The package carries both + # Ubuntu 24.04 and 26.04 AMD binaries and chooses the matching ABI at + # runtime, so dpkg must not record one build's SONAME here. + depends = None if args.no_shlibs else shlibs_depends(stage, exclude_ffmpeg=True) if depends is None and not args.no_shlibs: print('warning: dpkg-shlibdeps unavailable; native library dependencies not computed', file=sys.stderr) diff --git a/packaging/test-deb.sh b/packaging/test-deb.sh index d30d5bc..8a5c8d8 100755 --- a/packaging/test-deb.sh +++ b/packaging/test-deb.sh @@ -1,30 +1,38 @@ #!/usr/bin/env bash -# Install a built uuway .deb into a throwaway, clean Ubuntu 24.04 docker container and run +# Install a built uuway .deb into a throwaway, clean Ubuntu docker container and run # packaging/container-test.sh against it. # -# packaging/test-deb.sh path/to/uuway_X_amd64.deb [--keep] [--no-lint] +# packaging/test-deb.sh [--target ubuntu-24.04|ubuntu-26.04] path/to/uuway_X_amd64.deb +# [--keep] [--no-lint] set -Eeuo pipefail repo_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)" deb="" +target="ubuntu-24.04" keep=0 lint=1 -for argument in "$@"; do - case "$argument" in - --keep) keep=1 ;; - --no-lint) lint=0 ;; - -h|--help) sed -n '2,6p' "${BASH_SOURCE[0]}"; exit 0 ;; - *) deb="$argument" ;; +while (($#)); do + case "$1" in + --target) target="${2:?--target needs a value}"; shift 2 ;; + --keep) keep=1; shift ;; + --no-lint) lint=0; shift ;; + -h|--help) sed -n '2,7p' "${BASH_SOURCE[0]}"; exit 0 ;; + *) deb="$1"; shift ;; esac done [[ -f "$deb" ]] || { printf 'usage: %s path/to/uuway.deb\n' "$0" >&2; exit 2; } 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 name="uuway-test-$$" cleanup() { ((keep)) || docker rm -f "$name" >/dev/null 2>&1 || true; } trap cleanup EXIT -docker run -d --name "$name" ubuntu:24.04 sleep infinity >/dev/null +docker run -d --name "$name" "$image" sleep infinity >/dev/null docker cp "$deb" "$name:/tmp/uuway.deb" docker cp "$repo_dir/packaging/container-test.sh" "$name:/tmp/container-test.sh" docker cp "$repo_dir/packaging/update-e2e.py" "$name:/tmp/update-e2e.py" diff --git a/scripts/uuway_cli.py b/scripts/uuway_cli.py index d9f66d0..8a0762d 100755 --- a/scripts/uuway_cli.py +++ b/scripts/uuway_cli.py @@ -441,7 +441,12 @@ def wine_run(ctx): if not ctx.confirm('现在用 sudo 添加 WineHQ 软件源并安装 winehq-stable 11.0?'): raise SetupError('缺少 WineHQ stable 11.0,已停止。') sudo = ['sudo'] - ctx.run(sudo + ['dpkg', '--add-architecture', 'i386']) + release = platform.os_release() + series = '=11.0.*' + wine_packages = ['winehq-stable' + series, 'wine-stable' + series] + if release.get('VERSION_ID') != '26.04': + ctx.run(sudo + ['dpkg', '--add-architecture', 'i386']) + wine_packages += ['wine-stable-amd64' + series, 'wine-stable-i386:i386' + series] if not list(Path('/etc/apt/sources.list.d').glob('winehq*')): ctx.run(sudo + ['install', '-d', '-m', '0755', '/etc/apt/keyrings']) ctx.run(sudo + ['curl', '-fsSLo', '/etc/apt/keyrings/winehq-archive.asc', @@ -454,10 +459,7 @@ def wine_run(ctx): info('已有 WineHQ 软件源配置,保持不变。') ctx.run(wine_pin_command(ctx)) ctx.run(sudo + ['apt-get', 'update']) - series = '=11.0.*' - ctx.run(sudo + ['apt-get', 'install', '-y', '--install-recommends', - 'winehq-stable' + series, 'wine-stable' + series, 'wine-stable-amd64' + series, - 'wine-stable-i386:i386' + series]) + ctx.run(sudo + ['apt-get', 'install', '-y', '--install-recommends'] + wine_packages) if not ctx.dry_run and not platform.wine_compatible(wine_version(ctx)): raise SetupError(f'装好的 WineHQ 不是 11.0 版({wine_version(ctx) or "未找到"})。') diff --git a/scripts/uuway_platform.py b/scripts/uuway_platform.py index b312a94..5c33dea 100644 --- a/scripts/uuway_platform.py +++ b/scripts/uuway_platform.py @@ -9,8 +9,11 @@ PACKAGE_ROOT = Path('/usr/lib/uuway') PRIVATE_WINE = Path('/opt/uuway-wine11/bin') -# Only these AMD files link FFmpeg. Fedora's shared RPM carries both ABIs. -FEDORA_AMD_VARIANTS = frozenset(('uurb-nvenc-encode.dll.so', 'uu-pipewire-native-probe', 'uu-vaapi-probe')) +# Only these AMD files link FFmpeg. The Ubuntu package carries both ABI builds +# and selects the one matching the host, just like the shared Fedora RPM. +FFMPEG_AMD_VARIANTS = frozenset(('uurb-nvenc-encode.dll.so', 'uu-pipewire-native-probe', 'uu-vaapi-probe')) +FEDORA_AMD_VARIANTS = FFMPEG_AMD_VARIANTS +UBUNTU_AMD_VARIANTS = FFMPEG_AMD_VARIANTS def os_release(path=Path('/etc/os-release')): @@ -55,10 +58,15 @@ def private_wine(): def backend_file(root, backend, name, release=None): root = Path(root) release = os_release() if release is None else release - if backend == 'amd' and name in FEDORA_AMD_VARIANTS and release.get('ID') == 'fedora' and release.get('VERSION_ID') == '45': - variant = root / 'build/compat/fedora45' / name - if variant.is_file(): - return variant + if backend == 'amd' and name in FFMPEG_AMD_VARIANTS: + if release.get('ID') == 'fedora' and release.get('VERSION_ID') == '45': + variant = root / 'build/compat/fedora45' / name + if variant.is_file(): + return variant + if release.get('ID') == 'ubuntu' and release.get('VERSION_ID') == '26.04': + variant = root / 'build/compat/ubuntu26' / name + if variant.is_file(): + return variant return root / 'build/backends' / backend / 'native-presenter' / name diff --git a/tests/test_fedora_bundle.py b/tests/test_fedora_bundle.py index 4e7ca4f..e557442 100644 --- a/tests/test_fedora_bundle.py +++ b/tests/test_fedora_bundle.py @@ -26,6 +26,19 @@ def test_only_ffmpeg_components_switch_on_fedora45(self): self.assertEqual(platform.backend_file(root, 'amd', 'uu-native-input', dict(ID='fedora', VERSION_ID='45')), root / 'build/backends/amd/native-presenter/uu-native-input') + def test_only_ffmpeg_components_switch_on_ubuntu26(self): + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + compat = root / 'build/compat/ubuntu26' + compat.mkdir(parents=True) + for name in platform.UBUNTU_AMD_VARIANTS: + (compat / name).write_bytes(b'variant') + self.assertEqual(platform.backend_file(root, 'amd', name, + dict(ID='ubuntu', VERSION_ID='26.04')), compat / name) + self.assertEqual(platform.backend_file(root, 'amd', name, + dict(ID='ubuntu', VERSION_ID='24.04')), + root / 'build/backends/amd/native-presenter' / name) + if __name__ == '__main__': unittest.main() From 62d044a29f851cb8ca29759eb66bd76a1b6b3b02 Mon Sep 17 00:00:00 2001 From: GaryOAO <62834599+GaryOAO@users.noreply.github.com> Date: Fri, 20 Nov 2026 13:21:17 +0800 Subject: [PATCH 2/6] fix: use WineHQ armored key in Ubuntu builds --- packaging/container-build.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packaging/container-build.sh b/packaging/container-build.sh index bdc7d4f..97a39a6 100755 --- a/packaging/container-build.sh +++ b/packaging/container-build.sh @@ -70,9 +70,11 @@ if ! dpkg-query -W -f='${Version}' winehq-stable 2>/dev/null | grep -qx "$wine_v 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/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 wine_packages=("winehq-stable=$wine_version" "wine-stable=$wine_version") if [[ "$target" == ubuntu-24.04 ]]; then From 86049b6f3a51d848f295a8770ae5e4a592338b16 Mon Sep 17 00:00:00 2001 From: GaryOAO <62834599+GaryOAO@users.noreply.github.com> Date: Fri, 20 Nov 2026 13:44:04 +0800 Subject: [PATCH 3/6] fix: allow unstripped Ubuntu compatibility binaries --- packaging/deb/lintian-overrides | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/deb/lintian-overrides b/packaging/deb/lintian-overrides index ca46f8b..907b359 100644 --- a/packaging/deb/lintian-overrides +++ b/packaging/deb/lintian-overrides @@ -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:*] From e6b4b3033383715902eb5ec613dd6257fe4be7d1 Mon Sep 17 00:00:00 2001 From: GaryOAO <62834599+GaryOAO@users.noreply.github.com> Date: Fri, 20 Nov 2026 14:06:12 +0800 Subject: [PATCH 4/6] fix: ignore inactive Ubuntu FFmpeg variants --- packaging/container-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/container-test.sh b/packaging/container-test.sh index 213c350..0f6a8eb 100755 --- a/packaging/container-test.sh +++ b/packaging/container-test.sh @@ -100,7 +100,7 @@ elf_missing() { if [[ "${VERSION_ID:-}" != 26.04 && "$file" == "$lib/build/compat/ubuntu26/"* ]]; then continue fi - if [[ "${VERSION_ID:-}" == 26.04 && ("$file" == "$lib/build/backends/amd/native-presenter/"* || "$file" == "$lib/build/native-presenter/"*) ]]; then + 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 From e8d1de8a85974976d9fd697f849fe392d9d1a968 Mon Sep 17 00:00:00 2001 From: GaryOAO <62834599+GaryOAO@users.noreply.github.com> Date: Fri, 20 Nov 2026 14:31:54 +0800 Subject: [PATCH 5/6] test: show native dependency failures clearly --- packaging/container-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/container-test.sh b/packaging/container-test.sh index 0f6a8eb..8f13a43 100755 --- a/packaging/container-test.sh +++ b/packaging/container-test.sh @@ -105,7 +105,7 @@ elf_missing() { uurb-nvenc-encode.dll.so|uu-pipewire-native-probe|uu-vaapi-probe) continue ;; esac fi - [ "$(head -c4 "$file" | tail -c3)" = ELF ] || continue + [ "$(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) } From 7e0ca98e17f8f97fdcb085176796ca712e89aecf Mon Sep 17 00:00:00 2001 From: GaryOAO <62834599+GaryOAO@users.noreply.github.com> Date: Fri, 20 Nov 2026 14:51:17 +0800 Subject: [PATCH 6/6] fix: export Ubuntu version to package checks --- packaging/container-test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/container-test.sh b/packaging/container-test.sh index 8f13a43..457d03d 100755 --- a/packaging/container-test.sh +++ b/packaging/container-test.sh @@ -8,6 +8,7 @@ # 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