# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Douglas Soares de Andrade <dsandrade@gmail.com>
# Contributor: Michael Fellinger <m.fellinger@gmail.com>

pkgname=sqlitebrowser
_gitcommit=f07dafdd10c361f2a5867d125c9f8f79b629edd1
pkgver=3.11.2
pkgrel=1
pkgdesc='SQLite Database browser is a light GUI editor for SQLite databases, built on top of Qt'
url='https://sqlitebrowser.org/'
arch=('x86_64')
license=('GPL3')
depends=('qt5-base' 'hicolor-icon-theme' 'desktop-file-utils')
makedepends=('git' 'cmake' 'qt5-tools')
source=("git+https://github.com/sqlitebrowser/sqlitebrowser#commit=${_gitcommit}?signed")
sha256sums=('SKIP')
validpgpkeys=('05E463FDB5802C3D00257F9C79EAD0AB3BD7DD2C') # Justin Clift (GPG key for signing git commits) <justin@postgresql.org>

pkgver() {
  cd ${pkgname}
  git describe --always --tags --match 'v*' | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd ${pkgname}
  mkdir -p build
}

build() {
  cd ${pkgname}/build
  cmake \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DENABLE_TESTING=ON \
    ..
  make
}

check() {
  cd ${pkgname}/build
  ctest -V
}

package() {
  cd ${pkgname}
  make -C build install DESTDIR="${pkgdir}"
}

# vim: ts=2 sw=2 et:
