summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2a59685e978fd028295991a50526bfa0a29f1207 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
pkgname=mingw-w64-smpeg
epoch=1
pkgver=0.4.5
pkgrel=3
pkgdesc="SDL MPEG Player Library (mingw-w64)"
arch=(any)
url="http://icculus.org/smpeg"
license=("LGPL")
makedepends=(mingw-w64-configure subversion)
depends=(mingw-w64-sdl)
options=('!buildflags' '!strip' 'staticlibs')
source=("smpeg-$pkgver::svn://svn.icculus.org/smpeg/tags/release_${pkgver//./_}")
sha256sums=('SKIP')

_architectures="i686-w64-mingw32 x86_64-w64-mingw32"

prepare() {
  cd "$srcdir/smpeg-$pkgver"
  sed -i "s|-version-info|-no-undefined -version-info|g" Makefile.am
  ./autogen.sh
}

build() {
  cd "${srcdir}/smpeg-$pkgver"
  for _arch in ${_architectures}; do
    mkdir -p build-${_arch} && pushd build-${_arch}
    CFLAGS+=" -Wno-error=narrowing"
    ${_arch}-configure \
      --disable-sdltest \
      --disable-gtk-player \
      --disable-gtktest \
      --disable-opengl-player \
      --with-sdl-prefix=/usr/${_arch} \
      --without-x
    make
    popd
  done
}

package() {
  install -d "$pkgdir/usr/bin/"
  for _arch in ${_architectures}; do
    cd "${srcdir}/smpeg-${pkgver}/build-${_arch}"
    make install DESTDIR="$pkgdir"
    ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
    ${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a
    rm -r "$pkgdir/usr/${_arch}/share"
    ln -s "/usr/${_arch}/bin/smpeg-config" "$pkgdir/usr/bin/${_arch}-smpeg-config"
  done
}