# $Id: PKGBUILD 127095 2015-02-04 15:59:41Z andyrtr $
# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Stéphane Gaudreault <stephane@archlinux.org>
# Contributor: BlackEagle <ike.devolder@gmail.com>
# Contributor: Dany Martineau <dany.luc.martineau@gmail.com>

pkgname=clementine
pkgver=1.2.3
pkgrel=5
pkgdesc='A modern music player and library organizer'
url='http://www.clementine-player.org/'
license=('GPL')
arch=('i686' 'x86_64')
depends=('chromaprint' 'glew' 'gstreamer0.10-base' 'libcdio' 'libgpod'
         'liblastfm' 'libmtp' 'libmygpo-qt' 'protobuf' 'qca-ossl' 'taglib')
makedepends=('cmake' 'boost' 'mesa' 'sparsehash')
optdepends=('gstreamer0.10-base-plugins: "Base" plugin libraries'
            'gstreamer0.10-good-plugins: "Good" plugin libraries'
            'gstreamer0.10-bad-plugins: "Bad" plugin libraries'
            'gstreamer0.10-ugly-plugins: "Ugly" plugin libraries'
            'gvfs: Various devices support')
install='clementine.install'
source=("clementine-${pkgver}.tar.gz::https://github.com/clementine-player/Clementine/archive/${pkgver}.tar.gz"
        'udisks-namespace.patch')
sha256sums=('7df5650445a005c09f5f0e1a1b0d077037c37ecbe4ee77baf9d45f121308a1bf'
            'a7c2764576cee303a57e4efe6a5dbd583a66de8a15aee738bd92d4bb21786008')

prepare() {
  cd Clementine-${pkgver}

  patch -Np1 -i ../udisks-namespace.patch
}

build() {
  cd Clementine-${pkgver}

  if [[ -d build ]]; then
    rm -rf build
  fi
  mkdir build && cd build

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

package() {
  cd Clementine-${pkgver}/build

  make DESTDIR="${pkgdir}" install
}

# vim: ts=2 sw=2 et:
