# Maintainer: Eric Bélanger <eric@archlinux.org>
# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=k3b
pkgver=19.08.1
pkgrel=2
epoch=1
pkgdesc="Feature-rich and easy to handle CD burning application"
arch=(x86_64)
url="https://userbase.kde.org/K3b"
license=(GPL)
depends=(libkcddb kcmutils knotifyconfig libmad kfilemetadata knewstuff
         libmpcdec libdvdread libburn qt5-webkit)
makedepends=(extra-cmake-modules kdoctools)
optdepends=('cdrtools: for CD burning with cdrecord'
            'dvd+rw-tools: for DVD burning support'
            'vcdimager: for VCD burning support'
            'emovix: for bootable multimedia CD/DVD support'
            'cdrdao: for disk-at-once (DAO) mode support'
            'cdparanoia: for CD ripping support' 'transcode: for DVD ripping support')
groups=(kde-applications kdemultimedia)
source=("https://download.kde.org/stable/applications/$pkgver/src/$pkgname-$pkgver.tar.xz"{,.sig}
        kdebug-411969.patch::"https://cgit.kde.org/k3b.git/patch/?id=787aaa1f")
sha256sums=('8995f39457932fb6597f0f6124e0dfe09ecb2a25a6ec8506ce3ef870da293749'
            'SKIP'
            'b7c757baddaaaa00e04fc7a24275ec48dee71b14ea21a8c0ecfd9fa55079133e')
validpgpkeys=(CA262C6C83DE4D2FB28A332A3A6A4DB839EAA6D7  # Albert Astals Cid <aacid@kde.org>
              F23275E4BF10AFC1DF6914A6DBD2CE893E2D1C87) # Christoph Feck <cfeck@kde.org>

prepare() {
  mkdir -p build

  cd $pkgname-$pkgver
  patch -p1 -i ../kdebug-411969.patch # Fix crash when adding large files
}

build() {
  cd build
  cmake ../$pkgname-$pkgver \
    -DCMAKE_INSTALL_LIBEXECDIR=lib \
    -DBUILD_TESTING=OFF
  make
}

package() {
  cd build
  make DESTDIR="$pkgdir" install
}
