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

pkgname=deepin-draw
pkgver=5.8.0.22
pkgrel=1
pkgdesc="A lightweight drawing tool for Linux Deepin"
arch=('x86_64')
url="https://github.com/linuxdeepin/deepin-draw"
license=('GPL3')
depends=('deepin-picker' 'deepin-qt5integration' 'freeimage' 'libexif' 'qt5-imageformats')
makedepends=('qt5-tools')
groups=('deepin-extra')
source=("$pkgname-$pkgver.tar.gz::https://github.com/linuxdeepin/deepin-draw/archive/$pkgver.tar.gz"
         deepin-draw-dwidget-include.patch)
sha512sums=('a63007d344edd8f094e73693d1d10618116139783eed3a2aaf0e43ddc32e26616b95bdcc0c6c59213e9c750289a739f67b34c8acdacf2cfa4d759fbaf795097a'
            'a512608d7812b4389f788c810a8f7aa1ecd7eaca448664766b54eca9002af5fba1683694f9a8225ab0013b4925d1b3c062f14728187e4a3d3d243b314934104e')

prepare() {
  cd deepin-draw-$pkgver
  patch -p1 -i ../deepin-draw-dwidget-include.patch # Fix missing includes
  sed -i '/include <DGraphicsView>/i #include <QFileDevice>' frame/cgraphicsview.h
  sed -i '/include <QPainter>/a #include <QMouseEvent>' widgets/ciconbutton.cpp

}

build() {
  cd deepin-draw-$pkgver

  qmake-qt5
  make
}

package() {
  cd deepin-draw-$pkgver
  make INSTALL_ROOT="$pkgdir" install
}
