1 ################################################################################
5 ################################################################################
7 KODI_VERSION = 14.2-Helix
8 KODI_SITE = $(call github,xbmc,xbmc,$(KODI_VERSION))
10 KODI_LICENSE_FILES = LICENSE.GPL
11 # needed for audioencoder addons
12 KODI_INSTALL_STAGING = YES
13 # Kodi needs host-sdl_image (and therefore host-sdl) for a host tools it builds
14 # called TexturePacker. It is responsible to take all the images used in the
15 # GUI and pack them in a blob.
16 # http://wiki.xbmc.org/index.php?title=TexturePacker
17 KODI_DEPENDENCIES = host-gawk host-gettext host-gperf host-infozip host-lzo \
18 host-nasm host-sdl_image host-swig
19 KODI_DEPENDENCIES += boost bzip2 expat ffmpeg fontconfig freetype jasper jpeg \
20 libass libcdio libcurl libfribidi libgcrypt libmad libmodplug libmpeg2 \
21 libogg libplist libpng libsamplerate libvorbis libxml2 libxslt lzo ncurses \
22 openssl pcre python readline sqlite taglib tiff tinyxml yajl zlib
25 PYTHON_VERSION="$(PYTHON_VERSION_MAJOR)" \
26 PYTHON_LDFLAGS="-lpython$(PYTHON_VERSION_MAJOR) -lpthread -ldl -lutil -lm" \
27 PYTHON_CPPFLAGS="-I$(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR)" \
28 PYTHON_SITE_PKG="$(STAGING_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages" \
29 PYTHON_NOVERSIONCHECK="no-check" \
30 use_texturepacker_native=yes \
31 USE_TEXTUREPACKER_NATIVE_ROOT="$(HOST_DIR)/usr" \
32 TEXTUREPACKER_NATIVE_ROOT="$(HOST_DIR)/usr"
35 --with-ffmpeg=shared \
45 --disable-vtbdecoder \
46 --enable-optimizations
48 ifeq ($(BR2_PACKAGE_MYSQL),y)
49 KODI_CONF_OPTS += --enable-mysql
50 KODI_CONF_ENV += ac_cv_path_MYSQL_CONFIG="$(STAGING_DIR)/usr/bin/mysql_config"
51 KODI_DEPENDENCIES += mysql
53 KODI_CONF_OPTS += --disable-mysql
56 ifeq ($(BR2_PACKAGE_RPI_USERLAND),y)
57 KODI_DEPENDENCIES += rpi-userland
58 KODI_CONF_OPTS += --with-platform=raspberry-pi --enable-player=omxplayer
59 KODI_CONF_ENV += INCLUDES="-I$(STAGING_DIR)/usr/include/interface/vcos/pthreads \
60 -I$(STAGING_DIR)/usr/include/interface/vmcs_host/linux" \
61 LIBS="-lvcos -lvchostif"
64 ifeq ($(BR2_PACKAGE_LIBFSLVPUWRAP),y)
65 KODI_DEPENDENCIES += libfslvpuwrap
66 KODI_CONF_OPTS += --enable-codec=imxvpu
69 ifeq ($(BR2_PACKAGE_LIBCAP),y)
70 KODI_CONF_OPTS += --enable-libcap
71 KODI_DEPENDENCIES += libcap
73 KODI_CONF_OPTS += --disable-libcap
76 ifeq ($(BR2_PACKAGE_KODI_DBUS),y)
77 KODI_DEPENDENCIES += dbus
78 KODI_CONF_OPTS += --enable-dbus
80 KODI_CONF_OPTS += --disable-dbus
83 ifeq ($(BR2_PACKAGE_KODI_ALSA_LIB),y)
84 KODI_DEPENDENCIES += alsa-lib
85 KODI_CONF_OPTS += --enable-alsa
87 KODI_CONF_OPTS += --disable-alsa
90 # quote from kodi/configure.in: "GLES overwrites GL if both set to yes."
91 # we choose the opposite because opengl offers more features, like libva support
92 # GL means X11, and under X11, Kodi needs libdrm; libdrm is forcefully selected
93 # by a modular Xorg server, which Kodi already depends on.
94 ifeq ($(BR2_PACKAGE_KODI_GL),y)
95 KODI_DEPENDENCIES += libglew libglu libgl sdl_image xlib_libX11 xlib_libXext \
96 xlib_libXmu xlib_libXrandr xlib_libXt libdrm
97 KODI_CONF_OPTS += --enable-gl --enable-sdl --enable-x11 --enable-xrandr --disable-gles
98 ifeq ($(BR2_PACKAGE_KODI_RSXS),y)
100 # make sure target libpng-config is used, options taken from rsxs-0.9/acinclude.m4
102 jm_cv_func_gettimeofday_clobber=no \
103 mac_cv_pkg_png=$(STAGING_DIR)/usr/bin/libpng-config \
104 mac_cv_pkg_cppflags="`$(STAGING_DIR)/usr/bin/libpng-config --I_opts --cppflags`" \
105 mac_cv_pkg_cxxflags="`$(STAGING_DIR)/usr/bin/libpng-config --ccopts`" \
106 mac_cv_pkg_ldflags="`$(STAGING_DIR)/usr/bin/libpng-config --L_opts --R_opts`" \
107 mac_cv_pkg_libs="`$(STAGING_DIR)/usr/bin/libpng-config --libs`"
108 KODI_CONF_OPTS += --enable-rsxs
110 KODI_CONF_OPTS += --disable-rsxs
113 KODI_CONF_OPTS += --disable-gl --disable-rsxs --disable-sdl --disable-x11 --disable-xrandr
114 ifeq ($(BR2_PACKAGE_KODI_EGL_GLES),y)
115 KODI_DEPENDENCIES += libegl libgles
116 KODI_CONF_OPTS += --enable-gles
118 KODI_CONF_OPTS += --disable-gles
122 ifeq ($(BR2_PACKAGE_KODI_GOOM),y)
123 KODI_CONF_OPTS += --enable-goom
125 KODI_CONF_OPTS += --disable-goom
128 ifeq ($(BR2_PACKAGE_KODI_LIBUSB),y)
129 KODI_DEPENDENCIES += libusb-compat
130 KODI_CONF_OPTS += --enable-libusb
132 KODI_CONF_OPTS += --disable-libusb
135 ifeq ($(BR2_PACKAGE_KODI_LIBMICROHTTPD),y)
136 KODI_DEPENDENCIES += libmicrohttpd
137 KODI_CONF_OPTS += --enable-webserver
139 KODI_CONF_OPTS += --disable-webserver
142 ifeq ($(BR2_PACKAGE_KODI_LIBSMBCLIENT),y)
143 KODI_DEPENDENCIES += samba4
144 KODI_CONF_OPTS += --enable-samba
146 KODI_CONF_OPTS += --disable-samba
149 ifeq ($(BR2_PACKAGE_KODI_LIBNFS),y)
150 KODI_DEPENDENCIES += libnfs
151 KODI_CONF_OPTS += --enable-nfs
153 KODI_CONF_OPTS += --disable-nfs
156 ifeq ($(BR2_PACKAGE_KODI_RTMPDUMP),y)
157 KODI_DEPENDENCIES += rtmpdump
158 KODI_CONF_OPTS += --enable-rtmp
160 KODI_CONF_OPTS += --disable-rtmp
163 ifeq ($(BR2_PACKAGE_KODI_LIBBLURAY),y)
164 KODI_DEPENDENCIES += libbluray
165 KODI_CONF_OPTS += --enable-libbluray
167 KODI_CONF_OPTS += --disable-libbluray
170 ifeq ($(BR2_PACKAGE_KODI_LIBSHAIRPLAY),y)
171 KODI_DEPENDENCIES += libshairplay
172 KODI_CONF_OPTS += --enable-airplay
174 KODI_CONF_OPTS += --disable-airplay
177 ifeq ($(BR2_PACKAGE_KODI_AVAHI),y)
178 KODI_DEPENDENCIES += avahi
179 KODI_CONF_OPTS += --enable-avahi
181 KODI_CONF_OPTS += --disable-avahi
184 ifeq ($(BR2_PACKAGE_KODI_LIBCEC),y)
185 KODI_DEPENDENCIES += libcec
186 KODI_CONF_OPTS += --enable-libcec
188 KODI_CONF_OPTS += --disable-libcec
191 ifeq ($(BR2_PACKAGE_KODI_WAVPACK),y)
192 KODI_DEPENDENCIES += wavpack
195 ifeq ($(BR2_PACKAGE_KODI_LIBTHEORA),y)
196 KODI_DEPENDENCIES += libtheora
199 # kodi needs libva & libva-glx
200 ifeq ($(BR2_PACKAGE_KODI_LIBVA)$(BR2_PACKAGE_MESA3D_DRI_DRIVER),yy)
201 KODI_DEPENDENCIES += mesa3d libva
202 KODI_CONF_OPTS += --enable-vaapi
204 KODI_CONF_OPTS += --disable-vaapi
207 ifeq ($(BR2_PACKAGE_KODI_OPTICALDRIVE),y)
208 KODI_CONF_OPTS += --enable-optical-drive --enable-dvdcss
210 KODI_CONF_OPTS += --disable-optical-drive --disable-dvdcss
213 # Add HOST_DIR to PATH for codegenerator.mk to find swig
214 define KODI_BOOTSTRAP
215 cd $(@D) && PATH=$(BR_PATH) ./bootstrap
217 KODI_PRE_CONFIGURE_HOOKS += KODI_BOOTSTRAP
219 define KODI_CLEAN_UNUSED_ADDONS
220 rm -Rf $(TARGET_DIR)/usr/share/kodi/addons/screensaver.rsxs.plasma
221 rm -Rf $(TARGET_DIR)/usr/share/kodi/addons/visualization.milkdrop
222 rm -Rf $(TARGET_DIR)/usr/share/kodi/addons/visualization.projectm
223 rm -Rf $(TARGET_DIR)/usr/share/kodi/addons/visualization.itunes
225 KODI_POST_INSTALL_TARGET_HOOKS += KODI_CLEAN_UNUSED_ADDONS
227 define KODI_CLEAN_CONFLUENCE_SKIN
228 find $(TARGET_DIR)/usr/share/kodi/addons/skin.confluence/media -name *.png -delete
229 find $(TARGET_DIR)/usr/share/kodi/addons/skin.confluence/media -name *.jpg -delete
231 KODI_POST_INSTALL_TARGET_HOOKS += KODI_CLEAN_CONFLUENCE_SKIN
233 define KODI_INSTALL_BR_WRAPPER
234 $(INSTALL) -D -m 0755 package/kodi/br-kodi \
235 $(TARGET_DIR)/usr/bin/br-kodi
237 KODI_POST_INSTALL_TARGET_HOOKS += KODI_INSTALL_BR_WRAPPER
239 # When run from a startup script, Kodi has no $HOME where to store its
240 # configuration, so ends up storing it in /.kodi (yes, at the root of
241 # the rootfs). This is a problem for read-only filesystems. But we can't
242 # easily change that, so create /.kodi as a symlink where we want the
243 # config to eventually be. Add synlinks for the legacy XBMC name as well
244 define KODI_INSTALL_CONFIG_DIR
245 $(INSTALL) -d -m 0755 $(TARGET_DIR)/var/kodi
246 ln -sf /var/kodi $(TARGET_DIR)/.kodi
247 ln -sf /var/kodi $(TARGET_DIR)/var/xbmc
248 ln -sf /var/kodi $(TARGET_DIR)/.xbmc
250 KODI_POST_INSTALL_TARGET_HOOKS += KODI_INSTALL_CONFIG_DIR
252 define KODI_INSTALL_INIT_SYSV
253 $(INSTALL) -D -m 755 package/kodi/S50kodi \
254 $(TARGET_DIR)/etc/init.d/S50kodi
257 define KODI_INSTALL_INIT_SYSTEMD
258 $(INSTALL) -D -m 644 package/kodi/kodi.service \
259 $(TARGET_DIR)/usr/lib/systemd/system/kodi.service
261 mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
263 ln -fs ../../../../usr/lib/systemd/system/kodi.service \
264 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/kodi.service
267 $(eval $(autotools-package))