# Packager = Tuxcore <dev@tuxcore.org> # Committer: dorphell <dorphell@archlinux.org>

pkgname=libtheora
pkgver=1.1.1
pkgrel=6
pkgdesc='Standard encoder and decoder library for the Theora video compression format'
arch=('x86_64')
url='https://www.theora.org/'
license=('BSD-3-Clause')
depends=('glibc' 'libogg')
makedepends=('doxygen' 'git' 'libpng' 'libvorbis' 'sdl')
source=("git+https://github.com/xiph/theora.git?signed#tag=v$pkgver")
b2sums=('b7eb9a0ebc83c84eac0049b7dbfea63a2da6c8913251e24229c6d32b048bcca64e2ec5a1c0caa9763f93d7e134ad7c95b54a0c86f8c6631437a5fe7bfd198251')

prepare() {
  cd theora

  # Fix for autoreconf
  git cherry-pick -n 28cc6dbd9b2a141df94f60993256a5fca368fa54

  # Fix build with libpng 1.6
  git cherry-pick -n 7288b539c52e99168488dc3a343845c9365617c8

  autoreconf -fi
}

build() {
  cd theora
  ./configure --prefix=/usr
  make
}

check() {
  cd theora
  make check
}

package() {
  cd theora
  make DESTDIR="$pkgdir" install
  install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE COPYING
}
