# $Id: PKGBUILD 73549 2012-07-09 14:44:47Z stephane $
#Maintainer: Stéphane Gaudreault <stephane@archlinux.org>
#Contributor: BlackEagle <ike.devolder@gmail.com>
#Contributor: Dany Martineau <dany.luc.martineau@gmail.com>

pkgname=clementine
pkgver=1.0.1
pkgrel=6
pkgdesc="A music player and library organizer"
url="http://www.clementine-player.org/"
license=('GPL')
arch=('i686' 'x86_64')
depends=('gstreamer0.10-base' 'taglib' 'glew' 'liblastfm' 'libgpod'
         'libmtp' 'libplist' 'hicolor-icon-theme' 'qt' 'libimobiledevice'
         'qjson' 'libcdio' 'protobuf' 'qca' 'qca-ossl' 'gvfs')
makedepends=('cmake' 'boost')
optdepends=('gstreamer0.10-base-plugins: for more open formats'
            'gstreamer0.10-good-plugins: for use with "Good" plugin libraries'
            'gstreamer0.10-bad-plugins: for use with "Bad" plugin libraries'
            'gstreamer0.10-ugly-plugins: for use with "Ugly" plugin libraries')
source=(http://clementine-player.googlecode.com/files/${pkgname}-${pkgver}.tar.gz
        clementine-fix-albumcoverfetch-crash.patch
        clementine-fresh-start.patch)
sha1sums=('e05320da689e2fad744fd3e68518bc4103ecf0fd'
          '3d386ac712ea6a7c04232a3f4b6e52a6260ffcf4'
          'd8abab4b8fb2d5284a2f43107505325e62d4af5f')
install=clementine.install

build() {
   cd "${srcdir}/${pkgname}-${pkgver}"

   # https://bugs.gentoo.org/401713?id=401713
   patch -Np1 -i ../clementine-fresh-start.patch

   # http://code.google.com/p/clementine-player/issues/detail?id=2752
   patch -Np1 -i ../clementine-fix-albumcoverfetch-crash.patch

   cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
   make
}

package() {
   cd "${srcdir}/${pkgname}-${pkgver}"
   make DESTDIR="${pkgdir}" install
}
