BlueGit

ict rusty-teams

Files

rusty-teams / packaging / aur-source / PKGBUILD

PKGBUILD

PKGBUILD 3.0 KiB Download Raw
1# Maintainer: KVT ICT <hephaestus@noreply.kvt.nl>
2# AUR package kvt-rusty-teams: the KVT build of Rusty Teams, built from source at a release tag
3# of git.kvt.nl/ict/rusty-teams. Next to kvt-rusty-teams-bin (prebuilt tarball from the release).
4# Bump _tag, _commit and pkgver together for a new release (see packaging/aur-source/README.md).
5pkgname=kvt-rusty-teams
6pkgver=0.6.1.kvt.4
7pkgrel=1
8_tag=v0.6.1-kvt.4
9_commit=e972869751c189818d20930bebdb6a0156b16db1
10pkgdesc='Native Microsoft Teams client in Rust (KVT build, built from source)'
11arch=('x86_64')
12url='https://git.kvt.nl/ict/rusty-teams'
13license=('MIT')
14depends=('glibc' 'gcc-libs' 'fontconfig' 'freetype2' 'libxkbcommon' 'libxkbcommon-x11'
15 'libx11' 'libxcb' 'wayland' 'alsa-lib' 'libpipewire' 'libva' 'glib2' 'hicolor-icon-theme')
16makedepends=('cargo' 'clang' 'mold' 'git' 'pkgconf' 'python'
17 'libxext' 'libxfixes' 'libxdamage' 'libxrandr' 'libxcomposite')
18options=('!lto' '!debug')
19provides=('rusty-teams')
20conflicts=('rusty-teams' 'rusty-teams-bin' 'rusty-teams-git' 'kvt-rusty-teams-bin')
21# The build downloads the prebuilt libwebrtc (webrtc-sys); cargo itself runs offline after prepare().
22source=("rusty-teams::git+https://git.kvt.nl/ict/rusty-teams.git#tag=${_tag}")
23sha256sums=('SKIP')
24
25prepare() {
26 cd rusty-teams
27 # The tag must still point at the commit this PKGBUILD was written for.
28 [[ "$(git rev-parse HEAD)" == "$_commit" ]] || { echo "tag $_tag is not commit $_commit" >&2; return 1; }
29 export RUSTUP_TOOLCHAIN=stable
30 cargo fetch --locked --target x86_64-unknown-linux-gnu
31}
32
33build() {
34 cd rusty-teams
35 export RUSTUP_TOOLCHAIN=stable CARGO_TARGET_DIR=target
36 # .cargo/config.toml links with clang and mold; webrtc-sys needs clang 21 or newer.
37 export CC=clang CXX=clang++
38 # makepkg's -O2/-flto flags land after the -O0 that aws-lc-sys's jitterentropy needs, and the
39 # vendored C and C++ code (libwebrtc glue, aws-lc) picks its own flags.
40 unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
41 # A tagged build: the app shows the tag as its version.
42 export GITHUB_REF_NAME="$_tag" GITHUB_REF_TYPE=tag
43 # pacman owns the install: the app never looks for updates (see also the marker file below).
44 export RUSTY_TEAMS_PACKAGE_MANAGED=1
45 cargo build -p app --release --frozen
46}
47
48package() {
49 cd rusty-teams
50 local id=rusty-teams component=io.github.danieldaeschle.RustyTeams
51 install -Dm755 target/release/teams "$pkgdir/usr/bin/teams"
52 install -Dm644 packaging/linux/$id.desktop "$pkgdir/usr/share/applications/$id.desktop"
53 install -d "$pkgdir/usr/share/icons"
54 cp -a packaging/linux/hicolor "$pkgdir/usr/share/icons/"
55 sed -e "s/@VERSION@/${_tag#v}/g" -e "s/@DATE@/$(git log -1 --format=%cs)/g" \
56 packaging/linux/$id.metainfo.xml.in > "$srcdir/$component.metainfo.xml"
57 install -Dm644 "$srcdir/$component.metainfo.xml" "$pkgdir/usr/share/metainfo/$component.metainfo.xml"
58 install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
59 # The app never looks for updates when this file exists: pacman updates it.
60 install -Dm644 /dev/null "$pkgdir/usr/lib/rusty-teams/package-managed"
61}