# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Sam Burgos <santiago.burgos1089@gmail.com>
# Contributor: Kyle Laker <kyle@laker.email>

pkgname=warpinator
pkgver=1.2.4
pkgrel=2
pkgdesc='LAN file sender, send and receive files across the network'
arch=('any')
url='https://github.com/linuxmint/warpinator'
license=('GPL3')
depends=('gtk3' 'libnm' 'python-cryptography' 'python-gobject' 'python-grpcio' 'python-packaging'
         'python-protobuf' 'python-pynacl' 'python-setproctitle' 'python-setuptools' 'python-xapp' 'python-zeroconf'
         'xapp')
makedepends=('meson' 'polkit')
optdepends=('ufw: Open a firewall port for Warpinator')
source=("https://github.com/linuxmint/$pkgname/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha256sums=('c48b69b24648a895c1d0fb2eb95209e935c7d7a5a03b7979a879b709a7a8f925')

prepare() {
  cd $pkgname-$pkgver

  # Fix hardcoded libexec dir
  sed -i 's|libexec/warpinator|lib/warpinator|' \
    bin/warpinator.in \
    data/org.x.warpinator.policy.in.in
  sed -i 's/libexec/lib/' install-scripts/download_zeroconf.py
}

build() {
  arch-meson $pkgname-$pkgver build -D bundle-zeroconf=false
  meson compile -C build
}

package() {
  DESTDIR="$pkgdir" meson install -C build
}
