blob: 94e59e7a954cbb9937ea88547a943d2f7f0a74ed [file] [log] [blame]
Bernd Kuhls35784592014-12-23 18:46:27 +01001################################################################################
2#
3# kodi
4#
5################################################################################
6
Bernd Kuhlsf1c94ed2015-10-20 21:42:25 +02007KODI_VERSION = 15.2-Isengard
Bernd Kuhls35784592014-12-23 18:46:27 +01008KODI_SITE = $(call github,xbmc,xbmc,$(KODI_VERSION))
9KODI_LICENSE = GPLv2
10KODI_LICENSE_FILES = LICENSE.GPL
Bernd Kuhlscd181142015-07-22 22:30:26 +020011# needed for binary addons
Bernd Kuhls0a05f582014-12-23 18:46:37 +010012KODI_INSTALL_STAGING = YES
Yann E. MORINcc392062015-12-06 10:28:53 +010013KODI_DEPENDENCIES = host-gawk host-gettext host-gperf host-zip host-giflib \
Bernd Kuhlscd181142015-07-22 22:30:26 +020014 host-libjpeg host-lzo host-nasm host-libpng host-swig
Bernd Kuhls8d62a492014-12-23 18:46:29 +010015KODI_DEPENDENCIES += boost bzip2 expat ffmpeg fontconfig freetype jasper jpeg \
Bernd Kuhlscd181142015-07-22 22:30:26 +020016 libass libcdio libcurl libfribidi libgcrypt libmpeg2 \
17 libogg libplist libpng libsamplerate libsquish libvorbis libxml2 \
18 libxslt lzo ncurses openssl pcre python readline sqlite taglib tiff \
19 tinyxml yajl zlib
Bernd Kuhls35784592014-12-23 18:46:27 +010020
Bernd Kuhls35784592014-12-23 18:46:27 +010021KODI_CONF_ENV = \
22 PYTHON_VERSION="$(PYTHON_VERSION_MAJOR)" \
23 PYTHON_LDFLAGS="-lpython$(PYTHON_VERSION_MAJOR) -lpthread -ldl -lutil -lm" \
24 PYTHON_CPPFLAGS="-I$(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR)" \
25 PYTHON_SITE_PKG="$(STAGING_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages" \
26 PYTHON_NOVERSIONCHECK="no-check" \
27 use_texturepacker_native=yes \
28 USE_TEXTUREPACKER_NATIVE_ROOT="$(HOST_DIR)/usr" \
29 TEXTUREPACKER_NATIVE_ROOT="$(HOST_DIR)/usr"
30
31KODI_CONF_OPTS += \
Bernd Kuhls8d62a492014-12-23 18:46:29 +010032 --with-ffmpeg=shared \
Bernd Kuhls56b80ec2016-02-20 23:09:06 +010033 --disable-goom \
Bernd Kuhls35784592014-12-23 18:46:27 +010034 --disable-joystick \
Bernd Kuhls35784592014-12-23 18:46:27 +010035 --disable-openmax \
Bernd Kuhls35784592014-12-23 18:46:27 +010036 --disable-projectm \
37 --disable-pulse \
Bernd Kuhls35784592014-12-23 18:46:27 +010038 --disable-vdpau \
39 --disable-vtbdecoder \
40 --enable-optimizations
41
Ryan Coee89fba02015-03-03 19:32:05 -080042ifeq ($(BR2_PACKAGE_MYSQL),y)
43KODI_CONF_OPTS += --enable-mysql
44KODI_CONF_ENV += ac_cv_path_MYSQL_CONFIG="$(STAGING_DIR)/usr/bin/mysql_config"
45KODI_DEPENDENCIES += mysql
46else
47KODI_CONF_OPTS += --disable-mysql
48endif
49
Bernd Kuhls35784592014-12-23 18:46:27 +010050ifeq ($(BR2_PACKAGE_RPI_USERLAND),y)
51KODI_DEPENDENCIES += rpi-userland
52KODI_CONF_OPTS += --with-platform=raspberry-pi --enable-player=omxplayer
53KODI_CONF_ENV += INCLUDES="-I$(STAGING_DIR)/usr/include/interface/vcos/pthreads \
54 -I$(STAGING_DIR)/usr/include/interface/vmcs_host/linux" \
55 LIBS="-lvcos -lvchostif"
56endif
57
Julien Boibessot52873582015-03-04 19:37:22 +010058ifeq ($(BR2_PACKAGE_LIBFSLVPUWRAP),y)
59KODI_DEPENDENCIES += libfslvpuwrap
60KODI_CONF_OPTS += --enable-codec=imxvpu
61endif
62
Bernd Kuhls35784592014-12-23 18:46:27 +010063ifeq ($(BR2_PACKAGE_LIBCAP),y)
64KODI_CONF_OPTS += --enable-libcap
65KODI_DEPENDENCIES += libcap
66else
67KODI_CONF_OPTS += --disable-libcap
68endif
69
70ifeq ($(BR2_PACKAGE_KODI_DBUS),y)
71KODI_DEPENDENCIES += dbus
72KODI_CONF_OPTS += --enable-dbus
73else
74KODI_CONF_OPTS += --disable-dbus
75endif
76
77ifeq ($(BR2_PACKAGE_KODI_ALSA_LIB),y)
78KODI_DEPENDENCIES += alsa-lib
79KODI_CONF_OPTS += --enable-alsa
80else
81KODI_CONF_OPTS += --disable-alsa
82endif
83
Bernd Kuhls35784592014-12-23 18:46:27 +010084# quote from kodi/configure.in: "GLES overwrites GL if both set to yes."
85# we choose the opposite because opengl offers more features, like libva support
Yann E. MORIN43fbfc32015-01-19 00:13:30 +010086# GL means X11, and under X11, Kodi needs libdrm; libdrm is forcefully selected
87# by a modular Xorg server, which Kodi already depends on.
Bernd Kuhls35784592014-12-23 18:46:27 +010088ifeq ($(BR2_PACKAGE_KODI_GL),y)
Bernd Kuhlscd181142015-07-22 22:30:26 +020089KODI_DEPENDENCIES += libglew libglu libgl xlib_libX11 xlib_libXext \
Yann E. MORIN43fbfc32015-01-19 00:13:30 +010090 xlib_libXmu xlib_libXrandr xlib_libXt libdrm
Bernd Kuhlscd181142015-07-22 22:30:26 +020091KODI_CONF_OPTS += --enable-gl --enable-x11 --disable-gles
Bernd Kuhls35784592014-12-23 18:46:27 +010092ifeq ($(BR2_PACKAGE_KODI_RSXS),y)
93# fix rsxs compile
Bernd Kuhlscd181142015-07-22 22:30:26 +020094# gcc5: http://trac.kodi.tv/ticket/16006#comment:6
Bernd Kuhls35784592014-12-23 18:46:27 +010095# make sure target libpng-config is used, options taken from rsxs-0.9/acinclude.m4
96KODI_CONF_ENV += \
Bernd Kuhlscd181142015-07-22 22:30:26 +020097 ac_cv_type__Bool=yes \
Bernd Kuhls35784592014-12-23 18:46:27 +010098 jm_cv_func_gettimeofday_clobber=no \
99 mac_cv_pkg_png=$(STAGING_DIR)/usr/bin/libpng-config \
100 mac_cv_pkg_cppflags="`$(STAGING_DIR)/usr/bin/libpng-config --I_opts --cppflags`" \
101 mac_cv_pkg_cxxflags="`$(STAGING_DIR)/usr/bin/libpng-config --ccopts`" \
102 mac_cv_pkg_ldflags="`$(STAGING_DIR)/usr/bin/libpng-config --L_opts --R_opts`" \
103 mac_cv_pkg_libs="`$(STAGING_DIR)/usr/bin/libpng-config --libs`"
104KODI_CONF_OPTS += --enable-rsxs
105else
106KODI_CONF_OPTS += --disable-rsxs
107endif
108else
Bernd Kuhlscd181142015-07-22 22:30:26 +0200109KODI_CONF_OPTS += --disable-gl --disable-rsxs --disable-x11
Bernd Kuhls35784592014-12-23 18:46:27 +0100110ifeq ($(BR2_PACKAGE_KODI_EGL_GLES),y)
111KODI_DEPENDENCIES += libegl libgles
Bernd Kuhls23c39192015-07-25 16:19:53 +0200112KODI_CONF_ENV += CXXFLAGS="$(TARGET_CXXFLAGS) `$(PKG_CONFIG_HOST_BINARY) --cflags --libs egl`"
113KODI_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) `$(PKG_CONFIG_HOST_BINARY) --cflags --libs egl`"
Bernd Kuhls35784592014-12-23 18:46:27 +0100114KODI_CONF_OPTS += --enable-gles
115else
116KODI_CONF_OPTS += --disable-gles
117endif
118endif
119
Bernd Kuhls35784592014-12-23 18:46:27 +0100120ifeq ($(BR2_PACKAGE_KODI_LIBUSB),y)
121KODI_DEPENDENCIES += libusb-compat
122KODI_CONF_OPTS += --enable-libusb
123else
124KODI_CONF_OPTS += --disable-libusb
125endif
126
127ifeq ($(BR2_PACKAGE_KODI_LIBMICROHTTPD),y)
128KODI_DEPENDENCIES += libmicrohttpd
129KODI_CONF_OPTS += --enable-webserver
130else
131KODI_CONF_OPTS += --disable-webserver
132endif
133
134ifeq ($(BR2_PACKAGE_KODI_LIBSMBCLIENT),y)
Gustavo Zacariasdc6b46d2015-03-06 09:50:31 -0300135KODI_DEPENDENCIES += samba4
Bernd Kuhls35784592014-12-23 18:46:27 +0100136KODI_CONF_OPTS += --enable-samba
137else
138KODI_CONF_OPTS += --disable-samba
139endif
140
141ifeq ($(BR2_PACKAGE_KODI_LIBNFS),y)
142KODI_DEPENDENCIES += libnfs
143KODI_CONF_OPTS += --enable-nfs
144else
145KODI_CONF_OPTS += --disable-nfs
146endif
147
148ifeq ($(BR2_PACKAGE_KODI_RTMPDUMP),y)
149KODI_DEPENDENCIES += rtmpdump
150KODI_CONF_OPTS += --enable-rtmp
151else
152KODI_CONF_OPTS += --disable-rtmp
153endif
154
155ifeq ($(BR2_PACKAGE_KODI_LIBBLURAY),y)
156KODI_DEPENDENCIES += libbluray
157KODI_CONF_OPTS += --enable-libbluray
158else
159KODI_CONF_OPTS += --disable-libbluray
160endif
161
162ifeq ($(BR2_PACKAGE_KODI_LIBSHAIRPLAY),y)
163KODI_DEPENDENCIES += libshairplay
164KODI_CONF_OPTS += --enable-airplay
165else
166KODI_CONF_OPTS += --disable-airplay
167endif
168
Bernd Kuhls62ce7752015-10-20 21:42:26 +0200169ifeq ($(BR2_PACKAGE_KODI_LIBSSH),y)
170KODI_DEPENDENCIES += libssh
171KODI_CONF_OPTS += --enable-ssh
172else
173KODI_CONF_OPTS += --disable-ssh
174endif
175
Bernd Kuhls35784592014-12-23 18:46:27 +0100176ifeq ($(BR2_PACKAGE_KODI_AVAHI),y)
177KODI_DEPENDENCIES += avahi
178KODI_CONF_OPTS += --enable-avahi
179else
180KODI_CONF_OPTS += --disable-avahi
181endif
182
183ifeq ($(BR2_PACKAGE_KODI_LIBCEC),y)
184KODI_DEPENDENCIES += libcec
185KODI_CONF_OPTS += --enable-libcec
186else
187KODI_CONF_OPTS += --disable-libcec
188endif
189
Bernd Kuhls0818a652015-07-22 22:30:27 +0200190ifeq ($(BR2_PACKAGE_KODI_LIRC),y)
191KODI_CONF_OPTS += --enable-lirc
192else
193KODI_CONF_OPTS += --disable-lirc
194endif
195
Bernd Kuhls35784592014-12-23 18:46:27 +0100196ifeq ($(BR2_PACKAGE_KODI_WAVPACK),y)
197KODI_DEPENDENCIES += wavpack
198endif
199
200ifeq ($(BR2_PACKAGE_KODI_LIBTHEORA),y)
201KODI_DEPENDENCIES += libtheora
202endif
203
204# kodi needs libva & libva-glx
205ifeq ($(BR2_PACKAGE_KODI_LIBVA)$(BR2_PACKAGE_MESA3D_DRI_DRIVER),yy)
206KODI_DEPENDENCIES += mesa3d libva
207KODI_CONF_OPTS += --enable-vaapi
208else
209KODI_CONF_OPTS += --disable-vaapi
210endif
211
Bernd Kuhls25dc51c2014-12-23 18:46:36 +0100212ifeq ($(BR2_PACKAGE_KODI_OPTICALDRIVE),y)
213KODI_CONF_OPTS += --enable-optical-drive --enable-dvdcss
214else
215KODI_CONF_OPTS += --disable-optical-drive --disable-dvdcss
216endif
217
Bernd Kuhls35784592014-12-23 18:46:27 +0100218# Add HOST_DIR to PATH for codegenerator.mk to find swig
219define KODI_BOOTSTRAP
Bernd Kuhlscd181142015-07-22 22:30:26 +0200220 $(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D)/tools/depends/native/JsonSchemaBuilder
221 $(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D)/tools/depends/native/TexturePacker
Bernd Kuhls35784592014-12-23 18:46:27 +0100222 cd $(@D) && PATH=$(BR_PATH) ./bootstrap
223endef
224KODI_PRE_CONFIGURE_HOOKS += KODI_BOOTSTRAP
225
226define KODI_CLEAN_UNUSED_ADDONS
Yann E. MORIN21b5d852014-12-28 16:05:42 +0100227 rm -Rf $(TARGET_DIR)/usr/share/kodi/addons/screensaver.rsxs.plasma
228 rm -Rf $(TARGET_DIR)/usr/share/kodi/addons/visualization.milkdrop
229 rm -Rf $(TARGET_DIR)/usr/share/kodi/addons/visualization.projectm
230 rm -Rf $(TARGET_DIR)/usr/share/kodi/addons/visualization.itunes
Bernd Kuhls35784592014-12-23 18:46:27 +0100231endef
232KODI_POST_INSTALL_TARGET_HOOKS += KODI_CLEAN_UNUSED_ADDONS
233
234define KODI_CLEAN_CONFLUENCE_SKIN
Yann E. MORIN21b5d852014-12-28 16:05:42 +0100235 find $(TARGET_DIR)/usr/share/kodi/addons/skin.confluence/media -name *.png -delete
236 find $(TARGET_DIR)/usr/share/kodi/addons/skin.confluence/media -name *.jpg -delete
Bernd Kuhls35784592014-12-23 18:46:27 +0100237endef
238KODI_POST_INSTALL_TARGET_HOOKS += KODI_CLEAN_CONFLUENCE_SKIN
239
240define KODI_INSTALL_BR_WRAPPER
241 $(INSTALL) -D -m 0755 package/kodi/br-kodi \
242 $(TARGET_DIR)/usr/bin/br-kodi
243endef
244KODI_POST_INSTALL_TARGET_HOOKS += KODI_INSTALL_BR_WRAPPER
245
246# When run from a startup script, Kodi has no $HOME where to store its
Yann E. MORIN21b5d852014-12-28 16:05:42 +0100247# configuration, so ends up storing it in /.kodi (yes, at the root of
Bernd Kuhls35784592014-12-23 18:46:27 +0100248# the rootfs). This is a problem for read-only filesystems. But we can't
Yann E. MORIN21b5d852014-12-28 16:05:42 +0100249# easily change that, so create /.kodi as a symlink where we want the
250# config to eventually be. Add synlinks for the legacy XBMC name as well
Bernd Kuhls35784592014-12-23 18:46:27 +0100251define KODI_INSTALL_CONFIG_DIR
252 $(INSTALL) -d -m 0755 $(TARGET_DIR)/var/kodi
Yann E. MORIN21b5d852014-12-28 16:05:42 +0100253 ln -sf /var/kodi $(TARGET_DIR)/.kodi
254 ln -sf /var/kodi $(TARGET_DIR)/var/xbmc
Bernd Kuhls35784592014-12-23 18:46:27 +0100255 ln -sf /var/kodi $(TARGET_DIR)/.xbmc
256endef
257KODI_POST_INSTALL_TARGET_HOOKS += KODI_INSTALL_CONFIG_DIR
258
259define KODI_INSTALL_INIT_SYSV
260 $(INSTALL) -D -m 755 package/kodi/S50kodi \
261 $(TARGET_DIR)/etc/init.d/S50kodi
262endef
263
264define KODI_INSTALL_INIT_SYSTEMD
265 $(INSTALL) -D -m 644 package/kodi/kodi.service \
Mike Williamsaf178112015-03-20 15:14:05 -0400266 $(TARGET_DIR)/usr/lib/systemd/system/kodi.service
Bernd Kuhls35784592014-12-23 18:46:27 +0100267
268 mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
269
Mike Williamsaf178112015-03-20 15:14:05 -0400270 ln -fs ../../../../usr/lib/systemd/system/kodi.service \
Bernd Kuhls35784592014-12-23 18:46:27 +0100271 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/kodi.service
272endef
273
274$(eval $(autotools-package))