Bernd Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 1 | ################################################################################ |
| 2 | # |
| 3 | # kodi |
| 4 | # |
| 5 | ################################################################################ |
| 6 | |
Bernd Kuhls | f1c94ed | 2015-10-20 21:42:25 +0200 | [diff] [blame] | 7 | KODI_VERSION = 15.2-Isengard |
Bernd Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 8 | KODI_SITE = $(call github,xbmc,xbmc,$(KODI_VERSION)) |
| 9 | KODI_LICENSE = GPLv2 |
| 10 | KODI_LICENSE_FILES = LICENSE.GPL |
Bernd Kuhls | cd18114 | 2015-07-22 22:30:26 +0200 | [diff] [blame] | 11 | # needed for binary addons |
Bernd Kuhls | 0a05f58 | 2014-12-23 18:46:37 +0100 | [diff] [blame] | 12 | KODI_INSTALL_STAGING = YES |
Yann E. MORIN | cc39206 | 2015-12-06 10:28:53 +0100 | [diff] [blame] | 13 | KODI_DEPENDENCIES = host-gawk host-gettext host-gperf host-zip host-giflib \ |
Bernd Kuhls | cd18114 | 2015-07-22 22:30:26 +0200 | [diff] [blame] | 14 | host-libjpeg host-lzo host-nasm host-libpng host-swig |
Bernd Kuhls | 8d62a49 | 2014-12-23 18:46:29 +0100 | [diff] [blame] | 15 | KODI_DEPENDENCIES += boost bzip2 expat ffmpeg fontconfig freetype jasper jpeg \ |
Bernd Kuhls | cd18114 | 2015-07-22 22:30:26 +0200 | [diff] [blame] | 16 | 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 Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 20 | |
Bernd Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 21 | KODI_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 | |
| 31 | KODI_CONF_OPTS += \ |
Bernd Kuhls | 8d62a49 | 2014-12-23 18:46:29 +0100 | [diff] [blame] | 32 | --with-ffmpeg=shared \ |
Bernd Kuhls | 56b80ec | 2016-02-20 23:09:06 +0100 | [diff] [blame^] | 33 | --disable-goom \ |
Bernd Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 34 | --disable-joystick \ |
Bernd Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 35 | --disable-openmax \ |
Bernd Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 36 | --disable-projectm \ |
| 37 | --disable-pulse \ |
Bernd Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 38 | --disable-vdpau \ |
| 39 | --disable-vtbdecoder \ |
| 40 | --enable-optimizations |
| 41 | |
Ryan Coe | e89fba0 | 2015-03-03 19:32:05 -0800 | [diff] [blame] | 42 | ifeq ($(BR2_PACKAGE_MYSQL),y) |
| 43 | KODI_CONF_OPTS += --enable-mysql |
| 44 | KODI_CONF_ENV += ac_cv_path_MYSQL_CONFIG="$(STAGING_DIR)/usr/bin/mysql_config" |
| 45 | KODI_DEPENDENCIES += mysql |
| 46 | else |
| 47 | KODI_CONF_OPTS += --disable-mysql |
| 48 | endif |
| 49 | |
Bernd Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 50 | ifeq ($(BR2_PACKAGE_RPI_USERLAND),y) |
| 51 | KODI_DEPENDENCIES += rpi-userland |
| 52 | KODI_CONF_OPTS += --with-platform=raspberry-pi --enable-player=omxplayer |
| 53 | KODI_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" |
| 56 | endif |
| 57 | |
Julien Boibessot | 5287358 | 2015-03-04 19:37:22 +0100 | [diff] [blame] | 58 | ifeq ($(BR2_PACKAGE_LIBFSLVPUWRAP),y) |
| 59 | KODI_DEPENDENCIES += libfslvpuwrap |
| 60 | KODI_CONF_OPTS += --enable-codec=imxvpu |
| 61 | endif |
| 62 | |
Bernd Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 63 | ifeq ($(BR2_PACKAGE_LIBCAP),y) |
| 64 | KODI_CONF_OPTS += --enable-libcap |
| 65 | KODI_DEPENDENCIES += libcap |
| 66 | else |
| 67 | KODI_CONF_OPTS += --disable-libcap |
| 68 | endif |
| 69 | |
| 70 | ifeq ($(BR2_PACKAGE_KODI_DBUS),y) |
| 71 | KODI_DEPENDENCIES += dbus |
| 72 | KODI_CONF_OPTS += --enable-dbus |
| 73 | else |
| 74 | KODI_CONF_OPTS += --disable-dbus |
| 75 | endif |
| 76 | |
| 77 | ifeq ($(BR2_PACKAGE_KODI_ALSA_LIB),y) |
| 78 | KODI_DEPENDENCIES += alsa-lib |
| 79 | KODI_CONF_OPTS += --enable-alsa |
| 80 | else |
| 81 | KODI_CONF_OPTS += --disable-alsa |
| 82 | endif |
| 83 | |
Bernd Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 84 | # 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. MORIN | 43fbfc3 | 2015-01-19 00:13:30 +0100 | [diff] [blame] | 86 | # 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 Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 88 | ifeq ($(BR2_PACKAGE_KODI_GL),y) |
Bernd Kuhls | cd18114 | 2015-07-22 22:30:26 +0200 | [diff] [blame] | 89 | KODI_DEPENDENCIES += libglew libglu libgl xlib_libX11 xlib_libXext \ |
Yann E. MORIN | 43fbfc3 | 2015-01-19 00:13:30 +0100 | [diff] [blame] | 90 | xlib_libXmu xlib_libXrandr xlib_libXt libdrm |
Bernd Kuhls | cd18114 | 2015-07-22 22:30:26 +0200 | [diff] [blame] | 91 | KODI_CONF_OPTS += --enable-gl --enable-x11 --disable-gles |
Bernd Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 92 | ifeq ($(BR2_PACKAGE_KODI_RSXS),y) |
| 93 | # fix rsxs compile |
Bernd Kuhls | cd18114 | 2015-07-22 22:30:26 +0200 | [diff] [blame] | 94 | # gcc5: http://trac.kodi.tv/ticket/16006#comment:6 |
Bernd Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 95 | # make sure target libpng-config is used, options taken from rsxs-0.9/acinclude.m4 |
| 96 | KODI_CONF_ENV += \ |
Bernd Kuhls | cd18114 | 2015-07-22 22:30:26 +0200 | [diff] [blame] | 97 | ac_cv_type__Bool=yes \ |
Bernd Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 98 | 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`" |
| 104 | KODI_CONF_OPTS += --enable-rsxs |
| 105 | else |
| 106 | KODI_CONF_OPTS += --disable-rsxs |
| 107 | endif |
| 108 | else |
Bernd Kuhls | cd18114 | 2015-07-22 22:30:26 +0200 | [diff] [blame] | 109 | KODI_CONF_OPTS += --disable-gl --disable-rsxs --disable-x11 |
Bernd Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 110 | ifeq ($(BR2_PACKAGE_KODI_EGL_GLES),y) |
| 111 | KODI_DEPENDENCIES += libegl libgles |
Bernd Kuhls | 23c3919 | 2015-07-25 16:19:53 +0200 | [diff] [blame] | 112 | KODI_CONF_ENV += CXXFLAGS="$(TARGET_CXXFLAGS) `$(PKG_CONFIG_HOST_BINARY) --cflags --libs egl`" |
| 113 | KODI_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) `$(PKG_CONFIG_HOST_BINARY) --cflags --libs egl`" |
Bernd Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 114 | KODI_CONF_OPTS += --enable-gles |
| 115 | else |
| 116 | KODI_CONF_OPTS += --disable-gles |
| 117 | endif |
| 118 | endif |
| 119 | |
Bernd Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 120 | ifeq ($(BR2_PACKAGE_KODI_LIBUSB),y) |
| 121 | KODI_DEPENDENCIES += libusb-compat |
| 122 | KODI_CONF_OPTS += --enable-libusb |
| 123 | else |
| 124 | KODI_CONF_OPTS += --disable-libusb |
| 125 | endif |
| 126 | |
| 127 | ifeq ($(BR2_PACKAGE_KODI_LIBMICROHTTPD),y) |
| 128 | KODI_DEPENDENCIES += libmicrohttpd |
| 129 | KODI_CONF_OPTS += --enable-webserver |
| 130 | else |
| 131 | KODI_CONF_OPTS += --disable-webserver |
| 132 | endif |
| 133 | |
| 134 | ifeq ($(BR2_PACKAGE_KODI_LIBSMBCLIENT),y) |
Gustavo Zacarias | dc6b46d | 2015-03-06 09:50:31 -0300 | [diff] [blame] | 135 | KODI_DEPENDENCIES += samba4 |
Bernd Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 136 | KODI_CONF_OPTS += --enable-samba |
| 137 | else |
| 138 | KODI_CONF_OPTS += --disable-samba |
| 139 | endif |
| 140 | |
| 141 | ifeq ($(BR2_PACKAGE_KODI_LIBNFS),y) |
| 142 | KODI_DEPENDENCIES += libnfs |
| 143 | KODI_CONF_OPTS += --enable-nfs |
| 144 | else |
| 145 | KODI_CONF_OPTS += --disable-nfs |
| 146 | endif |
| 147 | |
| 148 | ifeq ($(BR2_PACKAGE_KODI_RTMPDUMP),y) |
| 149 | KODI_DEPENDENCIES += rtmpdump |
| 150 | KODI_CONF_OPTS += --enable-rtmp |
| 151 | else |
| 152 | KODI_CONF_OPTS += --disable-rtmp |
| 153 | endif |
| 154 | |
| 155 | ifeq ($(BR2_PACKAGE_KODI_LIBBLURAY),y) |
| 156 | KODI_DEPENDENCIES += libbluray |
| 157 | KODI_CONF_OPTS += --enable-libbluray |
| 158 | else |
| 159 | KODI_CONF_OPTS += --disable-libbluray |
| 160 | endif |
| 161 | |
| 162 | ifeq ($(BR2_PACKAGE_KODI_LIBSHAIRPLAY),y) |
| 163 | KODI_DEPENDENCIES += libshairplay |
| 164 | KODI_CONF_OPTS += --enable-airplay |
| 165 | else |
| 166 | KODI_CONF_OPTS += --disable-airplay |
| 167 | endif |
| 168 | |
Bernd Kuhls | 62ce775 | 2015-10-20 21:42:26 +0200 | [diff] [blame] | 169 | ifeq ($(BR2_PACKAGE_KODI_LIBSSH),y) |
| 170 | KODI_DEPENDENCIES += libssh |
| 171 | KODI_CONF_OPTS += --enable-ssh |
| 172 | else |
| 173 | KODI_CONF_OPTS += --disable-ssh |
| 174 | endif |
| 175 | |
Bernd Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 176 | ifeq ($(BR2_PACKAGE_KODI_AVAHI),y) |
| 177 | KODI_DEPENDENCIES += avahi |
| 178 | KODI_CONF_OPTS += --enable-avahi |
| 179 | else |
| 180 | KODI_CONF_OPTS += --disable-avahi |
| 181 | endif |
| 182 | |
| 183 | ifeq ($(BR2_PACKAGE_KODI_LIBCEC),y) |
| 184 | KODI_DEPENDENCIES += libcec |
| 185 | KODI_CONF_OPTS += --enable-libcec |
| 186 | else |
| 187 | KODI_CONF_OPTS += --disable-libcec |
| 188 | endif |
| 189 | |
Bernd Kuhls | 0818a65 | 2015-07-22 22:30:27 +0200 | [diff] [blame] | 190 | ifeq ($(BR2_PACKAGE_KODI_LIRC),y) |
| 191 | KODI_CONF_OPTS += --enable-lirc |
| 192 | else |
| 193 | KODI_CONF_OPTS += --disable-lirc |
| 194 | endif |
| 195 | |
Bernd Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 196 | ifeq ($(BR2_PACKAGE_KODI_WAVPACK),y) |
| 197 | KODI_DEPENDENCIES += wavpack |
| 198 | endif |
| 199 | |
| 200 | ifeq ($(BR2_PACKAGE_KODI_LIBTHEORA),y) |
| 201 | KODI_DEPENDENCIES += libtheora |
| 202 | endif |
| 203 | |
| 204 | # kodi needs libva & libva-glx |
| 205 | ifeq ($(BR2_PACKAGE_KODI_LIBVA)$(BR2_PACKAGE_MESA3D_DRI_DRIVER),yy) |
| 206 | KODI_DEPENDENCIES += mesa3d libva |
| 207 | KODI_CONF_OPTS += --enable-vaapi |
| 208 | else |
| 209 | KODI_CONF_OPTS += --disable-vaapi |
| 210 | endif |
| 211 | |
Bernd Kuhls | 25dc51c | 2014-12-23 18:46:36 +0100 | [diff] [blame] | 212 | ifeq ($(BR2_PACKAGE_KODI_OPTICALDRIVE),y) |
| 213 | KODI_CONF_OPTS += --enable-optical-drive --enable-dvdcss |
| 214 | else |
| 215 | KODI_CONF_OPTS += --disable-optical-drive --disable-dvdcss |
| 216 | endif |
| 217 | |
Bernd Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 218 | # Add HOST_DIR to PATH for codegenerator.mk to find swig |
| 219 | define KODI_BOOTSTRAP |
Bernd Kuhls | cd18114 | 2015-07-22 22:30:26 +0200 | [diff] [blame] | 220 | $(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D)/tools/depends/native/JsonSchemaBuilder |
| 221 | $(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D)/tools/depends/native/TexturePacker |
Bernd Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 222 | cd $(@D) && PATH=$(BR_PATH) ./bootstrap |
| 223 | endef |
| 224 | KODI_PRE_CONFIGURE_HOOKS += KODI_BOOTSTRAP |
| 225 | |
| 226 | define KODI_CLEAN_UNUSED_ADDONS |
Yann E. MORIN | 21b5d85 | 2014-12-28 16:05:42 +0100 | [diff] [blame] | 227 | 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 Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 231 | endef |
| 232 | KODI_POST_INSTALL_TARGET_HOOKS += KODI_CLEAN_UNUSED_ADDONS |
| 233 | |
| 234 | define KODI_CLEAN_CONFLUENCE_SKIN |
Yann E. MORIN | 21b5d85 | 2014-12-28 16:05:42 +0100 | [diff] [blame] | 235 | 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 Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 237 | endef |
| 238 | KODI_POST_INSTALL_TARGET_HOOKS += KODI_CLEAN_CONFLUENCE_SKIN |
| 239 | |
| 240 | define KODI_INSTALL_BR_WRAPPER |
| 241 | $(INSTALL) -D -m 0755 package/kodi/br-kodi \ |
| 242 | $(TARGET_DIR)/usr/bin/br-kodi |
| 243 | endef |
| 244 | KODI_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. MORIN | 21b5d85 | 2014-12-28 16:05:42 +0100 | [diff] [blame] | 247 | # configuration, so ends up storing it in /.kodi (yes, at the root of |
Bernd Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 248 | # the rootfs). This is a problem for read-only filesystems. But we can't |
Yann E. MORIN | 21b5d85 | 2014-12-28 16:05:42 +0100 | [diff] [blame] | 249 | # 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 Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 251 | define KODI_INSTALL_CONFIG_DIR |
| 252 | $(INSTALL) -d -m 0755 $(TARGET_DIR)/var/kodi |
Yann E. MORIN | 21b5d85 | 2014-12-28 16:05:42 +0100 | [diff] [blame] | 253 | ln -sf /var/kodi $(TARGET_DIR)/.kodi |
| 254 | ln -sf /var/kodi $(TARGET_DIR)/var/xbmc |
Bernd Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 255 | ln -sf /var/kodi $(TARGET_DIR)/.xbmc |
| 256 | endef |
| 257 | KODI_POST_INSTALL_TARGET_HOOKS += KODI_INSTALL_CONFIG_DIR |
| 258 | |
| 259 | define KODI_INSTALL_INIT_SYSV |
| 260 | $(INSTALL) -D -m 755 package/kodi/S50kodi \ |
| 261 | $(TARGET_DIR)/etc/init.d/S50kodi |
| 262 | endef |
| 263 | |
| 264 | define KODI_INSTALL_INIT_SYSTEMD |
| 265 | $(INSTALL) -D -m 644 package/kodi/kodi.service \ |
Mike Williams | af17811 | 2015-03-20 15:14:05 -0400 | [diff] [blame] | 266 | $(TARGET_DIR)/usr/lib/systemd/system/kodi.service |
Bernd Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 267 | |
| 268 | mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants |
| 269 | |
Mike Williams | af17811 | 2015-03-20 15:14:05 -0400 | [diff] [blame] | 270 | ln -fs ../../../../usr/lib/systemd/system/kodi.service \ |
Bernd Kuhls | 3578459 | 2014-12-23 18:46:27 +0100 | [diff] [blame] | 271 | $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/kodi.service |
| 272 | endef |
| 273 | |
| 274 | $(eval $(autotools-package)) |