kodi: switch to cmake buildsystem

This commit is contained in:
Enno Boland 2017-05-22 12:55:19 +02:00
parent f7cd601f81
commit c8137de9e9
1 changed files with 15 additions and 51 deletions

View File

@ -1,7 +1,8 @@
# Template file for 'kodi' # Template file for 'kodi'
pkgname=kodi pkgname=kodi
version=17.1 version=17.1
revision=2 revision=3
build_style=cmake
patch_args="-Np1" patch_args="-Np1"
_codename="Krypton" _codename="Krypton"
wrksrc="xbmc-${version}-${_codename}" wrksrc="xbmc-${version}-${_codename}"
@ -11,11 +12,11 @@ homepage="http://www.kodi.tv/"
license="GPL-2" license="GPL-2"
distfiles="https://github.com/xbmc/xbmc/archive/${version}-${_codename}.tar.gz" distfiles="https://github.com/xbmc/xbmc/archive/${version}-${_codename}.tar.gz"
checksum=303f3903cbb57ccc2961f09cf3746505542bcb129a464f0687d7ca8601cebbee checksum=303f3903cbb57ccc2961f09cf3746505542bcb129a464f0687d7ca8601cebbee
build_wrksrc=project/cmake
lib32disabled=yes lib32disabled=yes
only_for_archs="i686 i686-musl x86_64 x86_64-musl" only_for_archs="i686 i686-musl x86_64 x86_64-musl"
# XXX add support for afp.
hostmakedepends=" hostmakedepends="
automake libtool pkg-config gperf cmake zip unzip nasm yasm python-devel automake libtool pkg-config gperf cmake zip unzip nasm yasm python-devel
gettext-devel libltdl-devel curl" gettext-devel libltdl-devel curl"
@ -31,72 +32,35 @@ makedepends="
taglib-devel libcap-devel lame-devel libbluray-devel libnfs-devel ffmpeg-devel taglib-devel libcap-devel lame-devel libbluray-devel libnfs-devel ffmpeg-devel
giflib-devel libxslt-devel gnutls-devel libssh-devel libmicrohttpd-devel giflib-devel libxslt-devel gnutls-devel libssh-devel libmicrohttpd-devel
libcec-devel dcadec-devel crossguid" libcec-devel dcadec-devel crossguid"
# The following dependencies are dlopen(3)ed. # The following dependencies are dlopen(3)ed.
depends="libbluray libmad libvorbis libcurl libflac libmodplug libass libmpeg2 depends="libbluray libmad libvorbis libcurl libflac libmodplug libass libmpeg2
lame librtmp libnfs>=1.9.7 libplist>=1.12" lame librtmp libnfs>=1.9.7 libplist>=1.12"
depends+=" glxinfo hicolor-icon-theme desktop-file-utils xdpyinfo" depends+=" glxinfo hicolor-icon-theme desktop-file-utils xdpyinfo"
# musl builds need generated addons (no java). # musl builds need generated addons (no java).
# gold broken with musl
case "$XBPS_MACHINE" in case "$XBPS_MACHINE" in
*-musl) _kodi_nojava=yes;; *-musl) _kodi_nojava=yes; configure_args+=" -DENABLE_LDGOLD=Off";;
*) hostmakedepends+=" swig openjdk-jre";; *) hostmakedepends+=" swig openjdk-jre";;
esac esac
# The patch fix-curl-750-compatibility.patch patches the kodi code to build against curl >= 7.50.0
# since there were some forward declarations that conflicted after the changes in that curl release.
# The upstream pull request can be found at https://github.com/xbmc/xbmc/pull/10160
# Any updates to this package should bear the upstream PR in mind.
# XXX http://build.voidlinux.eu/builders/x86_64_builder/builds/10520/steps/shell_3/logs/stdio
CXXFLAGS="-fpermissive"
pre_configure() { pre_configure() {
# Copy generated files to avoid requiring java. # Copy generated files to avoid requiring java.
if [ -n "${_kodi_nojava}" ]; then if [ -n "${_kodi_nojava}" ]; then
$XBPS_FETCH_CMD http://repo.voidlinux.eu/distfiles/kodi-${version}-generated-addons.tar.xz mkdir -p build/build/swig
tar xf kodi-${version}-generated-addons.tar.xz -C ${wrksrc}
for f in xbmc/interfaces/python/generated/*.cpp; do # THESE FILES MUST BE UPDATED WITH EVERY VERSION BUMP!
touch ${f/.cpp/.xml} cp -r $FILESDIR/swig.nojava-$version/* -t build/build/swig
done cp $FILESDIR/CMakeCache.txt.nojava build/CMakeCache.txt
BOOTSTRAP_STANDALONE=1 make JAVA=/bin/true SWIG=/bin/true -f codegenerator.mk
echo "set(FOUND_SWIG Yes)" > modules/FindSWIG.cmake
else else
. /etc/profile.d/10_openjdk.sh . /etc/profile.d/10_openjdk.sh
BOOTSTRAP_STANDALONE=1 make -f codegenerator.mk
fi fi
BOOTSTRAP_STANDALONE=1 make -f bootstrap.mk
} }
do_configure() {
# Do not ship version check.
rm -rf addons/service.xbmc.versioncheck
# kodi fails to find it's userdata if it's configured with --libfir=/usr/lib32, see
# https://github.com/voidlinux/void-packages/issues/3302
if [ "${XBPS_TARGET_MACHINE}" = "i686" ]; then post_install() {
configure_args=${configure_args/--libdir=\/usr\/lib32/}
fi
./configure ${configure_args} \
--disable-debug --enable-optimizations --enable-gl \
--enable-sdl --enable-vdpau --enable-vaapi --enable-joystick \
--enable-xrandr --enable-rsxs --enable-projectm --enable-x11 \
--enable-pulse --enable-dvdcss --enable-optical-drive \
--enable-rtmp --enable-samba --enable-nfs --enable-ssh \
--enable-airplay --enable-ffmpeg-libvorbis --enable-udev \
--enable-avahi --enable-libbluray \
--enable-texturepacker --enable-external-libraries \
--with-ffmpeg=shared \
ac_cv_path_JAVA_EXE=/bin/true \
ac_cv_path_SWIG_EXE=/bin/true
}
do_build() {
for f in xbmc/interfaces/python/generated/*.cpp; do
touch ${f/.cpp/.xml}
done
make ${makejobs}
}
do_install() {
make DESTDIR=${DESTDIR} install
vinstall tools/TexturePacker/TexturePacker 755 usr/lib/kodi
# remove unused stuff # remove unused stuff
rm -rf ${DESTDIR}/usr/include rm -rf ${DESTDIR}/usr/include
find ${DESTDIR}/usr/lib -name "*.cmake" -delete find ${DESTDIR}/usr/lib -name "*.cmake" -delete