desktop/xbmc/PKGBUILD

131 lines
4.6 KiB
Bash
Raw Normal View History

2010-06-08 05:54:36 +08:00
#
# Chakra Packages for Chakra, part of chakra-project.org
#
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
# python dependency or not
_ext_python="disable"
2010-12-21 07:23:30 +08:00
_prefix=/usr
2010-06-08 05:54:36 +08:00
pkgname=xbmc
2010-12-21 07:23:30 +08:00
pkgver=10.0
2011-02-15 05:52:14 +08:00
pkgrel=3
2010-06-08 05:54:36 +08:00
pkgdesc="XBMC Media Center"
arch=('i686' 'x86_64')
url="http://xbmc.org"
license=('GPL' 'custom')
depends=( 'bzip2' 'curl' 'enca' 'faac' 'faad2' 'fontconfig' 'fribidi'
2011-02-15 05:52:14 +08:00
'glew' 'jasper' 'libcdio' 'libgl' 'libmad' 'libmms'
2010-12-21 07:23:30 +08:00
'libmpeg2' 'libmysqlclient' 'libsamplerate' 'libxinerama'
'libxrandr' 'libxtst' 'lzo2' 'sdl_image' 'sdl_mixer'
2011-02-15 05:52:14 +08:00
'smbclient' 'wavpack' 'mesa-demos' 'xorg-utils' 'libmicrohttpd'
'libssh' 'libva' 'libmodplug' 'rtmpdump' 'lsb-release')
2011-02-15 06:23:18 +08:00
makedepends=('cvs')
2010-06-08 05:54:36 +08:00
if [ "$_ext_python" != "disable" ]; then
2010-12-21 07:23:30 +08:00
depends=( '${depends[@]}' 'python2' )
2010-06-08 05:54:36 +08:00
fi
makedepends=('boost' 'cmake' 'gperf' 'nasm' 'libvdpau' 'unzip' 'zip')
optdepends=('lirc: remote controller support'
2010-12-21 07:23:30 +08:00
'unrar: access compressed files without unpacking them'
'devicekit-power: used to trigger suspend functionality'
2011-02-15 05:52:14 +08:00
'udisks: automount external drives'
'upower: used to trigger suspend functionality'
'libvdpau: for nvidia hardware acceleration'
'lcms'
'tk')
2010-06-08 05:54:36 +08:00
install=("${pkgname}.install")
options=(makeflags)
2010-12-21 07:23:30 +08:00
source=("http://mirrors.xbmc.org/releases/source/xbmc-$pkgver.tar.gz"
2011-02-15 05:52:14 +08:00
"http://chakra-project.org/sources/xbmc/xbmc-10.0-skin.confluence-Textures.xbt"
"FEH.sh")
2010-12-21 07:23:30 +08:00
md5sums=('728fb514e5f43f27bb880305061b4e72'
2010-12-21 21:00:50 +08:00
'327d954676126eacfda28b1316f0ff7c'
2010-12-21 07:23:30 +08:00
'c3e2ab79b9965f1a4a048275d5f222c4')
2010-06-08 05:54:36 +08:00
build() {
2010-12-21 07:23:30 +08:00
cd "${srcdir}/xbmc-$pkgver"
2011-02-15 05:52:14 +08:00
pacman -Q libass && { msg "Remove libass"; return 1; }
2010-12-21 19:10:48 +08:00
2010-12-21 07:23:30 +08:00
# remove "--as-needed" from LDFLAGS
unset LDFLAGS; LDFLAGS="-Wl,--hash-style=gnu"
2010-06-08 05:54:36 +08:00
2010-12-21 07:23:30 +08:00
msg "Bootstrapping XBMC"
2010-06-08 05:54:36 +08:00
./bootstrap
2010-12-21 07:23:30 +08:00
msg "Configuring XBMC"
2010-06-08 05:54:36 +08:00
./configure --prefix=/usr \
2010-12-21 07:23:30 +08:00
--enable-vdpau \
--disable-pulse \
2011-02-15 05:52:14 +08:00
--disable-hal \
2010-12-21 07:23:30 +08:00
--disable-avahi \
--disable-external-liba52 \
--disable-external-libdts \
--enable-external-libmpeg2 \
--enable-external-libogg \
--enable-external-libwavpack \
--disable-external-libass \
--disable-external-ffmpeg \
2011-02-15 05:52:14 +08:00
--enable-rtmp \
2010-12-21 07:23:30 +08:00
--${_ext_python}-external-python \
--disable-debug
2010-12-21 21:00:50 +08:00
# Fix textures bug in i686
if [ "${CARCH}" = "i686" ]; then
2011-02-15 05:52:14 +08:00
msg "Fixing Textures.xbt in i686"
cp -v ${srcdir}/xbmc-10.0-skin.confluence-Textures.xbt ${srcdir}/xbmc-${pkgver}/addons/skin.confluence/media/Textures.xbt
sed -i -e 's~$(MAKE) -C $(CONFLUENCE_MEDIA)~echo "SKIPPING Textures.xbt"~g' ${srcdir}/xbmc-${pkgver}/Makefile.in
sed -i -e 's~$(MAKE) -C $(CONFLUENCE_MEDIA)~echo "SKIPPING Textures.xbt"~g' ${srcdir}/xbmc-${pkgver}/Makefile
2010-12-21 21:00:50 +08:00
fi
2011-02-15 05:52:14 +08:00
2010-12-21 21:00:50 +08:00
2010-12-21 07:23:30 +08:00
# Now (finally) build
msg "Running make"
make ${MAKEFLAGS}
make -C lib/addons/script.module.pil
make -C lib/addons/script.module.pysqlite
2010-06-08 05:54:36 +08:00
}
package() {
2010-12-21 07:23:30 +08:00
cd "${srcdir}/xbmc-$pkgver"
msg "Running make install"
make prefix="${pkgdir}${_prefix}" install
# Replace FEH.py with FEH.sh (and thus remove external python dependency)
install -D -m 0755 "${srcdir}/FEH.sh" "${pkgdir}${_prefix}/share/xbmc/FEH.sh"
sed -i -e 's/^python \(.*\)FEH.py \(.*\)$/\1FEH.sh \2/' "${pkgdir}${_prefix}/bin/xbmc"
# lsb_release fix
2011-02-15 05:52:14 +08:00
sed -i -e 's/which lsb_release &> \/dev\/null/\[ -f \/etc\/arch-release ]/g' "${pkgdir}${_prefix}/bin/xbmc"
sed -i -e "s/lsb_release -a 2> \/dev\/null | sed -e 's\/\^\/ \/'/cat \/etc\/arch-release/g" "${pkgdir}${_prefix}/bin/xbmc"
2010-12-21 07:23:30 +08:00
# .desktop files
install -D -m 0644 "${srcdir}/xbmc-$pkgver/tools/Linux/xbmc.desktop" "${pkgdir}${_prefix}/share/applications/xbmc.desktop"
install -D -m 0644 "${srcdir}/xbmc-$pkgver/tools/Linux/xbmc-48x48.png" "${pkgdir}${_prefix}/share/pixmaps/xbmc.png"
# Tools
install -D -m 0755 "${srcdir}/xbmc-$pkgver/xbmc-xrandr" "${pkgdir}${_prefix}/share/xbmc/xbmc-xrandr"
install -D -m 0755 "${srcdir}/xbmc-$pkgver/tools/TexturePacker/TexturePacker" "${pkgdir}${_prefix}/share/xbmc/"
# Licenses
install -d -m 0755 "${pkgdir}${_prefix}/share/licenses/${pkgname}"
for licensef in LICENSE.GPL copying.txt; do
mv "${pkgdir}${_prefix}/share/doc/xbmc/${licensef}" "${pkgdir}${_prefix}/share/licenses/${pkgname}"
done
# Docs
install -d -m 0755 "${pkgdir}${_prefix}/share/doc/${pkgname}"
# cleanup some stuff
msg "Cleanup unneeded files"
rm -rf "${pkgdir}/usr/share/xsessions"
rm -f "${pkgdir}/usr/share/xbmc/FEH.py"
rm -f "${pkgdir}/usr/share/icons/hicolor/icon-theme.cache"
# strip
msg "Stripping binaries"
find "$pkgdir" -type f -exec strip {} \; >/dev/null 2>/dev/null
2010-06-08 05:54:36 +08:00
}