# $Id: PKGBUILD 219546 2014-08-11 12:12:45Z schiv $
# Maintainer: Ray Rashif <schiv@archlinux.org>
# Contributor: tobias <tobias@archlinux.org>
# Contributor: see .contrib

pkgname=hydrogen
pkgver=0.9.6
pkgrel=1
pkgdesc="An advanced drum machine"
arch=('i686' 'x86_64')
license=('GPL')
url="http://www.hydrogen-music.org/"
depends=('libarchive' 'liblrdf' 'qt4' 'jack' 'libpulse')
optdepends=('rubberband')
makedepends=('cmake')
source=("https://github.com/hydrogen-music/hydrogen/archive/$pkgver.tar.gz"
        'lrdf_raptor2.patch')
install=$pkgname.install
md5sums=('e4424926a88af82fb2048b3548723827'
         '6f15bc059d3c39e9c34e0fbac92baf61')

prepare() {
  cd "$srcdir/$pkgname-$pkgver"

  # fix building with newer raptor
  # see https://bugs.archlinux.org/task/25060
  # see https://github.com/hydrogen-music/hydrogen/issues/194
  patch -Np1 -i "$srcdir/lrdf_raptor2.patch"

  # fix some pngs that break with newer libpng
  # see https://mailman.archlinux.org/pipermail/arch-dev-public/2013-May/024872.html
  #msg2 "Fixing PNGs, please wait..."
  #find -name '*.png' -exec optipng -quiet -force -fix {} +
}

build() {
  cd "$srcdir/$pkgname-$pkgver"

  # lash will have to wait until I bring it into [extra] --schiv
  cmake . -DCMAKE_INSTALL_PREFIX=/usr \
          -DWANT_CPPUNIT=OFF \
          -DWANT_LRDF=ON
  make
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  make DESTDIR="$pkgdir" install
}

# vim:set ts=2 sw=2 et:
