# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Jakob Gahde <j5lx@fmail.co.uk>

pkgname=pencil2d
pkgver=0.7.0
pkgrel=2
pkgdesc='Easy, intuitive tool to make 2D hand-drawn animations'
arch=('x86_64')
url='https://www.pencil2d.org/'
license=('GPL2')
depends=('ffmpeg' 'hicolor-icon-theme' 'qt6-multimedia' 'qt6-svg')
makedepends=('qt6-tools')
source=("https://github.com/pencil2d/pencil/archive/v$pkgver/$pkgname-$pkgver.tar.gz"
        'qdebug-include.patch')
sha256sums=('6576363b7bfc1f8cd44894ca1a279c9488e2e8a0cd86d3762b84ef73462f70c9'
            '155541398bacb6c6d1e10c82c6d0bcd0be4defbb1f6803f4742f6ecc10162036')

prepare() {
  cd pencil-$pkgver

  # Fix build
  # https://github.com/pencil2d/pencil/pull/1912
  patch -Np1 -i ../qdebug-include.patch
}

build() {
  cd pencil-$pkgver
  qmake6 PREFIX=/usr CONFIG+=PENCIL2D_RELEASE VERSION="$pkgver"
  make
}

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