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
52 changes: 2 additions & 50 deletions .github/workflows/linux-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ jobs:
- name: Unit and UI tests
run: env -u WAYLAND_DISPLAY GDK_BACKEND=x11 UUWAY_UI_TESTS=1 xvfb-run -a dbus-run-session -- /usr/bin/python3 -m pytest tests -q -p no:cacheprovider
- name: Shell scripts
run: shellcheck -S warning install.sh packaging/*.sh packaging/deb/postinst packaging/deb/prerm packaging/deb/postrm scripts/build-*.sh scripts/install-wine11.sh
run: shellcheck -S warning install.sh packaging/*.sh packaging/deb/postinst packaging/deb/prerm packaging/deb/postrm scripts/build-*.sh scripts/install-wine11.sh scripts/prepare-wine-headers.sh
native:
needs: test
runs-on: ubuntu-24.04
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
target: [debian-13, fedora-44, fedora-45, arch]
target: [debian-13, fedora, arch]
steps:
- uses: actions/checkout@v4
- name: Build and install-check UUWay with official Wine 11.0 binaries
Expand All @@ -58,54 +58,6 @@ jobs:
with:
name: uuway-${{ matrix.target }}
path: out/
fedora:
needs: native
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: uuway-fedora-44
path: input44
- uses: actions/download-artifact@v4
with:
name: uuway-fedora-45
path: input45
- name: Assemble one Fedora RPM with automatic FFmpeg ABI selection
env:
VERSION: ${{ inputs.version || '1.5.3~ci' }}
run: |
mkdir -p out
docker run --rm -e VERSION -v "$PWD:/source:ro" -v "$PWD/out:/result" fedora:44 bash -c '
set -e
dnf install -y --setopt=install_weak_deps=False python3 rpm-build cpio
python3 /source/packaging/combine-fedora.py --version "$VERSION" \
--fedora44 /source/input44/*.rpm --fedora45 /source/input45/*.rpm --output-dir /result
'
- uses: actions/upload-artifact@v4
with:
name: uuway-fedora
path: out/
fedora-check:
needs: fedora
runs-on: ubuntu-24.04
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
version: ['44', '45']
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: uuway-fedora
path: out
- name: Install and update the same RPM on each Fedora version
env:
FEDORA_VERSION: ${{ matrix.version }}
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-compat:
needs: test
runs-on: ubuntu-24.04
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
f'uuway-{version}-1.fedora.x86_64.rpm',
f'uuway-{arch_version}-1-x86_64.pkg.tar.zst']
assert all((root / name).is_file() for name in names), names
# Version-specific Fedora builds are CI inputs; publish only the shared RPM.
# Keep the release packages and generate one checksum file for all of them.
for path in root.iterdir():
if path.is_file() and path.name not in names:
path.unlink()
Expand Down
9 changes: 6 additions & 3 deletions docs/linux-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ and code contributions via [PRs](https://github.com/GaryOAO/UUWay/compare) are w
| Target | Build image | Outputs |
| --- | --- | --- |
| `debian-13` | Debian 13 | UUWay `.deb` |
| Fedora | Fedora 44 + 45 | one shared UUWay `.rpm` |
| `fedora` | Fedora 44 + 45 | one shared UUWay `.rpm` |
| `arch` | Arch Linux | UUWay `.pkg.tar.zst`, generated PKGBUILD |

All builds are x86_64 and carry NVIDIA NVENC and AMD VA-API backends. GPU drivers
Expand Down Expand Up @@ -35,6 +35,7 @@ Compiled host artifacts and host packages are never used or changed.

```bash
packaging/build-linux.sh --target debian-13 --version 1.5.0
packaging/build-linux.sh --target fedora --version 1.5.0
packaging/build-linux.sh --target arch --version 1.5.0
```

Expand All @@ -43,8 +44,10 @@ Outputs go to `build/linux/<target>/`. Use `--output-dir DIR` to override it;
`UUWAY_BUILD_CPUS` default to 8; set both to 4 for concurrent local builds. The
build downloads official prebuilt Wine 11.0 and compiles only UUWay.
The **Experimental Linux packages** GitHub Actions workflow builds Ubuntu and all
the native targets and uploads artifacts. Fedora builds are combined into one RPM,
then that same package is install-checked on both Fedora 44 and 45.
the native targets and uploads artifacts. The Fedora target compiles the common
files on Fedora 44 and builds three AMD components against Fedora 45's FFmpeg
libraries as well. It packages the files directly into one RPM, then checks
installation, updates and rollback with that RPM on both Fedora 44 and 45.
The **Release** workflow runs these checks before assembling a complete draft release.

A second, clean container installs the resulting packages without the build
Expand Down
53 changes: 42 additions & 11 deletions packaging/build-linux.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Build distribution-native UUWay using official prebuilt Wine 11.0.
# Usage: packaging/build-linux.sh --target debian-13|fedora-44|fedora-45|arch --version 1.4.3
# Usage: packaging/build-linux.sh --target debian-13|fedora|arch --version X.Y.Z
set -Eeuo pipefail
repo_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
target='' version='' output_dir='' keep=0
Expand All @@ -15,6 +15,8 @@ while (($#)); do
esac
done
[[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+([.+~][A-Za-z0-9.]+)?$ ]] || { echo '--version must be X.Y.Z (optionally +/~ suffix)' >&2; exit 2; }
case "$target" in fedora-44|fedora-45) target=fedora ;; esac
output_dir="${output_dir:-$repo_dir/build/linux/$target}"
image="$(python3 - "$repo_dir" "$target" <<'PY'
import json, pathlib, sys
targets = json.loads((pathlib.Path(sys.argv[1]) / 'packaging/linux-targets.json').read_text())
Expand All @@ -23,14 +25,33 @@ if sys.argv[2] not in targets:
print(targets[sys.argv[2]]['image'])
PY
)"
output_dir="${output_dir:-$repo_dir/build/linux/$target}"
name="uuway-$target-$$"
cleanup() { ((keep)) || docker rm -f "$name" >/dev/null 2>&1 || true; }
containers=()
start_builder() {
local container="$1" build_image="$2"
docker run -d --name "$container" --cpus "${UUWAY_BUILD_CPUS:-8}" "$build_image" sleep infinity >/dev/null
containers+=("$container")
git -C "$repo_dir" ls-files -z --cached --others --exclude-standard --deduplicate |
tar -C "$repo_dir" --null -T - -cf - |
docker exec -i "$container" sh -c 'mkdir -p /work/UUWay && tar xf - -C /work/UUWay'
}
cleanup() {
if ((!keep && ${#containers[@]})); then docker rm -f "${containers[@]}" >/dev/null || true; fi
}
trap cleanup EXIT
docker run -d --name "$name" --cpus "${UUWAY_BUILD_CPUS:-8}" "$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'
start_builder "$name" "$image"
if [[ "$target" == fedora ]]; then
compat="$name-compat"
start_builder "$compat" fedora:45
docker exec -w /work/UUWay "$compat" bash packaging/container-fedora-compat.sh /work/compat
compat_dir=/work/UUWay/build/compat/fedora45
docker exec "$name" mkdir -p "$compat_dir"
docker exec -w /work/compat "$compat" tar cf - . | docker exec -i -w "$compat_dir" "$name" tar xf -
if ((!keep)); then
docker rm -f "$compat" >/dev/null
containers=("$name")
fi
fi
# Cache downloads only; compiled host artifacts never enter a distribution build.
if [[ -d "$repo_dir/build/multidistro/downloads" ]]; then
docker exec "$name" mkdir -p /work/UUWay/build/multidistro
Expand All @@ -41,9 +62,19 @@ docker exec -e "SOURCE_DATE_EPOCH=$(git -C "$repo_dir" log -1 --format=%ct)" \
bash packaging/container-linux-build.sh "$target" "$version" /work/out
mkdir -p "$output_dir"
docker cp "$name:/work/out/." "$output_dir/"
# Resolve runtime dependencies again in a pristine image, without build packages.
cleanup
containers=()
# Resolve runtime dependencies in a pristine image for each supported release.
output_dir="$(cd "$output_dir" && pwd)"
docker run --rm -i --mount "type=bind,source=$output_dir,target=/packages,readonly" \
--mount "type=bind,source=$repo_dir,target=/source,readonly" \
"$image" bash -s -- "$target" /packages < "$repo_dir/packaging/container-linux-test.sh"
install_check() {
docker run --rm -i --mount "type=bind,source=$output_dir,target=/packages,readonly" \
--mount "type=bind,source=$repo_dir,target=/source,readonly" \
"$1" bash -s -- "$2" /packages < "$repo_dir/packaging/container-linux-test.sh"
}
if [[ "$target" == fedora ]]; then
install_check "$image" fedora-44
install_check fedora:45 fedora-45
else
install_check "$image" "$target"
fi
printf '\nBuilt and install-checked %s packages in %s\n' "$target" "$output_dir"
69 changes: 0 additions & 69 deletions packaging/combine-fedora.py

This file was deleted.

15 changes: 15 additions & 0 deletions packaging/container-fedora-compat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
# Build the Fedora 45 components that link to the distribution's FFmpeg.
set -Eeuo pipefail
output="${1:?output directory}"
repo_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
# shellcheck source=/dev/null
. /etc/os-release
[[ $EUID == 0 && "$ID:$VERSION_ID" == fedora:45 ]] || { echo 'Run in a Fedora 45 build container.' >&2; exit 2; }
dnf install -y --setopt=install_weak_deps=False \
ca-certificates curl git gcc gcc-c++ mingw64-gcc pkgconf-pkg-config dpkg \
pipewire-devel libdrm-devel vulkan-headers vulkan-loader-devel glslang glslang-devel \
ffmpeg-free-devel libva-devel
bash "$repo_dir/scripts/install-wine11.sh" fedora-45 --build-tools
bash "$repo_dir/scripts/prepare-wine-headers.sh"
UURB_WINE_BIN=/opt/uuway-wine11/usr/bin bash "$repo_dir/scripts/build-amd-runtime.sh" --ffmpeg-only "$output"
8 changes: 5 additions & 3 deletions packaging/container-linux-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ case "$target:${ID:-}:${VERSION_ID:-}" in
glslang-tools libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libfcitx5core-dev \
libfcitx5utils-dev libavcodec-dev libavutil-dev libswscale-dev libva-dev
;;
fedora-44:fedora:44|fedora-45:fedora:45)
fedora:fedora:44)
dnf install -y --setopt=install_weak_deps=False ca-certificates curl git ripgrep python3 gcc gcc-c++ \
make mingw64-gcc mingw64-gcc-c++ meson ninja-build \
pkgconf-pkg-config xz dpkg rpm-build python3-rpm \
Expand All @@ -36,7 +36,9 @@ case "$target:${ID:-}:${VERSION_ID:-}" in
*) echo "Target $target does not match ${PRETTY_NAME:-unknown}" >&2; exit 2 ;;
esac
cd "$repo_dir"
bash scripts/install-wine11.sh "$target" --build-tools
wine_target="$target"
if [[ "$target" == fedora ]]; then wine_target=fedora-44; fi
bash scripts/install-wine11.sh "$wine_target" --build-tools
# CUDA link stubs and headers are build inputs, never installed in a runtime package.
mkdir -p build/multidistro/downloads
cuda_base=https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64
Expand All @@ -51,7 +53,7 @@ cuda-driver-dev-12-1_12.1.105-1_amd64.deb 49a0807b1f37da920a9417b3fa16d5e281c306
CUDA
ln -sfn cuda-12.1 /usr/local/cuda
UURB_WINE_BIN=/opt/wine-stable/bin
[[ "$target" != arch && "$target" != fedora-45 ]] || UURB_WINE_BIN=/opt/uuway-wine11/usr/bin
[[ "$target" != arch ]] || UURB_WINE_BIN=/opt/uuway-wine11/usr/bin
export UURB_WINE_BIN
export UURB_USE_SYSTEM_TOOLCHAIN=1 UURB_PIPEWIRE_HEADERS=/usr/include
UURB_GLSLANG="$(command -v glslangValidator)"
Expand Down
19 changes: 14 additions & 5 deletions packaging/container-linux-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,17 @@ for backend in nvidia amd; do
runuser -u uuway-test -- /usr/bin/python3 /usr/lib/uuway/scripts/package-uu-native-runtime.py \
package --with-input --backend "$backend" "/home/uuway-test/releases/$backend" > "/tmp/uuway-$backend.json"
done
python3 - "$output" <<'PY'
python3 - "$output" "$target" <<'PY'
import json, pathlib, subprocess, sys
root = pathlib.Path('/usr/lib/uuway')
info = json.loads((root / 'package-info.json').read_text())
sys.path.insert(0, str(root / 'scripts'))
import uuway_platform as platform
release = platform.os_release()
if sys.argv[2].startswith('fedora-'):
assert sys.argv[2] == f"fedora-{release['VERSION_ID']}"
assert info['target'] == 'fedora' and info['format'] == 'rpm', info
assert set(info['fedora_versions']) == {'44', '45'}, info
for backend in ('nvidia', 'amd'):
bundle = json.loads(pathlib.Path(f'/tmp/uuway-{backend}.json').read_text())['bundle']
subprocess.run(['runuser', '-u', 'uuway-test', '--', '/usr/bin/python3',
Expand Down Expand Up @@ -85,14 +89,19 @@ assert control['Architecture'] == update.TARGETS[info['target']][1]
expected_version = info['version'].replace('~', '.').replace('+', '.') if info['format'] == 'arch' else info['version']
assert control['Version'] == expected_version, control
if info['target'] == 'fedora':
assert packages[0].name == update.package_name(info['version'], 'fedora'), packages
import importlib.util
spec = importlib.util.spec_from_file_location('packager', root / 'scripts/package-uu-native-runtime.py')
packager = importlib.util.module_from_spec(spec)
spec.loader.exec_module(packager)
for source in ('build/native-presenter/uurb-nvenc-encode.dll.so',
'build/native-presenter/uu-pipewire-native-probe'):
selected = packager.backend_inputs('amd', {'file': source})['file']
assert ('compat/fedora45' in selected) == (release['VERSION_ID'] == '45'), selected
baseline = root / 'build/backends/amd/native-presenter'
compat = root / 'build/compat/fedora45'
assert {path.name for path in compat.iterdir()} == platform.FEDORA_AMD_VARIANTS
for name in platform.FEDORA_AMD_VARIANTS:
assert (baseline / name).is_file() and (compat / name).is_file(), name
expected = (compat if release['VERSION_ID'] == '45' else baseline) / name
selected = root / packager.backend_inputs('amd', {'file': f'build/native-presenter/{name}'})['file']
assert selected == expected, selected
print('Target-aware OTA asset:', update.package_name('1.5.0', info['target']))
print('Both GPU bundles verify; installed ELF dependencies resolve. Live desktop acceptance remains required.')
PY
Expand Down
4 changes: 2 additions & 2 deletions packaging/deb_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
)
BACKEND_NAMES = ('nvidia', 'amd')
AMD_BACKEND_EXTRA = ('uu-vaapi-probe',)
FFMPEG_AMD_COMPONENTS = (*AMD_BACKEND_EXTRA, 'uurb-nvenc-encode.dll.so', 'uu-pipewire-native-probe')
EXECUTABLE_ELF = {'uu-native-input', 'uu-pipewire-native-probe', 'uu-pipewire-dmabuf-probe', 'uu-vaapi-probe'}

DXVK_STAGE = ('dxgi.dll', 'd3d11.dll', 'DXVK_LICENSE')
Expand Down Expand Up @@ -160,8 +161,7 @@ def files():
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]
compat = [f'build/compat/ubuntu26/{name}' for name in sorted(FFMPEG_AMD_COMPONENTS)]
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
Expand Down
12 changes: 3 additions & 9 deletions packaging/linux-targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,16 @@
"suite": "trixie",
"label": "Debian 13"
},
"fedora-44": {
"fedora": {
"image": "fedora:44",
"format": "rpm",
"suite": "fedora44",
"label": "Fedora 44"
"suite": "fedora",
"label": "Fedora 44 / 45"
},
"arch": {
"image": "archlinux:base-devel",
"format": "arch",
"suite": "arch",
"label": "Arch Linux"
},
"fedora-45": {
"image": "fedora:45",
"format": "rpm",
"suite": "fedora45",
"label": "Fedora 45"
}
}
Loading
Loading