# $Id: PKGBUILD 142759 2015-10-02 13:12:21Z foutrelis $
# 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=7
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'
            'gstreamer0.10-ffmpeg: FFmpeg plugin'
            'gvfs: Various devices support')
install='clementine.install'
source=("clementine-${pkgver}.tar.gz::https://github.com/clementine-player/Clementine/archive/${pkgver}.tar.gz"
        'clementine-gcc5.1.patch'
        'clementine-udisks-namespace.patch')
sha256sums=('7df5650445a005c09f5f0e1a1b0d077037c37ecbe4ee77baf9d45f121308a1bf'
            'b03c190b881520c3233ed8f5804b518e9e699c6f773ab227f36133f422b786e1'
            'a7c2764576cee303a57e4efe6a5dbd583a66de8a15aee738bd92d4bb21786008')

prepare() {
  cd Clementine-${pkgver}

  patch -Np1 -i ../clementine-gcc5.1.patch
  patch -Np1 -i ../clementine-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:
