# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Kevin Guan <KevinGuan.gm@gmail.com>

pkgname=iptux
pkgver=0.9.1
pkgrel=2
pkgdesc='LAN messenger and file sender, an IP Messenger client'
arch=('x86_64')
url='https://github.com/iptux-src/iptux/'
license=('GPL2')
depends=('google-glog' 'gtk3' 'jsoncpp' 'libsigc++' 'libayatana-appindicator')
makedepends=('appstream' 'gflags' 'meson')
checkdepends=('xorg-server-xvfb')
source=("https://github.com/iptux-src/$pkgname/archive/v$pkgver/$pkgname-$pkgver.tar.gz"
         cinttypes.patch)
sha256sums=('51c1fc58070979ffc6eb0af4b6ac26492b82fb230a9cbcc06f21c4eede398ce2'
            '7435708ea725f2a916cda116a88c76b1a72f4136295ee2dc88374a1efc5d70d3')

prepare() {
  cd $pkgname-$pkgver
  patch -p1 -i ../cinttypes.patch # Add missing include
}

build() {
# Fix build with glog 0.7
  CXXFLAGS+=" -DGLOG_USE_GLOG_EXPORT -DGLOG_USE_GFLAGS" \
  arch-meson $pkgname-$pkgver build
  meson compile -C build
}

check() {
  xvfb-run meson test -C build --print-errorlogs
}

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