Set license = "MIT" (Cargo.toml), add the MIT LICENSE file, and switch the
PKGBUILD to license=('MIT'). Generate a THIRD_PARTY_LICENSES file enumerating
the full dependency-graph manifest plus the canonical text of every referenced
license, with notices for the statically-bundled Opus codec and the embedded
fonts (Iced-Icons, Cantarell/OFL-1.1). Ship both files in the .deb and Arch
packages. Update README License section and stale private-build metadata.
Codex (gpt-5.5) audited the tree and confirmed no copyleft blocks MIT; the
remaining items were asset provenance + binary-distribution notice hygiene,
which THIRD_PARTY_LICENSES addresses.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
79 lines
2.7 KiB
Bash
79 lines
2.7 KiB
Bash
# Maintainer: mollusk <jitty+lc1iz0dc@protonmail.com>
|
|
pkgname=peerspeak-git
|
|
_pkgname=peerspeak
|
|
pkgver=0.5.0.r0.g0000000
|
|
pkgrel=1
|
|
pkgdesc="Decentralized peer-to-peer voice chat (Rust/iroh/PipeWire/Opus/iced)"
|
|
arch=('x86_64')
|
|
url="https://gitbutter.xyz/mollusk/peerspeak"
|
|
license=('MIT')
|
|
depends=('pipewire' 'opus')
|
|
makedepends=('git' 'cargo' 'pkgconf')
|
|
optdepends=('pixelpass: screen sharing inside a room'
|
|
'mpv: screen-share viewer (vlc is used as a fallback)')
|
|
provides=('peerspeak')
|
|
conflicts=('peerspeak')
|
|
options=('!lto' '!debug')
|
|
source=("$_pkgname::git+https://gitbutter.xyz/mollusk/peerspeak.git")
|
|
sha256sums=('SKIP')
|
|
|
|
pkgver() {
|
|
cd "$srcdir/$_pkgname"
|
|
# 0.1.0.r<commits>.g<short-sha> — sorts monotonically across rebuilds.
|
|
printf '%s.r%s.g%s' \
|
|
"$(awk -F'\"' '/^version =/{print $2; exit}' Cargo.toml)" \
|
|
"$(git rev-list --count HEAD)" \
|
|
"$(git rev-parse --short HEAD)"
|
|
}
|
|
|
|
prepare() {
|
|
cd "$srcdir/$_pkgname"
|
|
# Vendor deps up front so build() can run --frozen (no surprise network).
|
|
export CARGO_HOME="$srcdir/cargo-home"
|
|
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
|
|
}
|
|
|
|
build() {
|
|
cd "$srcdir/$_pkgname"
|
|
export CARGO_HOME="$srcdir/cargo-home"
|
|
export RUSTUP_TOOLCHAIN=stable
|
|
export CARGO_TARGET_DIR=target
|
|
# Strip the build directory out of paths embedded in the binary (Rust bakes
|
|
# source paths into panic/backtrace metadata that survives stripping), so the
|
|
# package doesn't reference $srcdir. One remap covers our sources and the
|
|
# vendored deps, since CARGO_HOME lives under $srcdir too.
|
|
export RUSTFLAGS="${RUSTFLAGS:-} --remap-path-prefix=$srcdir=/"
|
|
cargo build --frozen --release --bin "$_pkgname"
|
|
}
|
|
|
|
check() {
|
|
cd "$srcdir/$_pkgname"
|
|
export CARGO_HOME="$srcdir/cargo-home"
|
|
export RUSTUP_TOOLCHAIN=stable
|
|
# Library unit tests only — the integration suites bind real iroh/QUIC
|
|
# endpoints and fail in a sandboxed/offline build environment.
|
|
cargo test --frozen --release --lib
|
|
}
|
|
|
|
package() {
|
|
cd "$srcdir/$_pkgname"
|
|
|
|
install -Dm755 "target/release/$_pkgname" "$pkgdir/usr/bin/$_pkgname"
|
|
install -Dm644 "packaging/$_pkgname.desktop" \
|
|
"$pkgdir/usr/share/applications/$_pkgname.desktop"
|
|
|
|
# Hicolor icon theme (scalable SVG + the rendered raster sizes).
|
|
install -Dm644 "assets/icons/$_pkgname.svg" \
|
|
"$pkgdir/usr/share/icons/hicolor/scalable/apps/$_pkgname.svg"
|
|
local s
|
|
for s in 16 24 32 48 64 128 256 512; do
|
|
install -Dm644 "assets/icons/$_pkgname-$s.png" \
|
|
"$pkgdir/usr/share/icons/hicolor/${s}x${s}/apps/$_pkgname.png"
|
|
done
|
|
|
|
# License + third-party attribution notices.
|
|
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$_pkgname/LICENSE"
|
|
install -Dm644 THIRD_PARTY_LICENSES \
|
|
"$pkgdir/usr/share/licenses/$_pkgname/THIRD_PARTY_LICENSES"
|
|
}
|