mirror of
https://gitdl.cn/https://github.com/chakralinux/desktop.git
synced 2025-01-24 18:42:12 +08:00
148 lines
5.1 KiB
Bash
148 lines
5.1 KiB
Bash
#
|
|
# 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>
|
|
|
|
# include global config
|
|
source ../_buildscripts/${current_repo}-${_arch}-cfg.conf
|
|
|
|
# python dependency or not
|
|
_ext_python="disable"
|
|
|
|
pkgname=xbmc
|
|
pkgver=9.11
|
|
pkgrel=1
|
|
pkgdesc="XBMC Media Center"
|
|
arch=('i686' 'x86_64')
|
|
url="http://xbmc.org"
|
|
license=('GPL' 'custom')
|
|
depends=( 'bzip2' 'curl' 'enca' 'faac' 'faad2' 'fontconfig' 'fribidi'
|
|
'glew' 'hal' 'jasper' 'libcdio' 'libgl' 'libmad' 'libmms'
|
|
'libmpeg2' 'libmysqlclient' 'libsamplerate' 'libxinerama'
|
|
'libxrandr' 'libxtst' 'lzo2' 'sdl_image' 'sdl_mixer'
|
|
'smbclient' 'wavpack' )
|
|
if [ "$_ext_python" != "disable" ]; then
|
|
depends=( '${depends[@]}' 'python' )
|
|
fi
|
|
makedepends=('boost' 'cmake' 'gperf' 'nasm' 'libvdpau' 'unzip' 'zip')
|
|
optdepends=('lirc: remote controller support'
|
|
'unrar: access compressed files without unpacking them'
|
|
'devicekit-power: used to trigger suspend functionality')
|
|
install=("${pkgname}.install")
|
|
options=(makeflags)
|
|
source=("http://downloads.sourceforge.net/project/xbmc/XBMC%20Source%20Code/Camelot%20-%20$pkgver/xbmc-${pkgver/_/-}.tar.gz"
|
|
"use_cdio_system_headers_on_non_win32.patch"
|
|
"FEH.sh"
|
|
"libpng14.patch"
|
|
"xbmc-9.11-wavpack.patch"
|
|
"xbmc-9.11-TexturePacker-parallel-build.patch")
|
|
md5sums=('9a68ac1e2f44a54cc3803fcdb1265767'
|
|
'7b7403cdde791330b5ab70697d2054f2'
|
|
'c3e2ab79b9965f1a4a048275d5f222c4'
|
|
'3f93cfc8aa21723ca3246dc5f9122177'
|
|
'062c5f61cd3bb27de66c861fd2c79de1'
|
|
'4b9f89e5ade45142dfb001fbc563b5a6')
|
|
|
|
build() {
|
|
# one core only
|
|
export MAKEFLAGS="-j2"
|
|
|
|
# fix build
|
|
if [ "${_arch}" = "i686" ]; then
|
|
export CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe -D__STDC_CONSTANT_MACROS"
|
|
else
|
|
export CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -D__STDC_CONSTANT_MACROS"
|
|
fi
|
|
|
|
cd "${srcdir}/xbmc-${pkgver/_/-}"
|
|
|
|
# dash the next two lines if U use intel cpu for compiling
|
|
#msg "Applying patch for old SSE"
|
|
#patch xbmc/lib/libsquish/Makefile.in < ${srcdir}/../sse1.patch
|
|
|
|
msg "fix libcdio faults"
|
|
patch -N -p1 -i ${srcdir}/use_cdio_system_headers_on_non_win32.patch || return 1
|
|
msg "fix libpng 1.4 problems"
|
|
patch -Np1 -i ${srcdir}/libpng14.patch || return 1
|
|
msg "fix wavpack builderror"
|
|
patch -Np1 -i ${srcdir}/xbmc-9.11-wavpack.patch || return 1
|
|
msg "fix texture packer builderror"
|
|
patch -Np1 -i ${srcdir}/xbmc-9.11-TexturePacker-parallel-build.patch || return 1
|
|
msg "fix lsb_release dependency"
|
|
sed -i -e 's:/usr/bin/lsb_release -d:cat /etc/chakra-release:' xbmc/utils/SystemInfo.cpp || return 1
|
|
msg "fix faulty declaration in DllLaoder wrapper"
|
|
sed -i 's: ftell64: dll_ftell64:' xbmc/cores/DllLoader/exports/wrapper.c || return 1
|
|
msg "fix libjpeg7 delays"
|
|
sed -i 's|cinfo.scale_denom = GetJpegScale();|cinfo.scale_denom = GetJpegScale(); cinfo.scale_num = 1;|' xbmc/lib/cximage-6.0/CxImage/ximajpg.cpp || return 1
|
|
|
|
if [ $NOEXTRACT -ne 1 ]; then
|
|
# Chakralinux Branding by SVN_REV
|
|
export SVN_REV="-CHAKRA"
|
|
|
|
./bootstrap
|
|
./configure --prefix=/usr \
|
|
--enable-vdpau \
|
|
--disable-pulse \
|
|
--disable-avahi \
|
|
--disable-external-liba52 \
|
|
--disable-external-libdts \
|
|
--enable-external-libmpeg2 \
|
|
--enable-external-libogg \
|
|
--enable-external-libwavpack \
|
|
--disable-external-libass \
|
|
--disable-external-ffmpeg \
|
|
--${_ext_python}-external-python \
|
|
--disable-debug || return 1
|
|
fi
|
|
|
|
make || return 1
|
|
}
|
|
|
|
package() {
|
|
cd "${srcdir}/xbmc-${pkgver/_/-}"
|
|
make prefix=${pkgdir}/usr install || return 1
|
|
|
|
# Fix the shell script
|
|
# sed -i '3iexport SDL_AUDIODRIVER=alsa' ${pkgdir}/usr/bin/xbmc
|
|
|
|
msg "bin/xbmc mods for chakra package"
|
|
sed -i -e 's/which lsb_release &> \/dev\/null/\[ -f \/etc\/chakra-release ]/g' ${pkgdir}/usr/bin/xbmc || return 1
|
|
sed -i -e "s/lsb_release -a 2> \/dev\/null | sed -e 's\/\^\/ \/'/cat \/etc\/chakra-release/g" ${pkgdir}/usr/bin/xbmc || return 1
|
|
sed -i -e 's/\/usr\/share\/xbmc/\/opt\/xbmc/' ${pkgdir}/usr/bin/xbmc || return 1
|
|
|
|
msg "if disabled external python install bash script and fix startup script"
|
|
if [ "$_ext_python" = "disable" ]; then
|
|
install -Dm755 ${srcdir}/FEH.sh \
|
|
${pkgdir}/usr/share/xbmc/FEH.sh || return 1
|
|
sed -i -e "s/python \/opt\/xbmc\/FEH.py \"\$@\"/\/opt\/xbmc\/FEH.sh/g" ${pkgdir}/usr/bin/xbmc || return 1
|
|
fi
|
|
|
|
# License(s)
|
|
msg "copy licences"
|
|
install -dm755 ${pkgdir}/usr/share/licenses/${pkgname}
|
|
for licensef in LICENSE.GPL README.linux copying.txt; do
|
|
mv ${pkgdir}/usr/share/xbmc/${licensef} \
|
|
${pkgdir}/usr/share/licenses/${pkgname} || return 1
|
|
done
|
|
|
|
# cleanup some stuff
|
|
msg "cleanup unneeded dirs"
|
|
rm -r ${pkgdir}/usr/share/xsessions
|
|
|
|
# fix .desktop
|
|
msg "fix .desktop"
|
|
sed -i "s#Exec=xbmc#Exec=/usr/bin/xbmc#" $pkgdir/usr/share/applications/xbmc.desktop || return 1
|
|
|
|
msg "Move Faulty xbmc dir to /opt"
|
|
mkdir $pkgdir/opt/
|
|
mv $pkgdir/usr/share/xbmc $pkgdir/opt
|
|
|
|
msg "Remove old PM3.HD skin"
|
|
rm -r ${pkgdir}/opt/xbmc/skin/PM3.HD || return 1
|
|
|
|
# strip
|
|
msg "strip binaries"
|
|
find $pkgdir -type f -exec strip {} \; >/dev/null 2>/dev/null
|
|
}
|