# Packager: Phill Watkins <phill~dot~watkins~at~gmail~dot~com>

pkgname=snes9x-gtk
pkgver=1.52
pkgrel=1pw
#arch=noarch
source=("http://snes9x-gtk.googlecode.com/files/snes9x-$pkgver-src.tar.bz2")
sourcetemplate=http://people.salixos.org/pwatk/packages/xap/$pkgname/$pkgver
docs=\
(
"readme_unix.html"
"LICENSE" "README"
"changes.txt" "control-inputs.txt" "controls.txt" "gpl-2.0.txt" "lgpl-2.1.txt" "porting.html" "snes9x-license.txt" "snapshots.txt" "snes9x.conf.default"
)
url=http://code.google.com/p/snes9x-gtk/

doinst() {
if [ -x usr/bin/update-desktop-database ]; then
  usr/bin/update-desktop-database -q
fi

if [ -x usr/bin/gtk-update-icon-cache ]; then
  usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor
fi
}

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"snes9x-gtk (A GTK+ port of the Snes9x emulator)"
"Snes9x is a portable, freeware Super Nintendo Entertainment System"
"(SNES) emulator. It basically allows you to play most games designed"
"for the SNES and Super Famicom Nintendo game systems on your PC or"
"Workstation"
)

build() {
    set -e

    cd $startdir/src/snes9x-$pkgver-src/unix
    ./configure \
      --prefix=/usr \
      --sysconfdir=/etc \
      --localstatedir=/var \
      --mandir=/usr/man \
      --infodir=/usr/info \
      --docdir=/usr/doc/$pkgname-$pkgver \
      --build=$arch-slackware-linux \
      --enable-netplay
    sed -i -e '/^CCFLAGS/s|-O3|-O2|' Makefile
    make
    install -Dm 0755 snes9x $startdir/pkg/usr/bin/snes9x

    cd $startdir/src/snes9x-$pkgver-src/gtk
    ./configure \
      --prefix=/usr \
      --sysconfdir=/etc \
      --localstatedir=/var \
      --mandir=/usr/man \
      --infodir=/usr/info \
      --docdir=/usr/doc/$pkgname-$pkgver \
      --build=$arch-slackware-linux \
      --with-netplay
    make
    make install DESTDIR=$startdir/pkg

    set +e
} 
    
