summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a49b2d215c68ad8725331115b7d6625e7c4a29b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Maintainer: Mark Wagie <mark dot wagie at proton dot me>
# Contributor: Igor Dyatlov <dyatlov.igor@protonmail.com>
# Contributor: Rafael Fontenelle <rafaelff@gnome.org>
pkgname=warp
pkgver=0.7.0
pkgrel=1
pkgdesc="Fast and secure file transfer"
arch=('x86_64' 'aarch64')
url="https://apps.gnome.org/Warp"
license=('GPL-3.0-or-later')
depends=('gst-plugins-bad' 'libadwaita')
makedepends=('cargo' 'git' 'itstool' 'meson')
optdepends=('yelp: View help')
_commit=ce2e235adc5e27a7249af01a3b41193434725571  # tags/v0.7.0^0
source=("git+https://gitlab.gnome.org/World/warp.git#commit=$_commit")
sha256sums=('69276b052c89cffe0cedb108431d3aa6983b7697744348743b62c7c20750ccad')

pkgver() {
  cd "$pkgname"
  git describe --tags | sed 's/^v//;s/-/+/g'
}

prepare() {
  cd "$pkgname"
  export CARGO_HOME="$srcdir/cargo-home"
  export RUSTUP_TOOLCHAIN=stable
  cargo fetch --target "$CARCH-unknown-linux-gnu"

  # Temporary solution to the binary name conflict
  # https://www.yesodweb.com/book/web-application-interface
  # https://gitlab.archlinux.org/archlinux/packaging/packages/haskell-wai-app-static/-/issues/1
  sed -i 's|warp %u|warp-share %u|g' data/app.drey.Warp.desktop.in.in
}

build() {
  CFLAGS+=" -ffat-lto-objects"
  export CARGO_HOME="$srcdir/cargo-home"
  export RUSTUP_TOOLCHAIN=stable
  arch-meson "$pkgname" build
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs || :
}

package() {
  meson install -C build --no-rebuild --destdir "$pkgdir"

  mv "$pkgdir/usr/bin/warp" "$pkgdir/usr/bin/warp-share"
}