void-packages/srcpkgs/xbmc-rpi/template
2014-08-23 16:16:35 +02:00

110 lines
4 KiB
Text

# Template file for 'xbmc-rpi'
pkgname=xbmc-rpi
version=13.2
revision=1
patch_args="-Np1"
wrksrc="xbmc-${version}-Gotham"
short_desc="XBMC Media Center for the Raspberry Pi"
maintainer="Juan RP <xtraeme@gmail.com>"
homepage="http://www.xbmc.org"
license="GPL-2"
distfiles="http://mirrors.xbmc.org/releases/source/xbmc-${version}.tar.gz"
checksum=acbf5dffa3034a3406240ee3cf81e721386cd383d23d056ddde1f769e050e585
only_for_archs="armv6l"
# Due to bootstrap requiring java, it's only possible currently to cross
# compile it from x86.
if [ "$XBPS_MACHINE" != "i686" -a "$XBPS_MACHINE" != "x86_64" ]; then
msg_error "${pkgname}-${version}: can only be cross built on x86."
fi
hostmakedepends="
automake libtool pkg-config gperf cmake zip unzip nasm yasm
swig gettext-devel libltdl-devel python-devel libmysqlclient-devel
SDL_image-devel lzo-devel oracle-jre"
makedepends="
eudev-libudev-devel pcre-devel>=8.30 expat-devel libpng-devel>=1.6 libjpeg-turbo-devel
avahi-libs-devel alsa-lib-devel samba-devel tiff-devel libmysqlclient-devel>=5.5.27
libmpeg2-devel wavpack-devel zlib-devel lzo-devel fribidi-devel sqlite-devel freetype-devel
jasper-devel faac-devel faad2-devel libmodplug-devel libressl-devel libass-devel
libmad-devel fontconfig-devel libsamplerate-devel libmms-devel libcurl-devel
enca-devel boost-devel libbluetooth-devel yajl-devel libplist-devel librtmp-devel
tinyxml-devel taglib-devel libcap-devel lame-devel libnfs-devel libxslt-devel
libcec-devel libmicrohttpd-devel libcdio-devel python-devel libssh-devel rpi-firmware"
# The following dependencies are dlopen(3)ed.
depends="libmad libogg libcurl libflac libmodplug libass libmpeg2 lame
librtmp libnfs libplist libssh"
depends+=" hicolor-icon-theme desktop-file-utils"
provides="xbmc-${version}_${revision}"
# Create xbmc system user to launch xbmc-standalone.
system_accounts="xbmc"
xbmc_homedir="/var/lib/xbmc"
xbmc_groups="audio,input,video"
pre_configure() {
. /etc/profile.d/oracle-jre.sh
./bootstrap
# fix lsb_release dependency
sed -i -e 's:/usr/bin/lsb_release -d:/bin/true:' xbmc/utils/SystemInfo.cpp
# Use cross prefix for python include/libdir.
sed -e "s,-L\$ac_python_libdir,-L${XBPS_CROSS_BASE}/usr/lib,g" -i configure
sed -e "s,PYTHON_CPPFLAGS=\$python_path,PYTHON_CPPFLAGS=-I${XBPS_CROSS_BASE}/usr/include/python2.7,g" -i configure
}
do_configure() {
. /etc/profile.d/oracle-jre.sh
CFLAGS="-O3 -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp -mabi=aapcs-linux"
CFLAGS+=" -I${XBPS_CROSS_BASE}/opt/vc/include/ -I${XBPS_CROSS_BASE}/opt/vc/include/IL"
CFLAGS+=" -I${XBPS_CROSS_BASE}/opt/vc/include/interface/vcos/pthreads"
CFLAGS+=" -I${XBPS_CROSS_BASE}/opt/vc/include/interface/vmcs_host/linux"
CXXFLAGS="$CFLAGS"
LDFLAGS+=" -L${XBPS_CROSS_BASE}/opt/vc/lib"
export CFLAGS CXXFLAGS LDFLAGS
./configure ${configure_args} \
--disable-gl \
--disable-sdl \
--disable-x11 \
--disable-xrandr \
--disable-openmax \
--disable-joystick \
--disable-debug \
--disable-crystalhd \
--disable-vtbdecoder \
--disable-vaapi \
--disable-vdpau \
--disable-pulse \
--disable-projectm \
--disable-optical-drive \
--disable-libbluray \
--with-platform=raspberry-pi \
--enable-gles \
--enable-optimizations \
--enable-libcec \
--enable-player=omxplayer
sed -e "s,\$(DVDREAD_CFLAGS),,g;s,AR=ar,AR=$AR,g;s,LD=ld,LD=$LD,g;s,RANLIB=ranlib,RANLIB=$RANLIB,g" -i lib/libdvd/libdvd{nav,read}/Makefile
sed -e 's,-L/usr/lib,,g' -i lib/cmyth/Makefile
}
do_build() {
make ${makejobs}
}
do_install() {
make DESTDIR=${DESTDIR} install
# Remove checks that don't apply to the raspberry pi
head -n 171 ${DESTDIR}/usr/share/xbmc/FEH.py > ${DESTDIR}/usr/share/xbmc/FEH.py.new
mv ${DESTDIR}/usr/share/xbmc/FEH.py.new ${DESTDIR}/usr/share/xbmc/FEH.py
vinstall tools/Linux/xbmc.desktop 644 usr/share/applications
vinstall media/icon48x48.png 644 usr/share/pixmaps xbmc.png
rm -f ${DESTDIR}/usr/share/icons/hicolor/icon-theme.cache
vinstall ${FILESDIR}/polkit.rules 0644 etc/polkit-1/rules.d 10-xbmc.rules
}