updated on Mon Jan 23 12:00:23 UTC 2012
[aur-mirror.git] / xbmc-git / PKGBUILD
blob58c511623908db5fdb296796aeff520a2c2d2f74
1 # Maintainer: DonVla <donvla@users.sourceforge.net>
2 # Contributor: BlackEagle <ike DOT devolder AT gmail DOT com>
3 # Contributor: Ulf Winkelvos <ulf [at] winkelvos [dot] de>
4 # Contributor: Ralf Barth <archlinux dot org at haggy dot org>
5 # Contributor: B - Thanks for your hints :)
7 # Original credits go to Edgar Hucek <gimli at dark-green dot com>
8 # for his xbmc-vdpau-vdr PKGBUILD at https://archvdr.svn.sourceforge.net/svnroot/archvdr/trunk/archvdr/xbmc-vdpau-vdr/PKGBUILD
10 pkgname=xbmc-git
11 _commit=267d7d8e73081511c0eb51214edcc9c368c06242
12 # 10.1-Dharma release commit
13 #_commit=e9e909922ed87c4f0bc9
14 pkgver=20111226
15 pkgrel=1
16 pkgdesc="XBMC Media Center - git development version"
17 provides=('xbmc')
18 conflicts=('xbmc' 'xbmc-pulse' 'xbmc-svn')
19 replaces=('xbmc-svn')
20 arch=('i686' 'x86_64')
21 url="https://github.com/xbmc/xbmc"
22 license=('GPL' 'LGPL')
23 depends=('faac' 'faad2' 'jasper' 'hicolor-icon-theme' 'libass' 'libcdio' 'libgl' 'libmad' 'libmicrohttpd' 'libplist'
24          'libmodplug' 'libmpeg2' 'libmysqlclient' 'libsamplerate' 'libxtst' 'lsb-release' 'lzo2' 'python2' 
25          'sdl_image>=1.2.10' 'sdl_mixer' 'smbclient' 'unzip' 'wavpack' 'mesa-demos' 'xorg-xdpyinfo' 'yajl')
26 makedepends=('boost' 'cmake' 'git' 'gperf' 'nasm' 
27              # 'crystalhd-snapshot'
28              'zip')
29 optdepends=('avahi: to use zerconf features (remote, etc...)' 
30             'gdb: for meaningful backtraces in case of trouble - STRONGLY RECOMMENDED' 
31             'libcrystalhd: Broadcom CrystalHD kernel module'
32             'libssh: support for sshfs'
33             'libvdpau: accelerated video playback for nvidia cards' 
34             'libva: accelerated video playback for nvidia, ati/amd and some intel cards'
35             'lirc: remote controller support' 
36             'pulseaudio: pulseaudio support'
37             'udisks: automount external drives' 
38             'upower: used to trigger suspend functionality' 
39             'python-simplejson: weather service functionality'
40             'unrar: access compressed files without unpacking them')
41 options=('makeflags')
42 install="${pkgname}.install"
43 source=("FEH.sh" "xbmc-10.0-python-2.7.patch" "xbmc-10.1-gcc-4.6.patch") 
44 _gitroot="git://github.com/xbmc/xbmc.git"
45 _gitname="xbmc"
46 _prefix=/usr
47 md5sums=('5c09caddbf02b07c09a05bbaf7894ee6'
48          '62d46c8b44e4e5313a10922209cb14f8'
49          'd88b854d6f356a74d7658cd1f74a4695')
50 sha256sums=('7128cc43ab8d467b8f18b33d053826f84cbad4855cdb56fde294157299298edb'
51             '8f6b2a0a962ad250fc317542d0fa180585d3c9e630ca98f99299b6f750555085'
52             'cef1154bc3352b215bfece1a749d901d43ec7aa0c6d050921ae8745c553e84c9')
54 build() {
55     cd "${srcdir}"
56     msg "Connecting to GIT server...."
58     if [ -d "${_gitname}" ] ; then
59         cd "${_gitname}" && git checkout master && git pull origin 
60         [[ "${_commit}" ]] && git checkout "${_commit}"
61         msg "The local files are updated."
62         msg "Running make distclean"
63         make distclean || :
64     else
65         git clone "${_gitroot}" "${_gitname}"
66         cd "${_gitname}"
67         [[ "${_commit}" ]] && git checkout "${_commit}"
68     fi
70     # Configure XBMC
71     cd "${srcdir}/${_gitname}"
73     # fix lsb_release dependency
74     sed -i -e 's:/usr/bin/lsb_release -d:cat /etc/arch-release:' xbmc/utils/SystemInfo.cpp
75 #    patch -p0 < "${srcdir}/xbmc-10.0-python-2.7.patch"
76 #    patch -p0 < "${srcdir}/xbmc-10.1-gcc-4.6.patch"
78     # remove "--as-needed" from LDFLAGS
79     unset LDFLAGS; LDFLAGS="-Wl,--hash-style=gnu"
81     msg "Bootstrapping XBMC"
82     ./bootstrap
84     msg "Configuring XBMC" 
85     export PYTHON_VERSION=2  # external python v2
86     ./configure --prefix="${_prefix}" \
87                 --enable-external-libraries \
88                 --disable-external-ffmpeg \
89                 --disable-hal \
90                 --enable-debug 
92     # Now build
93     msg "Running make" 
94     make ${MAKEFLAGS}
97 package() {
99     cd "${srcdir}/${_gitname}"
100     msg "Running make install" 
101     make prefix="${pkgdir}${_prefix}" install
103 # Replace FEH.py with FEH.sh (and thus remove external python dependency)
104     install -D -m 0755 "${srcdir}/FEH.sh" "${pkgdir}${_prefix}/share/xbmc/FEH.sh"
105     sed -i -e 's/^python \(.*\)FEH.py \(.*\)$/\1FEH.sh \2/' "${pkgdir}${_prefix}/bin/xbmc"
107 # lsb_release fix
108     sed -i -e 's/which lsb_release &> \/dev\/null/\[ -f \/etc\/arch-release ]/g' "${pkgdir}${_prefix}/bin/xbmc"
109     sed -i -e "s/lsb_release -a 2> \/dev\/null | sed -e 's\/\^\/    \/'/cat \/etc\/arch-release/g" "${pkgdir}${_prefix}/bin/xbmc"
111 # .desktop files
112     install -D -m 0644 "${srcdir}/${_gitname}/tools/Linux/xbmc.desktop" "${pkgdir}${_prefix}/share/applications/xbmc.desktop"
113     install -D -m 0644 "${srcdir}/${_gitname}/tools/Linux/xbmc-48x48.png" "${pkgdir}${_prefix}/share/pixmaps/xbmc.png"
115 # Tools
116     install -D -m 0755 "${srcdir}/${_gitname}/xbmc-xrandr" "${pkgdir}${_prefix}/share/xbmc/xbmc-xrandr"
117     install -D -m 0755 "${srcdir}/${_gitname}/tools/TexturePacker/TexturePacker" "${pkgdir}${_prefix}/share/xbmc/"
119 # Licenses
120     install -d -m 0755 "${pkgdir}${_prefix}/share/licenses/${pkgname}" 
121     for licensef in LICENSE.GPL copying.txt; do 
122         mv "${pkgdir}${_prefix}/share/doc/xbmc/${licensef}" "${pkgdir}${_prefix}/share/licenses/${pkgname}" 
123     done 
125 # Docs 
126     install -d -m 0755 "${pkgdir}${_prefix}/share/doc/${pkgname}" 
127     for docsf in keymapping.txt README.linux; do 
128         mv "${pkgdir}${_prefix}/share/doc/xbmc/${docsf}" "${pkgdir}${_prefix}/share/doc/${pkgname}" 
129      done
131 # cleanup some stuff
132     msg "Cleanup unneeded files"
133     rm -rf "${pkgdir}/usr/share/xsessions"
134     rm -f "${pkgdir}/usr/share/xbmc/FEH.py"
135     rm -f "${pkgdir}/usr/share/icons/hicolor/icon-theme.cache"
137 # strip
138     msg "Stripping binaries"
139     find "${pkgdir}" -type f -exec strip {} \; >/dev/null 2>/dev/null