PKGBUILDs/alarm/kodi-rbp-git/PKGBUILD

143 lines
4.7 KiB
Bash
Raw Normal View History

2012-09-20 14:27:56 +00:00
# Contributor tomasgroth at yahoo.dk
# Contributor WarheadsSE <max@warheads.net>
2015-02-05 00:16:53 +00:00
buildarch=20
2012-09-20 14:27:56 +00:00
pkgname=kodi-rbp-git
2015-02-01 06:10:38 +00:00
pkgver=15.20150131
2014-07-13 05:09:52 +00:00
pkgrel=1
2012-09-20 14:27:56 +00:00
pkgdesc="A software media player and entertainment hub for digital media for the Raspberry Pi"
arch=('armv6h')
url="http://kodi.tv"
2012-09-20 14:27:56 +00:00
license=('GPL' 'custom')
2015-02-01 06:10:38 +00:00
depends=('hicolor-icon-theme' 'fribidi' 'lzo2' 'smbclient' 'giflib' 'libtiff' 'libva' 'libpng'
'libcdio' 'yajl' 'libmariadbclient' 'libjpeg-turbo' 'libsamplerate' 'libssh' 'libmicrohttpd'
'sdl_image' 'python2' 'libass' 'libmpeg2' 'libmad' 'libmodplug' 'jasper' 'rtmpdump' 'unzip'
'xorg-xdpyinfo' 'libbluray' 'libnfs' 'afpfs-ng' 'avahi' 'bluez-libs' 'tinyxml'
'raspberrypi-firmware' 'libcec' 'libplist' 'swig' 'taglib' 'libxslt' 'shairplay-git')
makedepends=('boost' 'cmake' 'gperf' 'nasm' 'zip' 'udisks' 'upower' 'git' 'autoconf' 'java-environment')
2012-09-20 14:27:56 +00:00
optdepends=(
'lirc: remote controller support'
'udisks: automount external drives'
'upower: used to trigger power management functionality'
'unrar: access compressed files without unpacking them')
2013-11-24 12:38:29 +00:00
2015-02-01 06:10:38 +00:00
provides=('xbmc' 'kodi')
conflicts=('xbmc' 'kodi')
replaces=('xbmc-rbp-git')
install="kodi.install"
source=('kodi.service'
'polkit.rules')
2015-02-01 06:10:38 +00:00
md5sums=('11cbf4307dd468dc9fa638bc8a13846b'
'725bcdb8a5557374ea3522169a8a6423')
_gitname="xbmc"
_gitroot="git://github.com/xbmc"
2014-06-07 19:29:17 +00:00
# Only change _gitbranch if master has moved on to the next release number
# but there's hasn't been a stable release yet.
_gitbranch="master"
2012-09-20 14:27:56 +00:00
_prefix=/usr
2013-04-08 18:51:48 +00:00
prepare() {
cd "${srcdir}"
msg2 "Connecting to GIT server..."
if [[ -d "${_gitname}" ]]; then
cd "${_gitname}" && git pull origin
msg2 "The local files are updated."
else
2014-04-03 06:14:06 +00:00
git clone --branch=${_gitbranch} --depth 1 "${_gitroot}/${_gitname}"
fi
msg2 "GIT checkout done or server timeout."
2012-09-20 14:27:56 +00:00
cd "${srcdir}/${_gitname}"
# fix lsb_release dependency
sed -i -e 's:/usr/bin/lsb_release -d:cat /etc/arch-release:' xbmc/utils/SystemInfo.cpp
2013-04-08 18:51:48 +00:00
}
build() {
cd "${srcdir}/${_gitname}"
2012-09-20 14:27:56 +00:00
# Bootstrapping KODI
2012-09-20 14:27:56 +00:00
./bootstrap
# Configuring KODI
2012-09-20 14:27:56 +00:00
export PYTHON_VERSION=2 # external python v2
# we need to compile for armv6 instead of armv5 to avoid problems compiling assembler code
2015-02-05 00:16:53 +00:00
FLAGS="-Ofast -fexcess-precision=fast -mfloat-abi=hard -mabi=aapcs-linux -pipe -fstack-protector --param=ssp-buffer-size=4 \
-D_FORTIFY_SOURCE=1 -I/opt/vc/include/ -I/opt/vc/include/IL -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
[[ $CARCH == "armv6h" ]] && export CFLAGS="$FLAGS -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfpu=vfp" && exportCXXFLAGS="$FLAGS -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfpu=vfp"
[[ $CARCH == "armv7h" ]] && export CFLAGS="$FLAGS -mcpu=cortex-a7 -mtune=cortex-a7 -mfpu=neon-vfpv4 -mvectorize-with-neon-quad" && export CXXFLAGS="$FLAGS -mcpu=cortex-a7 -mtune=cortex-a7 -mfpu=neon-vfpv4 -mvectorize-with-neon-quad"
2012-09-20 14:27:56 +00:00
export LDFLAGS="$LDFLAGS -L/opt/vc/lib"
2014-09-22 05:42:32 +00:00
# If build fails try uncommenting the line below first
#export MAKEFLAGS="-j1"
2013-12-30 05:21:53 +00:00
2012-09-20 14:27:56 +00:00
./configure --prefix=$_prefix --exec-prefix=$_prefix \
2013-12-30 05:21:53 +00:00
--with-platform=raspberry-pi \
--disable-gl \
--enable-gles \
--disable-x11 \
--disable-sdl \
--enable-optimizations \
--disable-goom \
--disable-pulse \
--disable-vaapi \
--disable-vdpau \
--disable-xrandr \
--enable-airplay \
--enable-airtunes \
--disable-alsa \
--enable-avahi \
--enable-libbluray \
--enable-dvdcss \
--disable-debug \
--disable-joystick \
--disable-mid \
--enable-nfs \
--disable-profiling \
--disable-projectm \
--enable-rsxs \
--enable-rtmp \
--disable-vaapi \
--enable-optical-drive \
2015-02-01 06:10:38 +00:00
--enable-player=omxplayer \
# --enable-texturepacker
2012-09-20 14:27:56 +00:00
make
}
package() {
cd "${srcdir}/${_gitname}"
# Running make install
make DESTDIR="${pkgdir}" install
# run feh with python2
sed -i -e 's/python/python2/g' ${pkgdir}${_prefix}/bin/kodi
2012-09-20 14:27:56 +00:00
# lsb_release fix
sed -i -e 's/which lsb_release > \/dev\/null/\[ -f \/etc\/arch-release ]/g' "${pkgdir}${_prefix}/bin/kodi"
sed -i -e "s/lsb_release -a 2> \/dev\/null | sed -e 's\/\^\/ \/'/cat \/etc\/arch-release/g" "${pkgdir}${_prefix}/bin/kodi"
2012-09-20 14:27:56 +00:00
# Tools
2015-02-01 06:10:38 +00:00
#install -D -m 0755 "${srcdir}/${_gitname}/tools/TexturePacker/TexturePacker" "${pkgdir}${_prefix}/lib/kodi"
2012-09-20 14:27:56 +00:00
# Licenses
install -dm755 "${pkgdir}${_prefix}/share/licenses/${pkgname}"
2012-09-20 14:27:56 +00:00
for licensef in LICENSE.GPL copying.txt; do
mv "${pkgdir}${_prefix}/share/doc/kodi/${licensef}" "${pkgdir}${_prefix}/share/licenses/${pkgname}"
2012-09-20 14:27:56 +00:00
done
install -Dm0644 $srcdir/kodi.service $pkgdir/usr/lib/systemd/system/kodi.service
install -Dm0644 $srcdir/polkit.rules $pkgdir/usr/share/polkit-1/rules.d/10-kodi.rules
chmod 0700 $pkgdir/usr/share/polkit-1/rules.d/
2012-09-20 14:27:56 +00:00
}