# Maintainer: Christian Hesse <mail@eworm.de>
# Contributor: Aaron Fischer <mail@aaron-fischer.net>
# Contributor: Steven Allen <steven@stebalien.com>
# Contributor: trile7 at gmail dot com
# Contributor: Ernia <monghitri@aruba.it>

pkgname=yad
pkgver=14.1
pkgrel=2
pkgdesc='A fork of zenity - display graphical dialogs from shell scripts or command line'
url='https://github.com/v1cont/yad'
arch=('x86_64')
license=('GPL3')
depends=('gtk3' 'webkit2gtk-4.1' 'gtksourceview3' 'gspell')
makedepends=('autoconf' 'automake' 'intltool')
source=("https://github.com/v1cont/yad/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.xz")
sha256sums=('dde047a915cd8d3892c32b6ba031876f5cda673e01882c99613f043867c88133')

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  # use webkit2gtk-4.1
  sed -i 's|webkit2gtk-4.0|webkit2gtk-4.1|' configure.ac

  autoreconf -ivf
  intltoolize
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  ./configure \
    --prefix=/usr \
    --enable-icon-browser \
    --enable-html \
    --enable-spell \
    --enable-sourceview

  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  make DESTDIR="${pkgdir}" install
}
