void-packages/srcpkgs/kodi/template
Juergen Buchmueller aaae36b3de kodi: fix gcc6 build
Thanks to Arch Linux and Bernd Kuhls for the patch.
2016-10-19 01:56:23 +02:00

103 lines
4.1 KiB
Bash

# Template file for 'kodi'
pkgname=kodi
version=16.1
revision=7
patch_args="-Np1"
_codename="Jarvis"
wrksrc="xbmc-${version}-${_codename}"
short_desc="A software media player and entertainment hub for digital media"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
homepage="http://www.kodi.tv/"
license="GPL-2"
distfiles="https://github.com/xbmc/xbmc/archive/${version}-${_codename}.tar.gz"
checksum=7d82c8aff2715c83deecdf10c566e26105bec0473af530a1356d4c747ebdfd10
lib32disabled=yes
only_for_archs="i686 i686-musl x86_64 x86_64-musl"
# XXX add support for afp.
hostmakedepends="
automake libtool pkg-config gperf cmake zip unzip nasm yasm python-devel
gettext-devel libltdl-devel curl"
makedepends="
eudev-libudev-devel pcre-devel expat-devel libpng-devel libjpeg-turbo-devel
libXrandr-devel avahi-libs-devel pulseaudio-devel samba-devel tiff-devel
libmysqlclient-devel libmpeg2-devel wavpack-devel zlib-devel lzo-devel
libXmu-devel glew-devel fribidi-devel sqlite-devel libcdio-devel freetype-devel
jasper-devel faac-devel SDL2_image-devel faad2-devel libmodplug-devel libressl-devel
libmad-devel fontconfig-devel libXinerama-devel libsamplerate-devel libmms-devel
enca-devel boost-devel libcurl-devel libva-devel libvdpau-devel libass-devel
libbluetooth-devel yajl-devel libplist-devel librtmp-devel tinyxml-devel
taglib-devel libcap-devel lame-devel libbluray-devel libnfs-devel ffmpeg-devel
giflib-devel libxslt-devel gnutls-devel libssh-devel libmicrohttpd-devel
libcec-devel dcadec-devel crossguid"
# The following dependencies are dlopen(3)ed.
depends="libbluray libmad libvorbis libcurl libflac libmodplug libass libmpeg2
lame librtmp libnfs>=1.9.7 libplist>=1.12"
depends+=" glxinfo hicolor-icon-theme desktop-file-utils xdpyinfo"
# musl builds need generated addons (no java).
case "$XBPS_MACHINE" in
*-musl) _kodi_nojava=yes;;
*) hostmakedepends+=" swig openjdk-jre";;
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() {
# Copy generated files to avoid requiring java.
if [ -n "${_kodi_nojava}" ]; then
$XBPS_FETCH_CMD http://repo.voidlinux.eu/distfiles/kodi-${version}-generated-addons.tar.xz
tar xf kodi-${version}-generated-addons.tar.xz -C ${wrksrc}
for f in xbmc/interfaces/python/generated/*.cpp; do
touch ${f/.cpp/.xml}
done
BOOTSTRAP_STANDALONE=1 make JAVA=/bin/true SWIG=/bin/true -f codegenerator.mk
else
. /etc/profile.d/10_openjdk.sh
BOOTSTRAP_STANDALONE=1 make -f codegenerator.mk
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
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
rm -rf ${DESTDIR}/usr/include
find ${DESTDIR}/usr/lib -name "*.cmake" -delete
}