# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="1" inherit autotools eutils flag-o-matic subversion ESVN_REPO_URI="https://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/linuxport/XBMC" DESCRIPTION="XBMC is a free and open source media-player and entertainment hub" HOMEPAGE="http://xbmc.org/" LICENSE="GPL-2" SLOT="0" KEYWORDS="" IUSE="ccache +debug gprof joystick mms opengl" RDEPEND="ccache? ( dev-util/ccache ) mms? ( media-libs/libmms ) opengl? ( virtual/opengl ) app-arch/bzip2 app-arch/unrar app-arch/unzip app-arch/zip app-i18n/enca dev-lang/nasm >=dev-lang/python-2.4 dev-libs/boost dev-libs/fribidi dev-libs/libpcre dev-libs/lzo dev-libs/tre =dev-python/pysqlite-2* dev-util/cmake media-libs/alsa-lib media-libs/faac media-libs/fontconfig media-libs/freetype media-libs/glew media-libs/jasper media-libs/libmad media-libs/libogg media-libs/libvorbis media-libs/sdl-gfx media-libs/sdl-image media-libs/sdl-mixer media-libs/sdl-sound net-misc/curl sys-apps/dbus sys-apps/hal sys-apps/lsb-release sys-apps/pmount virtual/mysql x11-libs/libXinerama x11-libs/libXrandr x11-libs/libXrender x11-proto/xineramaproto " DEPEND="${RDEPEND}" pkg_setup() { # Video playback gives either segfaults or floating point exceptions # # if media-libs/alsa-lib is not built with 'debug' USE flag enabled # if ! built_with_use media-libs/alsa-lib debug; then die "media-libs/alsa-lib needs to be built with the 'debug' USE flag enabled." fi # media-libs/libsdl USE flag checks # if use joystick && built_with_use media-libs/libsdl nojoystick; then die "media-libs/libsdl needs to be built with USE -nojoystick." fi for flag in {alsa,X}; do if ! built_with_use media-libs/libsdl ${flag}; then die "media-libs/libsdl needs to be built with the \'${flag}\' USE flag enabled." fi done # media-libs/sdl-image USE flag checks # for flag in {gif,jpeg,png}; do if ! built_with_use media-libs/sdl-image ${flag}; then die "media-libs/sdl-image needs to be built with the \'${flag}\' USE flag enabled." fi done } src_unpack() { subversion_src_unpack # XBMC's autotools files (configure.{ac,in}, Makefile.{ac,in}, ltmain.sh, etc.) can be distro specific # # and in need of some love. If we need to regenerate 'configure', 'Makefile', 'ltmain.sh', etc., # # (in the case where we don't run Debian/Ubuntu or have a version of libtool greater than 1.5*), # # we run into problems, so let's clean this up # for file in `find . -name configure.ac`; do echo 'AC_PROG_CXX' >> "${file}" done for file in `find . -name configure.in`; do echo 'AC_PROG_CXX' >> "${file}" sed -e '/AM_PATH_XMMS/ c\echo' \ -i ${file} || die "Sed failed for \'${file}\'" sed -e '/AM_PATH_SDL2/ c\echo' \ -i ${file} || die "Sed failed for \'${file}\'" done sed -e 's/test_libFLAC++//g' \ -i xbmc/cores/paplayer/flac-1.2.1/src/Makefile.am || \ die "Sed failed for \'${S}/xbmc/cores/paplayer/flac-1.2.1/src/Makefile.am\'" # Prevent Mac OSX files being installed # rm -rf system/python/lib-osx/ rm system/players/dvdplayer/*-osx* # Clean up XBMC's wrapper script # echo '#!/bin/sh' > tools/Linux/xbmc.sh.in echo '' >> tools/Linux/xbmc.sh.in echo 'export XBMC_PLATFORM_MODE=1' >> tools/Linux/xbmc.sh.in # media-libs/libsdl defaults to 'oss' if built with that USE flag # which is incompatible with xbmc, so force it to use 'alsa' echo 'export SDL_AUDIODRIVER=alsa' >> tools/Linux/xbmc.sh.in echo 'exec @prefix@/share/xbmc/xbmc.bin -fs $*' >> tools/Linux/xbmc.sh.in for dir in \ . \ xbmc/cores/dvdplayer/Codecs/libDVDCSS \ xbmc/cores/dvdplayer/Codecs/libdts \ xbmc/cores/dvdplayer/Codecs/libdvdnav \ xbmc/cores/dvdplayer/Codecs/libfaad2 \ xbmc/cores/dvdplayer/Codecs/libmad \ xbmc/cores/dvdplayer/Codecs/libmpeg2 \ xbmc/cores/paplayer/flac-1.2.1 \ xbmc/cores/paplayer/vorbisfile/libvorbis \ xbmc/cores/paplayer/vorbisfile/ogg \ xbmc/visualizations/Goom/goom2k4-0 \ xbmc/lib/libass \ xbmc/lib/libid3tag/libid3tag do cd ${S}/${dir} eautoreconf done cd ${S} # Fix XBMC's final version string showing as "exported" instead of the SVN revision number # sed -e "s/\$(svnversion -n .)/${ESVN_WC_REVISION}/g" \ -i configure || die "Sed failed for \'${S}/configure\'" # Disable problem building of internal linked libraries' API docs if latex/doxygen are present # sed -e 's#^AC_PATH_PROG(LATEX.*$#LATEX="no"#g' \ -i xbmc/cores/dvdplayer/Codecs/libDVDCSS/configure.ac || \ die "Sed failed for \'${S}/xbmc/cores/dvdplayer/Codecs/libDVDCSS/configure.ac\'" } src_compile() { # Strip out the use of custom C{XX}FLAGS to make debugging easier for upstream # use debug && strip-flags econf \ $(use_enable ccache) \ $(use_enable debug) \ $(use_enable gprof profiling) \ $(use_enable joystick) \ $(use_enable mms) \ $(use_enable opengl gl) \ || die "Configure failed!" # Libtool greater than 1.5* has 'autoconf' creating a corrupt 'configure' script in these # # directories with the following errors ... # # './configure: line xxx: _LT_CMD_GLOBAL_SYMBOLS: command not found' # # or # # X--tag=CC: command not found # # Not sure why, maybe the configure.ac needs to be re-written to support the newer tools or maybe # # it needs to be invoked in some special way # # Anyway, libtoolize is not necessary in these modules, so we're able to get away with using the distributed # # 'configure' script without running 'autoconf' and friends, but need to disable the generated Makefile # # from running 'autoconf' etc. for makefile in \ xbmc/screensavers/rsxs-0.9/Makefile \ xbmc/cores/paplayer/MPCCodec/Makefile do for ac_tool in {ACLOCAL,AUTOCONF,AUTOHEADER,AUTOMAKE}; do sed -e "/^${ac_tool} = / c\\${ac_tool} = echo" \ -i "${makefile}" || \ die "Sed failed for ${ac_tool} in \'${S}/${makefile}\'" done done emake || die "Make failed!" einfo einfo "Generating textures..." einfo cd "${S}" for skin in skin/* ; do ./tools/XBMCTex/XBMCTex -input "\"${skin}/media/\"" \ -output "\"${skin}/media/Textures.xpr\"" || die "XBMCTex failed..." done # Fix case sensitivity # mv "${S}/media/Fonts/arial.ttf" "${S}/media/Fonts/Arial.ttf" mv "${S}/media/Splash.png" "${S}/media/splash.png" # Unzip web content # unzip "${S}"/web/Project_Mayhem_III_webserver_*.zip -d "${S}/web/" || die "Unzip web content failed..." } src_install() { einstall INSTALL_ROOT="${D}" || die "Install failed!" for doc in LICENSE.GPL README.linux copying.txt known_issues.txt; do dodoc "${doc}"; done rm ${D}/usr/share/xbmc/README.linux ${D}/usr/share/xbmc/LICENSE.GPL ${D}/usr/share/xbmc/*.txt mkdir -p "${D}/etc/env.d" echo "CONFIG_PROTECT=\"/usr/share/${PN}/userdata\"" > "${D}/etc/env.d/95${PN}" insinto /usr/share/applications doins tools/Linux/${PN}.desktop insinto /usr/share/pixmaps doins tools/Linux/${PN}.png } pkg_postinst() { elog elog "Toggle fullscreen mode using the backslash key" elog "To access a MythTV backend, add \'mythtv://:@/\'" elog " as a new source in the \'Videos\' section" elog "For further documentation, visit http://xbmc.org/wiki/?title=XBMC_Online_Manual" elog elog "Details on filing bugs to upstream can be found at" elog "http://xbmc.org/wiki/?title=HOW-TO_Submit_a_Proper_Bug_Report" elog "Make sure you (re)build with the 'debug' USE flag enabled" elog }