# $Id: PKGBUILD 241488 2015-06-30 20:17:10Z arojas $
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>

pkgname=libkdcraw
pkgver=15.04.3
pkgrel=1
pkgdesc="A C++ interface used to decode RAW picture"
url="https://projects.kde.org/projects/kde/kdegraphics/libs/libkdcraw"
arch=('i686' 'x86_64')
license=('GPL' 'LGPL' 'FDL')
depends=('kdelibs' 'libraw')
makedepends=('cmake' 'automoc4')
replaces=('kdegraphics-libs')
conflicts=('kdegraphics-libs')
install=${pkgname}.install
source=("http://download.kde.org/stable/applications/${pkgver}/src/${pkgname}-${pkgver}.tar.xz" 'gcc-5.patch')
sha1sums=('03eb16a8c3b5acfc63066b478c881b7031f736f9'
          'fc5a24e05feab6481b61c37bfe83a0d4b2af4e09')

prepare() {
  mkdir build

# Fix build with GCC 5
  cd $pkgname-$pkgver
  patch -p1 -i "$srcdir"/gcc-5.patch
}

build() {
  cd build
  cmake ../${pkgname}-${pkgver} \
    -DCMAKE_BUILD_TYPE=Release \
    -DKDE4_BUILD_TESTS=OFF \
    -DCMAKE_INSTALL_PREFIX=/usr
  make
}

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