Files
gamescope-hyperhdr/contrib/PKGBUILD
T
oleksandr 9bb2d7d690 build(packaging): add the Arch package, systemd unit and gamescope config
The PKGBUILD builds from the surrounding source tree (makepkg's -flto is
disabled because it breaks the libspa-sys C shim). The user unit and the
env example ship the intended deployment, and gamescope-tv.conf documents the
gamescope session it is meant to run against.
2026-09-12 10:11:01 +03:00

65 lines
2.1 KiB
Bash

# Arch Linux package built from this source tree (the directory above this PKGBUILD).
#
# cd contrib && makepkg -si
pkgname=gamescope-hyperhdr
pkgver=0.1.0
pkgrel=1
pkgdesc="Feeds gamescope's PipeWire picture, downscaled by gamescope, to HyperHDR's flatbuffers server"
arch=('x86_64' 'aarch64')
license=('MIT')
depends=('libpipewire' 'libgcc' 'glibc')
makedepends=('cargo' 'clang' 'pkgconf')
optdepends=('wireplumber: links the capture stream to the gamescope node')
# makepkg's -flto turns libspa-sys' C shim into LTO bytecode that the Rust link step cannot
# resolve (undefined spa_*_libspa_rs symbols).
options=('!lto')
_tree() {
realpath "$startdir/.."
}
pkgver() {
sed -n 's/^version = "\(.*\)"$/\1/p' "$(_tree)/Cargo.toml" | head -n1
}
prepare() {
rm -rf "$srcdir/$pkgname"
mkdir -p "$srcdir/$pkgname"
cp -a "$(_tree)"/{Cargo.toml,Cargo.lock,src,tests,examples,schema} "$srcdir/$pkgname/"
cd "$srcdir/$pkgname"
export RUSTUP_TOOLCHAIN=stable
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}
build() {
cd "$srcdir/$pkgname"
export RUSTUP_TOOLCHAIN=stable
# Outside the copied tree, so rebuilds stay incremental.
export CARGO_TARGET_DIR="$srcdir/target"
cargo build --frozen --release --bin gamescope-hyperhdr
}
check() {
cd "$srcdir/$pkgname"
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR="$srcdir/target"
cargo test --frozen --release
}
package() {
local tree
tree="$(_tree)"
install -Dm755 "$srcdir/target/release/gamescope-hyperhdr" "$pkgdir/usr/bin/gamescope-hyperhdr"
install -Dm644 "$tree/contrib/systemd/gamescope-hyperhdr.service" \
"$pkgdir/usr/lib/systemd/user/gamescope-hyperhdr.service"
install -Dm644 "$tree/contrib/gamescope-hyperhdr.env.example" \
"$pkgdir/usr/share/doc/$pkgname/gamescope-hyperhdr.env.example"
install -Dm644 "$tree/contrib/systemd/gamescope-tv.conf" \
"$pkgdir/usr/share/doc/$pkgname/gamescope-tv.conf"
install -Dm644 "$tree/README.md" "$pkgdir/usr/share/doc/$pkgname/README.md"
install -Dm644 "$tree/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm644 "$tree/schema/NOTICE" "$pkgdir/usr/share/licenses/$pkgname/NOTICE.HyperHDR"
}