# $Id: PKGBUILD,v 1.3 2007/12/06 01:18:06 Snowman Exp $
# Maintainer: Eric Belanger <belanger@astro.umontreal.ca>

pkgname=xmms
pkgver=1.2.11
pkgrel=1
pkgdesc="The X MultiMedia System"
arch=('i686' 'x86_64')
url="http://www.xmms.org"
license=('GPL')
depends=('libsm' 'libxxf86vm' 'zlib' 'gtk' 'libvorbis' 'esd' 'alsa-lib' 'libgl')
makedepends=('mesa')
options=('!libtool')
source=(http://www.xmms.org/files/1.2.x/$pkgname-$pkgver.tar.bz2 \
	xmms-menu.patch \
	xmms-1.2.10-crossfade-0.3.9.patch \
	xmms-fix.diff)
md5sums=('f3e6dbaf0b3f571a532ab575656be506' 'b7b6f1811bad8d14e4c4534240e45980'\
         '4eb222111a82a2e1ebe63b5f6109133d' 'd7f9dc3712c486658149c4504f7478a7')
sha1sums=('9d1eae4baab25fd35c9ddfb49321ca60222f672d'
          '27fb6e21bd6db923a425a8df8bd07a2a93867ddb'
          'ff5c172752c8bee708d9a9ecd53864cc95a4bcc5'
          'c227284955f2cc16f027dade670155c0f0fbc4ff')

build() {
  cd $startdir/src/$pkgname-$pkgver

# Add id3v2 editing feature (doesn't apply atm, needs to be redone)
#  patch -Np1 -i ../id3v2.patch || return 1
# Fix xmms.desktop
  patch -Np0 -i ../xmms-menu.patch || return 1
# Patch for hang with xmms-crossfade 
  patch -Np1 -i ../xmms-1.2.10-crossfade-0.3.9.patch || return 1
# fix xmms not able to be shown double size,at least needed for x86_64
  patch -Np1 -i ../xmms-fix.diff || return 1

  if [ "$CARCH" == "x86_64" ]; then
    ./configure --prefix=/usr --disable-mikmod --disable-simd	# for x86_64
  else 
    ./configure --prefix=/usr --disable-mikmod --enable-simd	# for i686
  fi
  make || return 1
  make DESTDIR=$startdir/pkg install
  mkdir -p ${startdir}/pkg/usr/share/{applications,pixmaps}
  install -m 644 xmms/xmms.desktop ${startdir}/pkg/usr/share/applications
  install -m 644 xmms/xmms_mini.xpm ${startdir}/pkg/usr/share/pixmaps/xmms.xpm
  # don't want wmxmms
  rm -rf $startdir/pkg/usr/bin/wmxmms $startdir/pkg/usr/share/xmms
  rm -f $startdir/pkg/usr/man/man1/{gnomexmms.1,wmxmms.1}
}