summaryrefslogtreecommitdiff
path: root/package/kodi/Makefile
blob: 4242bbf34889ce8e2fff4942dd460ddeb109a355 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# This file is part of the OpenADK project. OpenADK is copyrighted
# material, please see the LICENCE file in the top-level directory.

include $(ADK_TOPDIR)/rules.mk

PKG_NAME:=		kodi
PKG_VERSION:=		14.1
PKG_RELEASE:=		1
PKG_HASH:=		a38059e292cf8523918834e49fcc2d688525ceb7951ddf7f5ee535f4147255d6
PKG_DESCR:=		software media player
PKG_SECTION:=		mm/video
PKG_DEPENDS:=		boost python2 libstdcxx glibc-gconv
PKG_DEPENDS+=		libass libmpeg2 libmad libdbus libglew mesalib
PKG_DEPENDS+=		libjpeg-turbo libogg libvorbis libmodplug libcurl
PKG_DEPENDS+=		libflac libbz2 libtiff liblzo libressl
PKG_DEPENDS+=		yajl tinyxml libsqlite libpcrecpp libpng libncurses
PKG_DEPENDS+=		libpcre libcdio libfreetype libsamplerate libuuid
PKG_DEPENDS+=		taglib libjasper libmp3lame libmicrohttpd
PKG_DEPENDS+=		libgpg-error libudev python2-mod-sqlite libffmpeg
PKG_DEPENDS+=		libxslt libvorbisenc alsa-lib glib libglu librt
PKG_BUILDDEP:=		boost python2 libass ffmpeg libressl libglew
PKG_BUILDDEP+=		libmpeg2 libmad libjpeg-turbo libogg libvorbis
PKG_BUILDDEP+=		curl flac bzip2 libtiff liblzo yajl mesalib
PKG_BUILDDEP+=		tinyxml sqlite pcre libpng libcdio freetype 
PKG_BUILDDEP+=		libsamplerate taglib libjasper lame libmicrohttpd
PKG_BUILDDEP+=		eudev alsa-lib glib glu libmodplug
PKG_BUILDDEP+=		libgpg-error dbus libxslt libvorbis
PKG_BUILDDEP+=		swig-host sdl-host sdl-image-host liblzo-host
PKG_BUILDDEP+=		zip-host unzip-host
PKG_URL:=		http://kodi.tv/
PKG_SITES:=		http://mirrors.kodi.tv/releases/source/

DISTFILES:=		$(PKG_VERSION)-Helix.tar.gz
WRKDIST=		$(WRKDIR)/xbmc-14.1-Helix

PKG_CHOICES_KODI:=	WITH_LIBRESSL WITH_OPENSSL
PKGCD_WITH_LIBRESSL:=	with libressl
PKGCS_WITH_LIBRESSL:=	libressl
PKGCB_WITH_LIBRESSL:=	libressl
PKGCD_WITH_OPENSSL:=	with openssl
PKGCS_WITH_OPENSSL:=	libopenssl
PKGCB_WITH_OPENSSL:=	openssl

PKG_FLAVOURS_KODI:=	WITH_SMB WITH_NFS WITH_SSH WITH_AVAHI WITH_CEC 
PKG_FLAVOURS_KODI+=	WITH_AFP WITH_WEBSERVER WITH_RTMP WITH_BLURAY

PKGFD_WITH_SMB:=	enable samba support
PKGFB_WITH_SMB:=	samba
PKGFS_WITH_SMB:=	samba-lib
PKGFD_WITH_NFS:=	enable nfs support
PKGFB_WITH_NFS:=	libnfs
PKGFS_WITH_NFS:=	libnfs
PKGFD_WITH_SSH:=	enable ssh support
PKGFB_WITH_SSH:=	libssh
PKGFS_WITH_SSH:=	libssh
PKGFD_WITH_AVAHI:=	enable avahi support
PKGFB_WITH_AVAHI:=	avahi
PKGFS_WITH_AVAHI:=	libavahi
PKGFD_WITH_CEC:=	enable cec support
PKGFB_WITH_CEC:=	libcec
PKGFS_WITH_CEC:=	libcec
PKGFD_WITH_AFP:=	enable afp support
PKGFB_WITH_AFP:=	afpfs-ng
PKGFS_WITH_AFP:=	libafpclient
PKGFD_WITH_RTMP:=	enable rtmp support
PKGFB_WITH_RTMP:=	rtmpdump
PKGFS_WITH_RTMP:=	librtmp
PKGFD_WITH_BLURAY:=	enable bluray support
PKGFB_WITH_BLURAY:=	libbluray
PKGFS_WITH_BLURAY:=	libbluray
PKGFD_WITH_WEBSERVER:=	enable internal webserver support

# libiconv missing, freescale GL libraries linked against glibc
PKG_LIBC_DEPENDS:=	glibc

PKG_DEPENDS_RASPBERRY_PI:=	bcm2835-vc
PKG_BUILDDEP_RASPBERRY_PI:=	bcm2835-vc
PKG_DEPENDS_RASPBERRY_PI2:=	bcm2835-vc
PKG_BUILDDEP_RASPBERRY_PI2:=	bcm2835-vc
PKG_DEPENDS_SOLIDRUN_IMX6:=	libfslvpuwrap gpu-viv-bin-mx6q
PKG_BUILDDEP_SOLIDRUN_IMX6:=	libfslvpuwrap gpu-viv-bin-mx6q
PKG_SYSTEM_DEPENDS:=	raspberry-pi raspberry-pi2 solidrun-imx6

DIFF_IGNOREFILES:=	configure missing depcomp install-sh INSTALL \
			aclocal.m4 config.h.in

include $(ADK_TOPDIR)/mk/package.mk

$(eval $(call PKG_template,KODI,kodi,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))

HOST_CXXFLAGS+=		$(HOST_CPPFLAGS)
XAKE_FLAGS+=		V=1 TIXML_USE_STL=1 GCC_HONOUR_COPTS=s
TARGET_CPPFLAGS+=	-I. -I./utils \
			-I$(STAGING_TARGET_DIR)/usr/include/afpfs-ng \
			-DTIXML_USE_STL=1 -DLINUX

ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI),y)
TARGET_CPPFLAGS+=	-I$(STAGING_TARGET_DIR)/opt/vc/include \
			-I$(STAGING_TARGET_DIR)/opt/vc/include/interface/vcos/pthreads \
			-I$(STAGING_TARGET_DIR)/opt/vc/include/interface/vmcs_host/linux
TARGET_LDFLAGS+=	-L$(STAGING_TARGET_DIR)/opt/vc/lib
endif
ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI2),y)
TARGET_CPPFLAGS+=	-I$(STAGING_TARGET_DIR)/opt/vc/include \
			-I$(STAGING_TARGET_DIR)/opt/vc/include/interface/vcos/pthreads \
			-I$(STAGING_TARGET_DIR)/opt/vc/include/interface/vmcs_host/linux
TARGET_LDFLAGS+=	-L$(STAGING_TARGET_DIR)/opt/vc/lib
endif

AUTOTOOL_STYLE:=	autoreconf
CONFIGURE_ENV+=		DESTDIR='${WRKINST}' \
			TEXTUREPACKER_NATIVE_ROOT='$(STAGING_HOST_DIR)/usr'
CONFIGURE_ARGS+=	--disable-optical-drive \
			--disable-optimizations \
			--disable-mysql \
			--disable-rsxs \
			--disable-projectm \
			--disable-mdnsembedded \
			--disable-libusb \
			--disable-libcap \
			--disable-joystick \
			--disable-dvdcss \
			--disable-gtest \
			--disable-ccache \
			--disable-wayland \
			--disable-pulse \
			--disable-mid \
			--disable-debug \
			--enable-alsa \
			--enable-texturepacker \
			--enable-udev \
			--with-ffmpeg=shared

ifneq ($(ADK_PACKAGE_KODI_WITH_BLURAY),)
CONFIGURE_ARGS+=	--enable-libbluray
else
CONFIGURE_ARGS+=	--disable-libbluray
endif
ifneq ($(ADK_PACKAGE_KODI_WITH_AFP),)
CONFIGURE_ARGS+=	--enable-afpclient
else
CONFIGURE_ARGS+=	--disable-afpclient
endif
ifneq ($(ADK_PACKAGE_KODI_WITH_SMB),)
CONFIGURE_ARGS+=	--enable-samba
else
CONFIGURE_ARGS+=	--disable-samba
endif
ifneq ($(ADK_PACKAGE_KODI_WITH_SSH),)
CONFIGURE_ARGS+=	--enable-ssh
else
CONFIGURE_ARGS+=	--disable-ssh
endif
ifneq ($(ADK_PACKAGE_KODI_WITH_NFS),)
CONFIGURE_ARGS+=	--enable-nfs
else
CONFIGURE_ARGS+=	--disable-nfs
endif
ifneq ($(ADK_PACKAGE_KODI_WITH_CEC),)
CONFIGURE_ARGS+=	--enable-libcec
else
CONFIGURE_ARGS+=	--disable-libcec
endif
ifneq ($(ADK_PACKAGE_KODI_WITH_RTMP),)
CONFIGURE_ARGS+=	--enable-rtmp
else
CONFIGURE_ARGS+=	--disable-rtmp
endif
ifneq ($(ADK_PACKAGE_KODI_WITH_AVAHI),)
CONFIGURE_ARGS+=	--enable-avahi
else
CONFIGURE_ARGS+=	--disable-avahi
endif
ifneq ($(ADK_PACKAGE_KODI_WITH_WEBSERVER),)
CONFIGURE_ARGS+=	--enable-webserver
else
CONFIGURE_ARGS+=	--disable-webserver
endif

ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI),y)
CONFIGURE_ARGS+=	--with-platform=raspberry-pi \
			--enable-player=omxplayer \
			--enable-gles \
			--disable-sdl \
			--disable-x11
endif
ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI2),y)
CONFIGURE_ARGS+=	--with-platform=raspberry-pi \
			--enable-player=omxplayer \
			--enable-gles \
			--disable-sdl \
			--disable-x11
endif
ifeq ($(ADK_TARGET_SYSTEM_SOLIDRUN_IMX6),y)
CONFIGURE_ARGS+=	--disable-x11 \
			--disable-sdl \
			--enable-gles \
			--enable-codec=imxvpu
endif

pre-configure:
	(cd $(WRKBUILD)/lib/cpluff && env PATH='$(AUTOTOOL_PATH)' ./autogen.sh)

pre-build:
	$(SED) "s#@@STAGING_HOST_DIR@@#$(STAGING_HOST_DIR)#" \
		$(WRKBUILD)/tools/TexturePacker/Makefile.in
	PATH='$(HOST_PATH)' \
	make CXX="${HOST_CXX}" CC="${HOST_CC}" CFLAGS="${HOST_CFLAGS}" \
		CXXFLAGS="${HOST_CXXFLAGS}" LDFLAGS="${HOST_LDFLAGS}" \
		 -C $(WRKBUILD)/tools/depends/native/JsonSchemaBuilder

kodi-install:
	$(INSTALL_DIR) $(IDIR_KODI)/usr/lib/kodi/addons
	$(CP) $(WRKINST)/usr/lib/kodi/* \
		$(IDIR_KODI)/usr/lib/kodi
	$(INSTALL_DIR) $(IDIR_KODI)/usr/share/kodi
	$(CP) $(WRKINST)/usr/share/kodi/* \
		$(IDIR_KODI)/usr/share/kodi
	$(INSTALL_DIR) $(IDIR_KODI)/usr/bin
	$(INSTALL_BIN) $(WRKINST)/usr/bin/kodi-standalone \
		$(IDIR_KODI)/usr/bin
	$(INSTALL_BIN) $(WRKINST)/usr/bin/kodi \
		$(IDIR_KODI)/usr/bin

include ${ADK_TOPDIR}/mk/pkg-bottom.mk