# Contributor: Ray Rashif <[email protected]>
# Contributor: Alexandr Grigorcea <[email protected]>

pkgname=nuvola-bzr
pkgver=653
pkgrel=1
pkgdesc="Integrated Google Music, Grooveshark, 8tracks and Hype Machine player."
arch=(i686 x86_64)
url="https://launchpad.net/nuvola-player"
license=('GPLv3')
depends=('intltool' 'gtk3' 'webkitgtk3' 'python2' 'libnotify' 'libx11' 'libunique' 'libgee' 'libsoup')
makedepends=('bzr' 'vala' 'python2-scour')
provides=('nuvola')
conflicts=('google-musc-frame-bzr' 'nuvolaplayer')
optdepends=('gnome-shell-extension-mediaplayer-git: Gnome Shell integration' 'tsocks: Socks proxy support')
replaces=('google-music-frame-bzr' 'nuvolaplayer')
options=()
source=()
md5sums=()
install=nuvola-bzr.install

_bzrtrunk=lp:nuvola-player
_bzrmod=nuvola-player

build() {

msg "Connecting to the server...."
cd ${srcdir}
if [ -d ${_bzrmod} ] ; then
bzr pull -d ${_bzrmod}
msg "The local files are updated."
else
bzr branch ${_bzrtrunk}
fi

msg "BZR checkout done or server timeout"
msg "Starting make..."

rm -rf "${_bzrmod}-build"
cp -r "${_bzrmod}" "${_bzrmod}-build"
cd "${_bzrmod}-build"

LDFLAGS="$LDFLAGS -ldl"

python2 ./waf configure --prefix=/usr
python2 ./waf build $MAKEFLAGS || return 1
}

package() {
cd "${srcdir}/${_bzrmod}-build"

python2 ./waf install --destdir="${pkgdir}"
}