# Maintainer: NicoHood <archlinux {cat} nicohood {dog} de>
# PGP ID: 97312D5EB9D7AE7D0BD4307351DAE9B7C1AE9161
# Contributor: Grayhatter
# Contributor: Vlad M. <vlad@archlinux.net>
# Contributor: Håvard Pettersson <mail@haavard.me>
# Contributor: Madotsuki <madotsuki at cock dot li>

pkgname=utox
_pkgname=uTox
pkgver=0.18.1
pkgrel=1
pkgdesc='Lightweight Tox client'
arch=('x86_64')
url="https://github.com/uTox/uTox"
license=('GPL3')
depends=('fontconfig'
         'libfilteraudio'
         'libxext'
         'libxrender'
         'openal'
         'toxcore'
         'v4l-utils'
         'hicolor-icon-theme')
optdepends=('gtk3: GTK file picker'
            'libdbus: Notification support')
makedepends=('toxcore>=0.1.0' 'cmake' 'gtk3' 'libdbus' 'check' git)
#_commit=fa06d80ec5104092c43169d2abf9cce94622eadf
#source=("git+https://github.com/uTox/uTox#commit=$_commit"
#        "git+https://github.com/nothings/stb"
#        "git+https://github.com/compuphase/minIni"
#        "git+https://github.com/nayuki/QR-Code-generator")
source=("$_pkgname-$pkgver-full.tar.gz::https://github.com/$_pkgname/$_pkgname/releases/download/v$pkgver/$_pkgname-$pkgver-full.tar.gz"
	"$_pkgname-$pkgver-full.tar.gz.asc::https://github.com/$_pkgname/$_pkgname/releases/download/v$pkgver/$_pkgname-$pkgver-full.tar.gz.asc")
sha512sums=('8c3c7016b73dd59d154e781eee2e9d7a05b889460900703e1850cace7796c4f89cd5b1be0421b6becd8d908e46839c87786c782d07be38efb5bbdbdecb8afe2a'
            'SKIP')

#pgp keys taken from https://github.com/uTox/uTox/blob/develop/README.md#team
validpgpkeys=(
"E5926050AE9C234AFF8496FEBE4F41DE1DEEEED0"
"7AED9A170C81E601DA4EEE279043061421EF90FA"
"9D1D599088E223DD99007DE2AEA10D4EA0530876"
"B7008FF12C079BF6E6EA19D1601A604B7E605776"
"E28E7252B1E7FCFED358CF8E3763B3A793AAFA0F"
"BCEE99DCA339ABF9CC36428D61A9B9AFD2E53885"
"A25156FC7AFB5C0365A0407E6F5DD1C5371DE665"
)

build() {
    cd "${_pkgname}"
    cmake . -DCMAKE_BUILD_TYPE=Release -DENABLE_ASAN=OFF -DCMAKE_INSTALL_PREFIX=/usr
    make
}

package() {
    cd "${_pkgname}"
    make PREFIX="/usr" DESTDIR="${pkgdir}" install
}
