# $Id: PKGBUILD 116776 2014-08-03 03:59:35Z dwallace $
# Maintainer: Daniel Wallace <danielwallace at gtmanfred dot com>
# Contributor: K900 <k0009000@gmail.com>
pkgname=steam
pkgver=1.0.0.48
pkgrel=1
pkgdesc="Digital distribution client bootstrap package"
arch=("i686" "x86_64")
url="http://steampowered.com/"
license=('custom')
install=steam.install
source=("http://repo.steampowered.com/$pkgname/pool/$pkgname/s/$pkgname/${pkgname}_$pkgver.tar.gz"
        'lib32-flashplugin-path.patch'
        'alsa_sdl_audiodriver.patch')
md5sums=('d0d9b46bb44d3a3b6b1b44304afe7995'
         '1d83a1df55d677f35ce415e0750f4448'
         'ac0e03d70f1101331598b2b32ed9bac3')
if [[ "$CARCH" == "x86_64" ]]; then
  #depends+=(lib32-libgl lib32-mesa-libgl lib32-gcc-libs lib32-libx11)
  optdepends=(
  'lib32-ati-dri: for open source ATI driver users'
  'lib32-catalyst-utils: for AMD Catalyst users'
  'lib32-intel-dri: for open source Intel driver users'
  'lib32-nouveau-dri: for Nouveau users'
  'lib32-nvidia-utils: for NVIDIA proprietary blob users'
  'lib32-flashplugin: for flash video'
  'lib32-alsa-plugins: for pulseaudio on some games'
  )
prepare() {
    patch -d "$pkgname" -Np1 -i "$srcdir/lib32-flashplugin-path.patch"
    patch -d "$pkgname" -Np1 -i "$srcdir/alsa_sdl_audiodriver.patch"
}
else
    optdepends=('flashplugin: for flash videos')
prepare() {
    patch -d "$pkgname" -Np1 -i "$srcdir/alsa_sdl_audiodriver.patch"
}
fi

package() {
    depends=(
      'bash' 'desktop-file-utils' 'hicolor-icon-theme' 'curl'
      'dbus' 'freetype2'  'gdk-pixbuf2' 'ttf-font' 'zenity'
      )
  if [[ "$CARCH" == x86_64 ]]; then
    depends+=(lib32-libgl lib32-gcc-libs lib32-libx11)
  fi

  # Install license
  make -C "$pkgname" DESTDIR="$pkgdir" install
  
  install -Dm644 "$pkgdir/usr/share/doc/steam/steam_install_agreement.txt" "$pkgdir/usr/share/licenses/steam/LICENSE"

  # blank steamdeps because apt-get
  ln -sf /bin/true "$pkgdir/usr/bin/steamdeps"
}
#vim: set ft=PKGBUILD sw=2 ts=2 et
