# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Eric Belanger <eric@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=smpeg
pkgver=2.0.0
pkgrel=3.1
pkgdesc="SDL MPEG Player Library"
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url="https://icculus.org/smpeg/"
license=(LGPL)
depends=(sdl2)
makedepends=(mesa glu)
optdepends=('glu: to use glmovie')
source=("https://github.com/icculus/smpeg/archive/refs/tags/release_${pkgver//./_}.tar.gz")
sha256sums=('fdd431bd607efcf0f35789fb3105d7535d4f0e8b46e673e9c0051726e8d1e701')

prepare() {
  cd smpeg-release_${pkgver//./_}
  ./autogen.sh
}

build() {
  cd smpeg-release_${pkgver//./_}
  CFLAGS+=" -Wno-error=narrowing"
  ./configure --prefix=/usr --mandir=/usr/share/man --disable-static --build=${CHOST}
  make
}

package() {
  cd smpeg-release_${pkgver//./_}
  make DESTDIR="$pkgdir" install
}
