#!/bin/bash
cd /tmp
git clone https://github.com/opdenkamp/xbmc-pvr-addons.git
cd xbmc-pvr-addons
  wget http://svn.stmlabs.com/svn/raspbmc/patches/XBMC-hardfp/depends.patch
  wget http://svn.stmlabs.com/svn/raspbmc/patches/XBMC-hardfp/setup-sdk.patch
  wget http://svn.stmlabs.com/svn/raspbmc/patches/XBMC-hardfp/XBMC-PVR-dep.patch
  patch -p1 < setup-sdk.patch
  # hack due to different paths
  sed -i 's/depends\/depends.mk/depends.mk/g' depends.patch
  patch -p1 < depends.patch
  patch -p1 < XBMC-PVR-dep.patch
if [ ! -d /proc/cpuinfo ] ; then mount -t proc proc /proc; fi
sh tools/rbp/setup-sdk.sh
make -C tools/rbp/
make install

