# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: sl1pkn07 <sl1pkn07@gmail.com>
# Contributor: jackoneill <cantabile.desu@gmail.com>

pkgname=vapoursynth
pkgver=R69
pkgrel=1
pkgdesc='A video processing framework with the future in mind'
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url=http://www.vapoursynth.com/
license=(
  LGPL2.1
  custom:OFL
)
depends=(
  libzimg.so
  python
)
makedepends=(
  cython
  git
  python-sphinx
)
_tag=2804ed7a4926863f4a12e879d95155c4b05ecdf3
source=(
  git+https://github.com/vapoursynth/vapoursynth.git#tag=${_tag}
  vapoursynth.xml
)
b2sums=('e6a839510d0363f9bd7d1fe08d36d32d12a8cbb98620c69031382493da0b0cbcad428a2d54b86547cd3c8f7fc610332d2117cfd1a160c0d1f9298ea29ce55517'
        'feae23a22f8589177f30c36bdf21bab93d55a786194d3e0e958537016630d075b82178f60ac840f30ae316a8f87d3fb01f371211f62d1fee9850ee5063561747')

pkgver() {
  cd vapoursynth
  git describe --tags
}

prepare() {
  cd vapoursynth
  ./autogen.sh
}

build() {
  case "${CARCH}" in
    powerpc) CXXFLAGS+=' -latomic' ;;
  esac

  cd vapoursynth
  ./configure \
    --prefix=/usr \
    --disable-static
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package() {
  cd vapoursynth

  make DESTDIR="${pkgdir}" install

  install -Dm 644 src/core/ter-116n.ofl.txt -t "${pkgdir}"/usr/share/licenses/vapoursynth/
  install -Dm 644 ../vapoursynth.xml -t "${pkgdir}"/usr/share/mime/packages/
}

# vim: ts=2 sw=2 et:
