# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=deepin-qt5integration
pkgver=5.5.8
pkgrel=1
pkgdesc='Qt platform theme integration plugins for DDE'
arch=('x86_64')
url="https://github.com/linuxdeepin/qt5integration"
license=('GPL3')
depends=('dtkwidget' 'libqtxdg' 'deepin-qt5platform-plugins')
makedepends=('xcb-util-renderutil' 'deepin-file-manager' 'gtest')
groups=('deepin')
source=("https://github.com/linuxdeepin/qt5integration/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('c1c71a8f220d8e237636387eeb9a41d3438bacfcf93497d9ce2f0f6873f295aaeaea2fd09ff92d35baa249034dcc35ee115de4734ec4c60cbf9a3333241a7f3d')

build() {
  cd qt5integration-$pkgver
  qmake-qt5 PREFIX=/usr
  make
}

package() {
  cd qt5integration-$pkgver
  make INSTALL_ROOT="$pkgdir" install

  # Upstream installs the same plugin twice as Qt plugins, which breaks everything.
  find "$pkgdir"/usr/lib/qt/plugins/ -type f ! -name '*5.5.so' -delete -print
}
