# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>

pkgbase=libmygpo-qt
pkgname=(libmygpo-qt5)
pkgver=1.1.0
pkgrel=3.1
pkgdesc='A C++/Qt client library for gpodder.net'
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url="http://wiki.gpodder.org/wiki/Libmygpo-qt"
license=('LGPL2.1')
depends=('qt5-base')
makedepends=('cmake' 'doxygen')
source=("http://stefan.derkits.at/files/libmygpo-qt/libmygpo-qt.${pkgver}.tar.gz"
        libmygpo-qt5.11a.patch::"https://github.com/gpodder/libmygpo-qt/commit/0d76d960.patch"
        libmygpo-qt5.11b.patch::"https://github.com/gpodder/libmygpo-qt/commit/1b53767b.patch")
sha256sums=('82765a9baa7b6bb3a3277759cec9c3779eee691db9180affe35a67813346e1cd'
            '4894360b246edd38024b8a60b66e3219494655e9d5ed7b3ed7f03958b796ac98'
            'a4d02a6d15eef8ce08888a4090f5cbb50f744d8af85011ee8e54e84e99756e75')

prepare() {
  mkdir -p build

  cd libmygpo-qt.${pkgver}
  patch -p1 -i ../libmygpo-qt5.11a.patch # Fix build with Qt 5.11
  patch -p1 -i ../libmygpo-qt5.11b.patch
}

build() {
  cd build
  cmake ../libmygpo-qt.${pkgver} \
    -DCMAKE_BUILD_TYPE='Release' \
    -DCMAKE_INSTALL_PREFIX='/usr' \
    -DMYGPO_BUILD_TESTS=OFF
  make
}

package_libmygpo-qt5() {
  cd build

  make DESTDIR="${pkgdir}" install
}

# vim: ts=2 sw=2 et:
