################################################################################
#      This file is part of OpenELEC - http://www.openelec.tv
#      Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
#
#  This Program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2, or (at your option)
#  any later version.
#
#  This Program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with OpenELEC.tv; see the file COPYING.  If not, write to
#  the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
#  http://www.gnu.org/copyleft/gpl.html
################################################################################

PKG_NAME="xbmc"
PKG_VERSION="ae60d24"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://www.xbmc.org"
PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz"
PKG_DEPENDS="boost Python zlib bzip2 systemd pcre ffmpeg libass curl libssh rtmpdump fontconfig tinyxml freetype libmad libogg libmodplug faad2 flac libmpeg2 taglib yajl sqlite bc xbmc-addon-settings"
PKG_BUILD_DEPENDS="toolchain boost Python zlib bzip2 systemd lzo pcre swig ffmpeg libass enca curl libssh rtmpdump fontconfig fribidi tinyxml libjpeg-turbo libpng tiff freetype jasper libmad libsamplerate libogg libcdio libmodplug faad2 flac libmpeg2 taglib yajl sqlite mysql"
PKG_PRIORITY="optional"
PKG_SECTION="mediacenter"
PKG_SHORTDESC="xbmc: XBMC Mediacenter"
PKG_LONGDESC="XBMC Media Center (which was formerly named Xbox Media Center) is a free and open source cross-platform media player and home entertainment system software with a 10-foot user interface designed for the living-room TV. Its graphical user interface allows the user to easily manage video, photos, podcasts, and music from a computer, optical disk, local network, and the internet using a remote control."
PKG_IS_ADDON="no"

PKG_AUTORECONF="no"

# needed for hosttools (Texturepacker)
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS lzo-host SDL-host SDL_image-host"

# some python stuff needed for various addons
  PKG_DEPENDS="$PKG_DEPENDS Imaging"
  PKG_DEPENDS="$PKG_DEPENDS simplejson"

# various PVR clients
  PKG_DEPENDS="$PKG_DEPENDS xbmc-pvr-addons"
  PKG_DEPENDS="$PKG_DEPENDS xbmc-addon-xvdr"

if [ "$DISPLAYSERVER" = "xorg-server" ]; then
  # for libX11 support
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS libX11 libXext"
  PKG_DEPENDS="$PKG_DEPENDS libX11 libXext"

  # for libXrandr support
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS libXrandr"
  PKG_DEPENDS="$PKG_DEPENDS libXrandr"

  # for SDL support
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS SDL SDL_image"
  PKG_DEPENDS="$PKG_DEPENDS SDL SDL_image"
fi

if [ "$OPENGL" = "Mesa" ]; then
  # for OpenGL (GLX) support
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS Mesa glu glew"
  PKG_DEPENDS="$PKG_DEPENDS Mesa glu glew"
fi

if [ "$OPENGLES_SUPPORT" = yes ]; then
  # for OpenGL-ES support
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS $OPENGLES"
  PKG_DEPENDS="$PKG_DEPENDS $OPENGLES"
fi

# for dbus support
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS dbus"
  PKG_DEPENDS="$PKG_DEPENDS dbus"

if [ "$ALSA_SUPPORT" = yes ]; then
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS alsa-lib"
  PKG_DEPENDS="$PKG_DEPENDS alsa alsa-lib"
fi

if [ "$PULSEAUDIO_SUPPORT" = yes ]; then
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS pulseaudio"
  PKG_DEPENDS="$PKG_DEPENDS pulseaudio"
fi

if [ "$CEC_SUPPORT" = yes ]; then
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS libcec"
  PKG_DEPENDS="$PKG_DEPENDS libcec"
fi

#if [ ! "$LCD_DRIVER" = "none" ]; then
#  PKG_DEPENDS="$PKG_DEPENDS xbmc-addon-lcd"
#fi

if [ "$XBMC_SCR_RSXS" = yes ]; then
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS libXt libXmu"
  PKG_DEPENDS="$PKG_DEPENDS libXt libXmu"
fi

if [ "$FAAC_SUPPORT" = yes ]; then
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS faac"
  PKG_DEPENDS="$PKG_DEPENDS faac"
fi

if [ "$ENCODER_LAME" = yes ]; then
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS lame"
  PKG_DEPENDS="$PKG_DEPENDS lame"
fi

if [ "$ENCODER_VORBIS" = yes ]; then
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS libvorbis"
  PKG_DEPENDS="$PKG_DEPENDS libvorbis"
fi

if [ "$BLURAY_SUPPORT" = yes ]; then
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS libbluray"
  PKG_DEPENDS="$PKG_DEPENDS libbluray"
fi

if [ "$AVAHI_DAEMON" = yes ]; then
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS avahi"
  PKG_DEPENDS="$PKG_DEPENDS avahi"
fi

if [ "$AIRPLAY_SUPPORT" = yes ]; then
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS libplist"
  PKG_DEPENDS="$PKG_DEPENDS libplist"
fi

if [ "$AIRTUNES_SUPPORT" = yes ]; then
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS libshairport"
  PKG_DEPENDS="$PKG_DEPENDS libshairport"
fi

if [ "$NFS_SUPPORT" = yes ]; then
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS libnfs"
  PKG_DEPENDS="$PKG_DEPENDS libnfs"
fi

if [ "$AFP_SUPPORT" = yes ]; then
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS afpfs-ng"
  PKG_DEPENDS="$PKG_DEPENDS afpfs-ng"
fi

if [ "$SAMBA_CLIENT" = yes ]; then
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS samba"
  PKG_DEPENDS="$PKG_DEPENDS samba"
fi

if [ "$WEBSERVER" = yes ]; then
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS libmicrohttpd"
fi

if [ "$OPENMAX_SUPPORT" = yes ]; then
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS $OPENMAX"
  PKG_DEPENDS="$PKG_DEPENDS $OPENMAX"
fi

if [ "$VDPAU" = yes ]; then
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS libvdpau"
  PKG_DEPENDS="$PKG_DEPENDS libvdpau"
fi

if [ "$VAAPI" = yes ]; then
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS libva"
  PKG_DEPENDS="$PKG_DEPENDS libva"
fi

if [ "$CRYSTALHD" = yes ]; then
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS crystalhd"
  PKG_DEPENDS="$PKG_DEPENDS crystalhd"
fi

if [ "$XVBA" = yes ]; then
  PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS xf86-video-fglrx"
fi
