kumquat-buildroot/package/kodi/kodi.mk

274 lines
8.3 KiB
Makefile
Raw Normal View History

################################################################################
#
# kodi
#
################################################################################
KODI_VERSION = 15.1-Isengard
KODI_SITE = $(call github,xbmc,xbmc,$(KODI_VERSION))
KODI_LICENSE = GPLv2
KODI_LICENSE_FILES = LICENSE.GPL
# needed for binary addons
KODI_INSTALL_STAGING = YES
KODI_DEPENDENCIES = host-gawk host-gettext host-gperf host-infozip host-giflib \
host-libjpeg host-lzo host-nasm host-libpng host-swig
KODI_DEPENDENCIES += boost bzip2 expat ffmpeg fontconfig freetype jasper jpeg \
libass libcdio libcurl libfribidi libgcrypt libmpeg2 \
libogg libplist libpng libsamplerate libsquish libvorbis libxml2 \
libxslt lzo ncurses openssl pcre python readline sqlite taglib tiff \
tinyxml yajl zlib
KODI_CONF_ENV = \
PYTHON_VERSION="$(PYTHON_VERSION_MAJOR)" \
PYTHON_LDFLAGS="-lpython$(PYTHON_VERSION_MAJOR) -lpthread -ldl -lutil -lm" \
PYTHON_CPPFLAGS="-I$(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR)" \
PYTHON_SITE_PKG="$(STAGING_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages" \
PYTHON_NOVERSIONCHECK="no-check" \
use_texturepacker_native=yes \
USE_TEXTUREPACKER_NATIVE_ROOT="$(HOST_DIR)/usr" \
TEXTUREPACKER_NATIVE_ROOT="$(HOST_DIR)/usr"
KODI_CONF_OPTS += \
--with-ffmpeg=shared \
--disable-joystick \
--disable-openmax \
--disable-projectm \
--disable-pulse \
--disable-ssh \
--disable-vdpau \
--disable-vtbdecoder \
--enable-optimizations
ifeq ($(BR2_PACKAGE_MYSQL),y)
KODI_CONF_OPTS += --enable-mysql
KODI_CONF_ENV += ac_cv_path_MYSQL_CONFIG="$(STAGING_DIR)/usr/bin/mysql_config"
KODI_DEPENDENCIES += mysql
else
KODI_CONF_OPTS += --disable-mysql
endif
ifeq ($(BR2_PACKAGE_RPI_USERLAND),y)
KODI_DEPENDENCIES += rpi-userland
KODI_CONF_OPTS += --with-platform=raspberry-pi --enable-player=omxplayer
KODI_CONF_ENV += INCLUDES="-I$(STAGING_DIR)/usr/include/interface/vcos/pthreads \
-I$(STAGING_DIR)/usr/include/interface/vmcs_host/linux" \
LIBS="-lvcos -lvchostif"
endif
ifeq ($(BR2_PACKAGE_LIBFSLVPUWRAP),y)
KODI_DEPENDENCIES += libfslvpuwrap
KODI_CONF_OPTS += --enable-codec=imxvpu
endif
ifeq ($(BR2_PACKAGE_LIBCAP),y)
KODI_CONF_OPTS += --enable-libcap
KODI_DEPENDENCIES += libcap
else
KODI_CONF_OPTS += --disable-libcap
endif
ifeq ($(BR2_PACKAGE_KODI_DBUS),y)
KODI_DEPENDENCIES += dbus
KODI_CONF_OPTS += --enable-dbus
else
KODI_CONF_OPTS += --disable-dbus
endif
ifeq ($(BR2_PACKAGE_KODI_ALSA_LIB),y)
KODI_DEPENDENCIES += alsa-lib
KODI_CONF_OPTS += --enable-alsa
else
KODI_CONF_OPTS += --disable-alsa
endif
# quote from kodi/configure.in: "GLES overwrites GL if both set to yes."
# we choose the opposite because opengl offers more features, like libva support
# GL means X11, and under X11, Kodi needs libdrm; libdrm is forcefully selected
# by a modular Xorg server, which Kodi already depends on.
ifeq ($(BR2_PACKAGE_KODI_GL),y)
KODI_DEPENDENCIES += libglew libglu libgl xlib_libX11 xlib_libXext \
xlib_libXmu xlib_libXrandr xlib_libXt libdrm
KODI_CONF_OPTS += --enable-gl --enable-x11 --disable-gles
ifeq ($(BR2_PACKAGE_KODI_RSXS),y)
# fix rsxs compile
# gcc5: http://trac.kodi.tv/ticket/16006#comment:6
# make sure target libpng-config is used, options taken from rsxs-0.9/acinclude.m4
KODI_CONF_ENV += \
ac_cv_type__Bool=yes \
jm_cv_func_gettimeofday_clobber=no \
mac_cv_pkg_png=$(STAGING_DIR)/usr/bin/libpng-config \
mac_cv_pkg_cppflags="`$(STAGING_DIR)/usr/bin/libpng-config --I_opts --cppflags`" \
mac_cv_pkg_cxxflags="`$(STAGING_DIR)/usr/bin/libpng-config --ccopts`" \
mac_cv_pkg_ldflags="`$(STAGING_DIR)/usr/bin/libpng-config --L_opts --R_opts`" \
mac_cv_pkg_libs="`$(STAGING_DIR)/usr/bin/libpng-config --libs`"
KODI_CONF_OPTS += --enable-rsxs
else
KODI_CONF_OPTS += --disable-rsxs
endif
else
KODI_CONF_OPTS += --disable-gl --disable-rsxs --disable-x11
ifeq ($(BR2_PACKAGE_KODI_EGL_GLES),y)
KODI_DEPENDENCIES += libegl libgles
package/kodi: Fix linking with sunxi-mali Since http://git.buildroot.net/buildroot/commit/package/sunxi-mali?id=8906f272ab41e0373f392cc7a04cc97320dd8382 sunxi-mali as egl/gles provider also depends on libump. This dependency was unknown to Kodi leading to this error during configure: configure:23127: /home/buildroot/build/instance-0/output/host/usr/bin/arm-none-linux-gnueabi-gcc -o conftest -O2 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -g -D_DEBUG -Wall -mno-apcs-stack-check -mfpu=neon -mvectorize-with-neon-quad -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 conftest.c -lEGL -lpython2.7 -lpthread -ldl -lutil -lm >&5 /home/buildroot/build/instance-0/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: libUMP.so.2, needed by /home/buildroot/build/instance-0/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/thumb2/usr/lib/libMali.so, not found (try using -rpath or -rpath-link) /home/buildroot/build/instance-0/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/thumb2/usr/lib/libEGL.so: undefined reference to `ump_close' This patch updates CXXFLAGS with the necessary libs to fix linking of the final kodi binary. The additional CFLAGS are needed because configure uses gcc to detect egl support. Fixes http://autobuild.buildroot.net/results/ce3/ce35d25253410abcbdbf1c58a5c9fb90f4eea6cd/ http://autobuild.buildroot.net/results/1ee/1eefd8e23d8e1b4374c79201b4c631603372d431/ http://autobuild.buildroot.net/results/3d8/3d8314392c61d6d278fb900a028e3bfc4d1d4d2c/ http://autobuild.buildroot.net/results/ee5/ee5e53ed9e2bbebab64122dd422d5da6abca3095/ http://autobuild.buildroot.net/results/703/7033594221b4a75e7f8aea8c145c8b7d2db0637c/ Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de> Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-07-25 16:19:53 +02:00
KODI_CONF_ENV += CXXFLAGS="$(TARGET_CXXFLAGS) `$(PKG_CONFIG_HOST_BINARY) --cflags --libs egl`"
KODI_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) `$(PKG_CONFIG_HOST_BINARY) --cflags --libs egl`"
KODI_CONF_OPTS += --enable-gles
else
KODI_CONF_OPTS += --disable-gles
endif
endif
ifeq ($(BR2_PACKAGE_KODI_GOOM),y)
KODI_CONF_OPTS += --enable-goom
else
KODI_CONF_OPTS += --disable-goom
endif
ifeq ($(BR2_PACKAGE_KODI_LIBUSB),y)
KODI_DEPENDENCIES += libusb-compat
KODI_CONF_OPTS += --enable-libusb
else
KODI_CONF_OPTS += --disable-libusb
endif
ifeq ($(BR2_PACKAGE_KODI_LIBMICROHTTPD),y)
KODI_DEPENDENCIES += libmicrohttpd
KODI_CONF_OPTS += --enable-webserver
else
KODI_CONF_OPTS += --disable-webserver
endif
ifeq ($(BR2_PACKAGE_KODI_LIBSMBCLIENT),y)
KODI_DEPENDENCIES += samba4
KODI_CONF_OPTS += --enable-samba
else
KODI_CONF_OPTS += --disable-samba
endif
ifeq ($(BR2_PACKAGE_KODI_LIBNFS),y)
KODI_DEPENDENCIES += libnfs
KODI_CONF_OPTS += --enable-nfs
else
KODI_CONF_OPTS += --disable-nfs
endif
ifeq ($(BR2_PACKAGE_KODI_RTMPDUMP),y)
KODI_DEPENDENCIES += rtmpdump
KODI_CONF_OPTS += --enable-rtmp
else
KODI_CONF_OPTS += --disable-rtmp
endif
ifeq ($(BR2_PACKAGE_KODI_LIBBLURAY),y)
KODI_DEPENDENCIES += libbluray
KODI_CONF_OPTS += --enable-libbluray
else
KODI_CONF_OPTS += --disable-libbluray
endif
ifeq ($(BR2_PACKAGE_KODI_LIBSHAIRPLAY),y)
KODI_DEPENDENCIES += libshairplay
KODI_CONF_OPTS += --enable-airplay
else
KODI_CONF_OPTS += --disable-airplay
endif
ifeq ($(BR2_PACKAGE_KODI_AVAHI),y)
KODI_DEPENDENCIES += avahi
KODI_CONF_OPTS += --enable-avahi
else
KODI_CONF_OPTS += --disable-avahi
endif
ifeq ($(BR2_PACKAGE_KODI_LIBCEC),y)
KODI_DEPENDENCIES += libcec
KODI_CONF_OPTS += --enable-libcec
else
KODI_CONF_OPTS += --disable-libcec
endif
ifeq ($(BR2_PACKAGE_KODI_LIRC),y)
KODI_CONF_OPTS += --enable-lirc
else
KODI_CONF_OPTS += --disable-lirc
endif
ifeq ($(BR2_PACKAGE_KODI_WAVPACK),y)
KODI_DEPENDENCIES += wavpack
endif
ifeq ($(BR2_PACKAGE_KODI_LIBTHEORA),y)
KODI_DEPENDENCIES += libtheora
endif
# kodi needs libva & libva-glx
ifeq ($(BR2_PACKAGE_KODI_LIBVA)$(BR2_PACKAGE_MESA3D_DRI_DRIVER),yy)
KODI_DEPENDENCIES += mesa3d libva
KODI_CONF_OPTS += --enable-vaapi
else
KODI_CONF_OPTS += --disable-vaapi
endif
ifeq ($(BR2_PACKAGE_KODI_OPTICALDRIVE),y)
KODI_CONF_OPTS += --enable-optical-drive --enable-dvdcss
else
KODI_CONF_OPTS += --disable-optical-drive --disable-dvdcss
endif
# Add HOST_DIR to PATH for codegenerator.mk to find swig
define KODI_BOOTSTRAP
$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D)/tools/depends/native/JsonSchemaBuilder
$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D)/tools/depends/native/TexturePacker
cd $(@D) && PATH=$(BR_PATH) ./bootstrap
endef
KODI_PRE_CONFIGURE_HOOKS += KODI_BOOTSTRAP
define KODI_CLEAN_UNUSED_ADDONS
rm -Rf $(TARGET_DIR)/usr/share/kodi/addons/screensaver.rsxs.plasma
rm -Rf $(TARGET_DIR)/usr/share/kodi/addons/visualization.milkdrop
rm -Rf $(TARGET_DIR)/usr/share/kodi/addons/visualization.projectm
rm -Rf $(TARGET_DIR)/usr/share/kodi/addons/visualization.itunes
endef
KODI_POST_INSTALL_TARGET_HOOKS += KODI_CLEAN_UNUSED_ADDONS
define KODI_CLEAN_CONFLUENCE_SKIN
find $(TARGET_DIR)/usr/share/kodi/addons/skin.confluence/media -name *.png -delete
find $(TARGET_DIR)/usr/share/kodi/addons/skin.confluence/media -name *.jpg -delete
endef
KODI_POST_INSTALL_TARGET_HOOKS += KODI_CLEAN_CONFLUENCE_SKIN
define KODI_INSTALL_BR_WRAPPER
$(INSTALL) -D -m 0755 package/kodi/br-kodi \
$(TARGET_DIR)/usr/bin/br-kodi
endef
KODI_POST_INSTALL_TARGET_HOOKS += KODI_INSTALL_BR_WRAPPER
# When run from a startup script, Kodi has no $HOME where to store its
# configuration, so ends up storing it in /.kodi (yes, at the root of
# the rootfs). This is a problem for read-only filesystems. But we can't
# easily change that, so create /.kodi as a symlink where we want the
# config to eventually be. Add synlinks for the legacy XBMC name as well
define KODI_INSTALL_CONFIG_DIR
$(INSTALL) -d -m 0755 $(TARGET_DIR)/var/kodi
ln -sf /var/kodi $(TARGET_DIR)/.kodi
ln -sf /var/kodi $(TARGET_DIR)/var/xbmc
ln -sf /var/kodi $(TARGET_DIR)/.xbmc
endef
KODI_POST_INSTALL_TARGET_HOOKS += KODI_INSTALL_CONFIG_DIR
define KODI_INSTALL_INIT_SYSV
$(INSTALL) -D -m 755 package/kodi/S50kodi \
$(TARGET_DIR)/etc/init.d/S50kodi
endef
define KODI_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 644 package/kodi/kodi.service \
$(TARGET_DIR)/usr/lib/systemd/system/kodi.service
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
ln -fs ../../../../usr/lib/systemd/system/kodi.service \
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/kodi.service
endef
$(eval $(autotools-package))