# $Id: PKGBUILD 104846 2014-01-27 14:17:21Z speps $
# Maintainer: speps <speps at aur dot archlinux dot org>

pkgname=qupzilla
pkgver=1.6.3
pkgrel=1
pkgdesc="Cross-platform QtWebKit browser"
arch=(i686 x86_64)
url="http://www.qupzilla.com/"
license=('GPL3')
makedepends=('qtwebkit' 'hunspell')
optdepends=('bash-completion: bash completion support')
install="$pkgbase.install"
source=("$pkgbase-$pkgver.tar.gz::https://github.com/QupZilla/qupzilla/archive/v$pkgver.tar.gz"
        "${srcdir}/fix-color.patch")
noextract=("$pkgbase-$pkgver.tar.gz")
md5sums=('SKIP'
         'b4f5f825c3763bc42c2df1af2703ac07')

prepare() {
  # extract
  mkdir -p qt4
  bsdtar --strip-components 1 -zxf $pkgbase-$pkgver.tar.gz -C qt4

  patch -p0 -i "${srcdir}/fix-color.patch"
  # configure
  export USE_WEBGL=true \
         QUPZILLA_PREFIX=/usr/
}

build() {
  cd qt4
  qmake-qt4
  make
}

package_qupzilla() {
  depends=('qtwebkit' 'hunspell')

  cd qt4
  make INSTALL_ROOT="$pkgdir/" install

  # zsh completion
  install -Dm644 linux/completion/_$pkgbase \
    "$pkgdir/usr/share/zsh/site-functions/_$pkgbase"
}

# vim:set ts=2 sw=2 et:
