kodi-rpi: switch to cmake buildsystem

This commit is contained in:
Enno Boland 2017-05-22 12:56:58 +02:00
parent c8137de9e9
commit cf8ced68d8
14 changed files with 72 additions and 103 deletions

View File

@ -0,0 +1 @@
../../kodi/files/CMakeCache.txt.nojava

View File

@ -0,0 +1 @@
../../kodi/files/swig.nojava-17.1

1
srcpkgs/kodi-rpi/patches Symbolic link
View File

@ -0,0 +1 @@
../kodi/patches

View File

@ -1 +0,0 @@
../../kodi/patches/add-missing-includes.patch

View File

@ -1 +0,0 @@
../../kodi/patches/disable-static-texturepacker-build.patch

View File

@ -1 +0,0 @@
../../kodi/patches/fix-fileemu.patch

View File

@ -1,20 +0,0 @@
--- a/configure.ac.orig 2017-05-21 19:04:34.705518286 +0200
+++ b/configure.ac 2017-05-21 19:05:10.431442782 +0200
@@ -611,7 +611,7 @@ case $host in
CORE_SYSTEM_NAME=linux
ARCH="powerpc64-linux"
;;
- arm*-*-linux-gnu*|arm*-*-linux-uclibc*)
+ arm*-*-linux-gnu*|arm*-*-linux-uclibc*|arm*-*-linux-musl*)
target_platform=target_linux
CORE_SYSTEM_NAME=linux
ARCH="arm"
@@ -621,7 +621,7 @@ case $host in
use_gl=no
USE_STATIC_FFMPEG=1
;;
- aarch64*-*-linux-gnu*|aarch64*-*-linux-uclibc*)
+ aarch64*-*-linux-gnu*|aarch64*-*-linux-uclibc*|aarch64*-*-linux-musl*)
target_platform=target_linux
ARCH="aarch64"
use_arch="aarch64"

View File

@ -1 +0,0 @@
../../kodi/patches/fix-musl.patch

View File

@ -1 +0,0 @@
../../kodi/patches/fortify-source-fix.patch

View File

@ -1,11 +0,0 @@
--- a/tools/depends/native/JsonSchemaBuilder/Makefile.orig 2015-02-06 16:03:11.758503904 +0100
+++ b/tools/depends/native/JsonSchemaBuilder/Makefile 2015-02-06 16:03:29.557107942 +0100
@@ -15,7 +15,7 @@ endif
SOURCE=$(ROOT_DIR)/src
-CONFIGURE=./configure --prefix=$(PREFIX)
+CONFIGURE=CC=cc CXX=g++ CFLAGS= CXXFLAGS= ./configure --prefix=$(PREFIX)
APP=$(SOURCE)/JsonSchemaBuilder
APPBIN=$(PREFIX)/bin/JsonSchemaBuilder

View File

@ -1 +0,0 @@
../../kodi/patches/remove-filewrap.patch

View File

@ -1 +0,0 @@
../../kodi/patches/set-default-stacksize.patch

View File

@ -1 +0,0 @@
../../kodi/patches/versioncheck.patch

View File

@ -2,6 +2,7 @@
pkgname=kodi-rpi pkgname=kodi-rpi
version=17.1 version=17.1
revision=1 revision=1
build_style=cmake
patch_args="-Np1" patch_args="-Np1"
_codename="Krypton" _codename="Krypton"
wrksrc="xbmc-${version}-${_codename}" wrksrc="xbmc-${version}-${_codename}"
@ -11,8 +12,7 @@ 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
broken="https://build.voidlinux.eu/builders/armv7l_builder/builds/2841/steps/shell_3/logs/stdio"
nopie=yes nopie=yes
only_for_archs="armv6l armv6l-musl armv7l armv7l-musl" only_for_archs="armv6l armv6l-musl armv7l armv7l-musl"
@ -20,7 +20,7 @@ only_for_archs="armv6l armv6l-musl armv7l armv7l-musl"
hostmakedepends=" hostmakedepends="
automake libtool pkg-config gperf cmake zip unzip nasm yasm automake libtool pkg-config gperf cmake zip unzip nasm yasm
gettext-devel libltdl-devel python-devel libmysqlclient-devel gettext-devel libltdl-devel python-devel libmysqlclient-devel
SDL2_image-devel lzo-devel swig" SDL2_image-devel lzo-devel"
makedepends=" makedepends="
eudev-libudev-devel pcre-devel expat-devel libpng-devel libjpeg-turbo-devel eudev-libudev-devel pcre-devel expat-devel libpng-devel libjpeg-turbo-devel
avahi-libs-devel alsa-lib-devel samba-devel tiff-devel libmysqlclient-devel avahi-libs-devel alsa-lib-devel samba-devel tiff-devel libmysqlclient-devel
@ -29,19 +29,34 @@ makedepends="
libmad-devel fontconfig-devel libsamplerate-devel libmms-devel libcurl-devel ffmpeg-devel libmad-devel fontconfig-devel libsamplerate-devel libmms-devel libcurl-devel ffmpeg-devel
enca-devel boost-devel libbluetooth-devel yajl-devel libplist-devel librtmp-devel enca-devel boost-devel libbluetooth-devel yajl-devel libplist-devel librtmp-devel
tinyxml-devel taglib-devel libcap-devel lame-devel libnfs-devel libxslt-devel libuuid-devel giflib-devel tinyxml-devel taglib-devel libcap-devel lame-devel libnfs-devel libxslt-devel libuuid-devel giflib-devel
libcec-devel libmicrohttpd-devel libcdio-devel python-devel libssh-devel rpi-userland-devel dcadec-devel crossguid" libcec-devel libmicrohttpd-devel libcdio-devel python-devel libssh-devel rpi-userland-devel dcadec-devel crossguid cmake"
# gold broken with musl
case "$XBPS_MACHINE" in
*-musl) configure_args+=" -DENABLE_LDGOLD=Off";;
esac
configure_args="
-DCORE_SYSTEM_NAME=rbpi
-DENABLE_OPENGL=OFF
-DENABLE_OPENGLES=ON
-DENABLE_X11=OFF
-DENABLE_INTERNAL_CROSSGUID=OFF
-DENABLE_VAAPI=OFF
-DENABLE_VDPAU=OFF
-DCMAKE_PREFIX_PATH=${XBPS_CROSS_BASE}/opt/vc
"
case "$XBPS_TARGET_MACHINE" in
armv6*) configure_args+=" -DWITH_CPU=arm1176jzf-s";;
armv7*) configure_args+=" -DWITH_CPU=cortex-a7";;
aarch64*) configure_args+=" -DWITH_CPU=cortex-a53";;
esac
# The following dependencies are dlopen(3)ed. # The following dependencies are dlopen(3)ed.
depends="libmad libogg libcurl libflac libmodplug libass libmpeg2 lame depends="libmad libogg libcurl libflac libmodplug libass libmpeg2 lame
librtmp libnfs>=1.9.7 libplist>=1.12 libssh" librtmp libnfs>=1.9.7 libplist>=1.12 libssh"
depends+=" hicolor-icon-theme desktop-file-utils" depends+=" hicolor-icon-theme desktop-file-utils"
# musl builds need generated addons (no java).
case "$XBPS_MACHINE" in
*-musl) _kodi_nojava=yes;;
*) hostmakedepends+=" openjdk-jre";;
esac
provides="kodi-${version}_${revision}" provides="kodi-${version}_${revision}"
# Create xbmc system user to launch xbmc-standalone. # Create xbmc system user to launch xbmc-standalone.
@ -50,65 +65,55 @@ xbmc_homedir="/var/lib/xbmc"
xbmc_groups="audio,input,video" xbmc_groups="audio,input,video"
pre_configure() { pre_configure() {
find ../.. -type f | \
grep "configure\.ac\|Makefile\|cmake\|config\.site" | \
xargs sed -i -e "s;-isystem;-I;g"
# Copy generated files to avoid requiring java. # Copy generated files to avoid requiring java.
if [ -n "${_kodi_nojava}" ]; then mkdir -p build/build/swig
$XBPS_FETCH_CMD http://repo.voidlinux.eu/distfiles/kodi-${version}-generated-addons.tar.xz
tar xf kodi-${version}-generated-addons.tar.xz -C ${wrksrc} # THESE FILES MUST BE UPDATED WITH EVERY VERSION BUMP!
BOOTSTRAP_STANDALONE=1 make JAVA=/bin/true -f codegenerator.mk # (See kodi template)
else cp -r $FILESDIR/swig.nojava-$version/* -t build/build/swig
. /etc/profile.d/10_openjdk.sh cp $FILESDIR/CMakeCache.txt.nojava build/CMakeCache.txt
BOOTSTRAP_STANDALONE=1 make -f codegenerator.mk
echo "set(FOUND_SWIG Yes)" > modules/FindSWIG.cmake
if [ "$CROSS_BUILD" ]; then
for i in JsonSchemaBuilder TexturePacker; do
cat > modules/Find$i.cmake <<EOF
add_executable($i::$i IMPORTED GLOBAL)
set_target_properties($i::$i PROPERTIES
IMPORTED_LOCATION "\${CORE_SOURCE_DIR}/tools/depends/native/$i/bin/$i")
set_target_properties($i::$i PROPERTIES FOLDER Tools)
EOF
done
fi fi
BOOTSTRAP_STANDALONE=1 make -f bootstrap.mk
# Use cross prefix for python include/libdir.
sed -e "s,-L\$ac_python_libdir,-L${XBPS_CROSS_BASE}/usr/lib,g" -i configure
sed -e "s,PYTHON_CPPFLAGS=\$python_path,PYTHON_CPPFLAGS=-I${XBPS_CROSS_BASE}/usr/include/python2.7,g" -i configure
} }
do_configure() { pre_build() {
# Do not ship version check. if [ "$CROSS_BUILD" ]; then
rm -rf addons/service.xbmc.versioncheck for i in JsonSchemaBuilder TexturePacker; do
CC= LD= CXX= LDFLAGS= CFLAGS= CXXFLAGS= \
CFLAGS+=" -I${XBPS_CROSS_BASE}/opt/vc/include/ -I${XBPS_CROSS_BASE}/opt/vc/include/IL" make -C ../../tools/depends/native/$i
CFLAGS+=" -I${XBPS_CROSS_BASE}/opt/vc/include/interface/vcos/pthreads" done
CFLAGS+=" -I${XBPS_CROSS_BASE}/opt/vc/include/interface/vmcs_host/linux" fi
CXXFLAGS="$CFLAGS -fpermissive"
LDFLAGS+=" -L${XBPS_CROSS_BASE}/opt/vc/lib -Wl,-R/opt/vc/lib"
export CFLAGS CXXFLAGS LDFLAGS
./configure ${configure_args} \
--disable-gl \
--disable-sdl \
--disable-x11 \
--disable-xrandr \
--disable-openmax \
--disable-joystick \
--disable-debug \
--disable-crystalhd \
--disable-vtbdecoder \
--disable-vaapi \
--disable-vdpau \
--disable-pulse \
--disable-projectm \
--disable-optical-drive \
--disable-libbluray \
--with-platform=raspberry-pi \
--enable-gles \
--enable-optimizations \
--enable-libcec \
--enable-player=omxplayer \
--enable-external-libraries \
--with-ffmpeg=shared \
ac_cv_path_JAVA_EXE=/bin/true
sed -e "s,\$(DVDREAD_CFLAGS),,g;s,AR=ar,AR=$AR,g;s,LD=ld,LD=$LD,g;s,RANLIB=ranlib,RANLIB=$RANLIB,g" -i tools/depends/target/libdvd{nav,read}/Makefile
} }
do_build() {
make ${makejobs} post_build() {
# Rebuild for target
if [ "$CROSS_BUILD" ]; then
for i in JsonSchemaBuilder TexturePacker; do
make -C ../../../tools/depends/native/$i clean all \
CC="$CC" CXX="$CXX" LD="$LD" AR="$AR" RANLIB="$RANLIB" \
CPP="$CPP" AS="$AS" OBJDUMP="$OBJDUMP" \
CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"
done
fi
} }
do_install() {
make DESTDIR=${DESTDIR} install post_install() {
# remove unused stuff
rm -rf ${DESTDIR}/usr/include rm -rf ${DESTDIR}/usr/include
vsv xbmc-standalone find ${DESTDIR}/usr/lib -name "*.cmake" -delete
} }