| 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). |
| 5 | pkgname=kvt-rusty-teams |
| 6 | pkgver=0.6.1.kvt.4 |
| 7 | pkgrel=1 |
| 8 | _tag=v0.6.1-kvt.4 |
| 9 | _commit=e972869751c189818d20930bebdb6a0156b16db1 |
| 10 | pkgdesc='Native Microsoft Teams client in Rust (KVT build, built from source)' |
| 11 | arch=('x86_64') |
| 12 | url='https://git.kvt.nl/ict/rusty-teams' |
| 13 | license=('MIT') |
| 14 | depends=('glibc' 'gcc-libs' 'fontconfig' 'freetype2' 'libxkbcommon' 'libxkbcommon-x11' |
| 15 | 'libx11' 'libxcb' 'wayland' 'alsa-lib' 'libpulse' 'libpipewire' 'libva' 'glib2' 'hicolor-icon-theme') |
| 16 | makedepends=('cargo' 'clang' 'mold' 'git' 'pkgconf' 'python' |
| 17 | 'libxext' 'libxfixes' 'libxdamage' 'libxrandr' 'libxcomposite') |
| 18 | options=('!lto' '!debug') |
| 19 | provides=('rusty-teams') |
| 20 | conflicts=('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(). |
| 22 | source=("rusty-teams::git+https://git.kvt.nl/ict/rusty-teams.git#tag=${_tag}") |
| 23 | sha256sums=('SKIP') |
| 24 | |
| 25 | prepare() { |
| 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 | |
| 33 | build() { |
| 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 | |
| 48 | package() { |
| 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 | } |