The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / kodi / kodi.mk
1 ################################################################################
2 #
3 # kodi
4 #
5 ################################################################################
6
7 KODI_VERSION = 14.2-Helix
8 KODI_SITE = $(call github,xbmc,xbmc,$(KODI_VERSION))
9 KODI_LICENSE = GPLv2
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
23
24 KODI_CONF_ENV = \
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"
33
34 KODI_CONF_OPTS +=  \
35         --with-ffmpeg=shared \
36         --disable-crystalhd \
37         --disable-dvdcss \
38         --disable-hal \
39         --disable-joystick \
40         --disable-openmax \
41         --disable-projectm \
42         --disable-pulse \
43         --disable-ssh \
44         --disable-vdpau \
45         --disable-vtbdecoder \
46         --enable-optimizations
47
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
52 else
53 KODI_CONF_OPTS += --disable-mysql
54 endif
55
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"
62 endif
63
64 ifeq ($(BR2_PACKAGE_LIBFSLVPUWRAP),y)
65 KODI_DEPENDENCIES += libfslvpuwrap
66 KODI_CONF_OPTS += --enable-codec=imxvpu
67 endif
68
69 ifeq ($(BR2_PACKAGE_LIBCAP),y)
70 KODI_CONF_OPTS += --enable-libcap
71 KODI_DEPENDENCIES += libcap
72 else
73 KODI_CONF_OPTS += --disable-libcap
74 endif
75
76 ifeq ($(BR2_PACKAGE_KODI_DBUS),y)
77 KODI_DEPENDENCIES += dbus
78 KODI_CONF_OPTS += --enable-dbus
79 else
80 KODI_CONF_OPTS += --disable-dbus
81 endif
82
83 ifeq ($(BR2_PACKAGE_KODI_ALSA_LIB),y)
84 KODI_DEPENDENCIES += alsa-lib
85 KODI_CONF_OPTS += --enable-alsa
86 else
87 KODI_CONF_OPTS += --disable-alsa
88 endif
89
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)
99 # fix rsxs compile
100 # make sure target libpng-config is used, options taken from rsxs-0.9/acinclude.m4
101 KODI_CONF_ENV += \
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
109 else
110 KODI_CONF_OPTS += --disable-rsxs
111 endif
112 else
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
117 else
118 KODI_CONF_OPTS += --disable-gles
119 endif
120 endif
121
122 ifeq ($(BR2_PACKAGE_KODI_GOOM),y)
123 KODI_CONF_OPTS += --enable-goom
124 else
125 KODI_CONF_OPTS += --disable-goom
126 endif
127
128 ifeq ($(BR2_PACKAGE_KODI_LIBUSB),y)
129 KODI_DEPENDENCIES += libusb-compat
130 KODI_CONF_OPTS += --enable-libusb
131 else
132 KODI_CONF_OPTS += --disable-libusb
133 endif
134
135 ifeq ($(BR2_PACKAGE_KODI_LIBMICROHTTPD),y)
136 KODI_DEPENDENCIES += libmicrohttpd
137 KODI_CONF_OPTS += --enable-webserver
138 else
139 KODI_CONF_OPTS += --disable-webserver
140 endif
141
142 ifeq ($(BR2_PACKAGE_KODI_LIBSMBCLIENT),y)
143 KODI_DEPENDENCIES += samba4
144 KODI_CONF_OPTS += --enable-samba
145 else
146 KODI_CONF_OPTS += --disable-samba
147 endif
148
149 ifeq ($(BR2_PACKAGE_KODI_LIBNFS),y)
150 KODI_DEPENDENCIES += libnfs
151 KODI_CONF_OPTS += --enable-nfs
152 else
153 KODI_CONF_OPTS += --disable-nfs
154 endif
155
156 ifeq ($(BR2_PACKAGE_KODI_RTMPDUMP),y)
157 KODI_DEPENDENCIES += rtmpdump
158 KODI_CONF_OPTS += --enable-rtmp
159 else
160 KODI_CONF_OPTS += --disable-rtmp
161 endif
162
163 ifeq ($(BR2_PACKAGE_KODI_LIBBLURAY),y)
164 KODI_DEPENDENCIES += libbluray
165 KODI_CONF_OPTS += --enable-libbluray
166 else
167 KODI_CONF_OPTS += --disable-libbluray
168 endif
169
170 ifeq ($(BR2_PACKAGE_KODI_LIBSHAIRPLAY),y)
171 KODI_DEPENDENCIES += libshairplay
172 KODI_CONF_OPTS += --enable-airplay
173 else
174 KODI_CONF_OPTS += --disable-airplay
175 endif
176
177 ifeq ($(BR2_PACKAGE_KODI_AVAHI),y)
178 KODI_DEPENDENCIES += avahi
179 KODI_CONF_OPTS += --enable-avahi
180 else
181 KODI_CONF_OPTS += --disable-avahi
182 endif
183
184 ifeq ($(BR2_PACKAGE_KODI_LIBCEC),y)
185 KODI_DEPENDENCIES += libcec
186 KODI_CONF_OPTS += --enable-libcec
187 else
188 KODI_CONF_OPTS += --disable-libcec
189 endif
190
191 ifeq ($(BR2_PACKAGE_KODI_WAVPACK),y)
192 KODI_DEPENDENCIES += wavpack
193 endif
194
195 ifeq ($(BR2_PACKAGE_KODI_LIBTHEORA),y)
196 KODI_DEPENDENCIES += libtheora
197 endif
198
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
203 else
204 KODI_CONF_OPTS += --disable-vaapi
205 endif
206
207 ifeq ($(BR2_PACKAGE_KODI_OPTICALDRIVE),y)
208 KODI_CONF_OPTS += --enable-optical-drive --enable-dvdcss
209 else
210 KODI_CONF_OPTS += --disable-optical-drive --disable-dvdcss
211 endif
212
213 # Add HOST_DIR to PATH for codegenerator.mk to find swig
214 define KODI_BOOTSTRAP
215         cd $(@D) && PATH=$(BR_PATH) ./bootstrap
216 endef
217 KODI_PRE_CONFIGURE_HOOKS += KODI_BOOTSTRAP
218
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
224 endef
225 KODI_POST_INSTALL_TARGET_HOOKS += KODI_CLEAN_UNUSED_ADDONS
226
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
230 endef
231 KODI_POST_INSTALL_TARGET_HOOKS += KODI_CLEAN_CONFLUENCE_SKIN
232
233 define KODI_INSTALL_BR_WRAPPER
234         $(INSTALL) -D -m 0755 package/kodi/br-kodi \
235                 $(TARGET_DIR)/usr/bin/br-kodi
236 endef
237 KODI_POST_INSTALL_TARGET_HOOKS += KODI_INSTALL_BR_WRAPPER
238
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
249 endef
250 KODI_POST_INSTALL_TARGET_HOOKS += KODI_INSTALL_CONFIG_DIR
251
252 define KODI_INSTALL_INIT_SYSV
253         $(INSTALL) -D -m 755 package/kodi/S50kodi \
254                 $(TARGET_DIR)/etc/init.d/S50kodi
255 endef
256
257 define KODI_INSTALL_INIT_SYSTEMD
258         $(INSTALL) -D -m 644 package/kodi/kodi.service \
259                 $(TARGET_DIR)/usr/lib/systemd/system/kodi.service
260
261         mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
262
263         ln -fs ../../../../usr/lib/systemd/system/kodi.service \
264                 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/kodi.service
265 endef
266
267 $(eval $(autotools-package))