# $Id: PKGBUILD 138987 2015-08-30 12:53:27Z alucryd $
# Maintainer: Maxime Gauduin <alucryd at gmail dot com>

pkgname=noise-player
pkgver=0.3.1
pkgrel=1
pkgdesc='The Pantheon Music Player'
arch=('i686' 'x86_64')
url='https://launchpad.net/noise'
license=('GPL3')
depends=('cairo' 'desktop-file-utils' 'gdk-pixbuf2' 'glib2' 'glibc'
         'gst-plugins-base-libs' 'gstreamer' 'gtk3' 'hicolor-icon-theme'
         'libgee' 'libgpod' 'libnotify' 'libpeas' 'libsoup' 'libxml2' 'pango'
         'sqlheavy' 'taglib' 'zeitgeist'
         'libgranite.so')
makedepends=('cmake' 'gobject-introspection' 'vala')
optdepends=('gst-plugins-base: "Base" plugin libraries'
            'gst-plugins-good: "Good" plugin libraries'
            'gst-plugins-bad: "Bad" plugin libraries'
            'gst-plugins-ugly: "Ugly" plugin libraries')
replaces=('noise')
install='noise.install'
source=("https://launchpad.net/noise/${pkgver%.*}.x/${pkgver}/+download/noise-${pkgver}.tgz"
        'mesa-demos-conflict.patch'
        'noise-install-dirs.patch')
sha256sums=('245c4659d0944be59b53ed24089ffe7ad77dbaf6d1834b871bc860bc646e0e1e'
            'b3bec8516d9497ee961fcd607e96b7c17ed76eed3d7af4093827ff5e052d0dc0'
            'd0ebc710a742d942e04a8df61d91dd75ae4b2aeafe7fece08f1fbc90c507f1df')

prepare() {
  cd noise-${pkgver}

  patch -Np1 -i ../mesa-demos-conflict.patch
  patch -Np1 -i ../noise-install-dirs.patch

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

}

build() {
  cd noise-${pkgver}/build

  cmake .. \
    -DCMAKE_BUILD_TYPE='Release' \
    -DCMAKE_INSTALL_PREFIX='/usr' \
    -DCMAKE_INSTALL_LIBDIR='/usr/lib' \
    -DGSETTINGS_COMPILE='FALSE'
  make -j1
}

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

  make DESTDIR="${pkgdir}" install
}

# vim: ts=2 sw=2 et:
