# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: archtux <antonio dot arias99999 at gmail dot com>

pkgname=xnoise
pkgver=0.2.21
pkgrel=5
pkgdesc="Media player with a slick GUI, great speed and lots of features."
arch=('x86_64')
url="http://www.xnoise-media-player.com/"
license=('GPL2')
depends=('desktop-file-utils' 'gst-plugins-base-libs' 'gst-plugins-good' 'gtk3' 'libsoup' 'sqlite' 'libtaginfo>=0.2' 'librsvg')
optdepends=('gst-plugins-base: Basic media codecs'
            'gst-plugins-bad: Extra media codecs'
            'gst-plugins-ugly: Extra media codecs'
	    'gst-libav: Extra media codecs'
	    'gvfs: Needed for fetching album art')
makedepends=('vala' 'intltool' 'git' 'gnome-common')
install=$pkgname.install
source=("git+https://bitbucket.org/shuerhaaken/xnoise.git#tag=$pkgver"
        xnoise-ListStore.patch
        xnoise-compilation-fix.patch)
sha512sums=('SKIP'
            'b47297bda23fc4dcd22bf44a84ad2c5e3b5ed0d648ef78a3bbe4de4d481c82e8ab0c52193dc8c4373e74cd389537faf66bd434cd8d695eeff4b2820c67bf1423'
            'fababde2f5ccd7c7074d8c7cd684ab36924e6781af05293736227c15d864f3fc726a50215ca84b5f4776e47cad54e1b5723932e98c042ad226c853b9efc2a5ad')

prepare() {
  cd $pkgname
  # Patches from openSUSE. Thanks!
  patch -p1 -i ../xnoise-ListStore.patch
  patch -p1 -i ../xnoise-compilation-fix.patch
}

build() {
  cd $pkgname
  
  ./autogen.sh --prefix=/usr
  make
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
  
  # Remove obsolete files
  rm -rf "$pkgdir/usr/include" "$pkgdir/usr/share/vala"
}
