# Maintainer:  Dave Murphy <davem@devkitpro.org>

pkgname=ppc-libogg
pkgver=1.3.3
pkgrel=2
pkgdesc='The Ogg transport bitstream is designed to provide framing, error protection and seeking structure for higher-level codec streams that consist of raw, unencapsulated data packets, such as the Opus, Vorbis and FLAC audio codecs or the Theora and Dirac video codecs.'
arch=('any')
url='https://wiki.xiph.org/Ogg'
license=(Xiph.org)
options=(!strip libtool staticlibs)
source=("https://ftp.osuosl.org/pub/xiph/releases/ogg/libogg-$pkgver.tar.gz")
sha256sums=('c2e8a485110b97550f453226ec644ebac6cb29d1caef2902c007edab4308d985')
makedepends=('ppc-pkg-config' 'devkitpro-pkgbuild-helpers')

build() {
  cd libogg-$pkgver

  source /opt/devkitpro/devkitppc.sh
  source /opt/devkitpro/ppcvars.sh

  ./configure --prefix="${PORTLIBS_PREFIX}" --host=powerpc-eabi \
    --disable-shared --enable-static

  make
}

package() {
  cd libogg-$pkgver

  source /opt/devkitpro/devkitppc.sh
  source /opt/devkitpro/ppcvars.sh

  make DESTDIR="$pkgdir" install

  install -Dm644 COPYING "$pkgdir"${PORTLIBS_PREFIX}/licenses/$pkgname/COPYING

  # remove useless documentation
  rm -r "$pkgdir"${PORTLIBS_PREFIX}/share/doc
}
