# $Id: PKGBUILD 106123 2014-02-23 15:32:25Z alucryd $
# Maintainer: Maxime Gauduin <alucryd@gmail.com>
# 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.2
pkgrel=1
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="${pkgname}.install"
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/clementine-player/Clementine/archive/${pkgver}.tar.gz"
        "${pkgname}-unistd.patch")
sha256sums=('1f674c42f05c476baf74f1dd37b1aa357ff9199e4493173052c856a53e5f0a96'
            'cafb6eaf10ff0853156bd91ccdfd2d163ec20027076e7a6292125eac236cf382')

prepare() {
  cd Clementine-${pkgver}

  patch -Np1 -i ../${pkgname}-unistd.patch
}

build() {
  cd Clementine-${pkgver}

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

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

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

  make DESTDIR="${pkgdir}" install
}

# vim: ts=2 sw=2 et:
