NAME="libtheora"
DESC="Reference implementation of the Theora video compression format"
VERSION="1.1.1"
FILES=("https://downloads.xiph.org/releases/theora/libtheora-$VERSION.tar.xz")
HASHES=("9eeabf1ad65b7f41533854a59f7a716d")
DEPENDS=(
  "libogg" "libvorbis" 
  "sdl12-compat" "libpng"
)

PACKAGE() {
  tar xf $NAME-$VERSION.tar.xz
  cd $NAME-$VERSION

  sed -i 's/png_\(sizeof\)/\1/g' examples/png2theora.c
  ./configure --prefix=/usr --disable-static
  make && make DESTDIR="$ROOTDIR" install
  mkdir -pv "$ROOTDIR/usr/bin"

  cd examples/.libs
  for e in *; do
    install -v -m755 "$e" "$ROOTDIR/usr/bin/theora_${e}"
  done

  cd ../../.. && rm -r $NAME-$VERSION
}
