Makefile 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. include $(ADK_TOPDIR)/rules.mk
  4. PKG_NAME:= kodi
  5. PKG_VERSION:= 17.6
  6. PKG_RELEASE:= 1
  7. PKG_HASH:= c8312fe92e5bab1cdac1da93d60baed88fa1574146c50c44e3c86d01671c2b1d
  8. PKG_DESCR:= software media player
  9. PKG_SECTION:= mm/video
  10. PKG_DEPENDS:= python2 libsquish libressl libxz
  11. PKG_DEPENDS+= libass libmpeg2 libmad
  12. PKG_DEPENDS+= libmodplug libcurl
  13. PKG_DEPENDS+= libflac libbz2 libtiff libnettle librtmp liblzo
  14. PKG_DEPENDS+= yajl tinyxml libsqlite libpcrecpp libncurses
  15. PKG_DEPENDS+= libpcre libcdio libfreetype libsamplerate libuuid
  16. PKG_DEPENDS+= taglib libjasper libmp3lame
  17. PKG_DEPENDS+= libgpg-error python2-mod-sqlite libffmpeg
  18. PKG_DEPENDS+= glib libdcadec bcm28xx-vc-gl-libs
  19. PKG_BUILDDEP:= python2 libass ffmpeg rtmpdump bcm28xx-vc
  20. PKG_BUILDDEP+= libmpeg2 libmad libjpeg-turbo
  21. PKG_BUILDDEP+= curl flac bzip2 libtiff yajl cmake-host
  22. PKG_BUILDDEP+= tinyxml sqlite pcre libcdio freetype
  23. PKG_BUILDDEP+= libsamplerate taglib libjasper
  24. PKG_BUILDDEP+= glib libmodplug libgpg-error
  25. PKG_BUILDDEP+= swig-host liblzo-host libpng-host libjpeg-turbo-host
  26. PKG_BUILDDEP+= zip-host unzip-host giflib-host libsquish libdcadec
  27. PKG_BUILDDEP+= libcrossguid libressl xz bzip2 liblzo
  28. PKG_NEEDS:= threads c++ data
  29. PKG_URL:= http://kodi.tv/
  30. PKG_SITES:= https://github.com/xbmc/xbmc/archive/
  31. DISTFILES:= $(PKG_VERSION)-Krypton.tar.gz
  32. WRKDIST= ${WRKDIR}/xbmc-$(PKG_VERSION)-Krypton
  33. WRKSRC= $(WRKDIR)/xbmc-$(PKG_VERSION)-Krypton/project/cmake
  34. PKG_SYSTEM_DEPENDS:= raspberry-pi raspberry-pi2 raspberry-pi3 raspberry-pi3p raspberry-pi3p-64
  35. PKG_FLAVOURS_KODI:= WITH_ALSA WITH_CEC WITH_PULSEAUDIO WITH_SMB
  36. PKG_FLAVOURS_KODI+= WITH_MICROHTTPD WITH_SSH WITH_AVAHI
  37. PKGFD_WITH_ALSA:= enable alsa support
  38. PKGFS_WITH_ALSA:= alsa-lib
  39. PKGFB_WITH_ALSA:= alsa-lib
  40. PKGFD_WITH_AVAHI:= enable avahi support
  41. PKGFS_WITH_AVAHI:= libavahi
  42. PKGFB_WITH_AVAHI:= avahi
  43. PKGFD_WITH_CEC:= enable cec support
  44. PKGFS_WITH_CEC:= libcec
  45. PKGFB_WITH_CEC:= libcec
  46. PKGFD_WITH_MICROHTTPD:= enable microhttpd support
  47. PKGFS_WITH_MICROHTTPD:= libmicrohttpd
  48. PKGFB_WITH_MICROHTTPD:= libmicrohttpd
  49. PKGFD_WITH_PULSEAUDIO:= enable pulseaudio support
  50. PKGFS_WITH_PULSEAUDIO:= pulseaudio
  51. PKGFB_WITH_PULSEAUDIO:= pulseaudio
  52. PKGFD_WITH_SMB:= enable smb support
  53. PKGFS_WITH_SMB:= samba
  54. PKGFB_WITH_SMB:= samba
  55. PKGFD_WITH_SSH:= enable ssh support
  56. PKGFS_WITH_SSH:= libssh
  57. PKGFB_WITH_SSH:= libssh
  58. include $(ADK_TOPDIR)/mk/package.mk
  59. $(eval $(call PKG_template,KODI,kodi,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  60. HOST_CXXFLAGS:= -DTARGET_POSIX -DTARGET_LINUX -D_LINUX -I$(WRKBUILD)/../../xbmc/linux
  61. CONFIG_STYLE:= cmake
  62. CMAKE_FLAGS+= -DENABLE_CCACHE=OFF \
  63. -DCMAKE_BUILD_TYPE=Release \
  64. -DVERBOSE=ON \
  65. -DENABLE_DVDCSS=ON \
  66. -DENABLE_INTERNAL_CROSSGUID=OFF \
  67. -DENABLE_INTERNAL_FFMPEG=OFF \
  68. -DWITH_FFMPEG=$(STAGING_TARGET_DIR)/usr \
  69. -DKODI_DEPENDSBUILD=OFF \
  70. -DENABLE_OPENSSL=ON \
  71. -DENABLE_MYSQLCLIENT=OFF \
  72. -DENABLE_NONFREE=OFF \
  73. -DENABLE_CAP=OFF \
  74. -DENABLE_XSLT=OFF \
  75. -DENABLE_BLUETOOTH=OFF \
  76. -DENABLE_BLURAY=OFF \
  77. -DENABLE_AIRTUNES=OFF \
  78. -DENABLE_LCMS2=OFF \
  79. -DENABLE_LIRC=OFF \
  80. -DENABLE_UPNP=OFF \
  81. -DENABLE_OPTICAL=OFF \
  82. -DENABLE_DBUS=OFF \
  83. -DENABLE_EVENTCLIENTS=OFF \
  84. -DENABLE_UDEV=OFF \
  85. -DENABLE_PLIST=OFF \
  86. -DNATIVEPREFIX=$(STAGING_HOST_DIR)/usr \
  87. -DDEPENDS_PATH=$(STAGING_HOST_DIR) \
  88. -DWITH_TEXTUREPACKER=$(STAGING_HOST_DIR)/usr/bin/TexturePacker
  89. ifeq ($(ADK_TARGET_BOARD_BCM28XX),y)
  90. CMAKE_FLAGS+= -DCORE_SYSTEM_NAME=rbpi \
  91. -DWITH_ARCH=arm \
  92. -DWITH_CPU=arm \
  93. -DENABLE_OPENGL=OFF \
  94. -DENABLE_X11=OFF \
  95. -DENABLE_OPENGLES=ON
  96. else
  97. CMAKE_FLAGS+= -DCORE_SYSTEM_NAME=linux
  98. endif
  99. ifeq ($(ADK_PACKAGE_KODI_WITH_ALSA),y)
  100. CMAKE_FLAGS+= -DENABLE_ALSA=ON
  101. else
  102. CMAKE_FLAGS+= -DENABLE_ALSA=OFF
  103. endif
  104. ifeq ($(ADK_PACKAGE_KODI_WITH_AVAHI),y)
  105. CMAKE_FLAGS+= -DENABLE_AVAHI=ON
  106. else
  107. CMAKE_FLAGS+= -DENABLE_AVAHI=OFF
  108. endif
  109. ifeq ($(ADK_PACKAGE_KODI_WITH_CEC),y)
  110. CMAKE_FLAGS+= -DENABLE_CEC=ON
  111. else
  112. CMAKE_FLAGS+= -DENABLE_CEC=OFF
  113. endif
  114. ifeq ($(ADK_PACKAGE_KODI_WITH_MICROHTTPD),y)
  115. CMAKE_FLAGS+= -DENABLE_MICROHTTPD=ON
  116. else
  117. CMAKE_FLAGS+= -DENABLE_MICROHTTPD=OFF
  118. endif
  119. ifeq ($(ADK_PACKAGE_KODI_WITH_PULSEAUDIO),y)
  120. CMAKE_FLAGS+= -DENABLE_PULSEAUDIO=ON
  121. else
  122. CMAKE_FLAGS+= -DENABLE_PULSEAUDIO=OFF
  123. endif
  124. ifeq ($(ADK_PACKAGE_KODI_WITH_SMB),y)
  125. CMAKE_FLAGS+= -DENABLE_SMBCLIENT=ON
  126. else
  127. CMAKE_FLAGS+= -DENABLE_SMBCLIENT=OFF
  128. endif
  129. ifeq ($(ADK_PACKAGE_KODI_WITH_SSH),y)
  130. CMAKE_FLAGS+= -DENABLE_SSH=ON
  131. else
  132. CMAKE_FLAGS+= -DENABLE_SSH=OFF
  133. endif
  134. ifeq ($(ADK_TARGET_LIB_UCLIBC_NG),y)
  135. TARGET_CXXFLAGS+= -liconv
  136. endif
  137. pre-configure:
  138. (cd $(WRKBUILD)/../../tools/depends/native/JsonSchemaBuilder && PATH='$(HOST_PATH)' cmake .)
  139. PATH='$(HOST_PATH)' make -C $(WRKBUILD)/../../tools/depends/native/JsonSchemaBuilder
  140. cp $(WRKBUILD)/../../tools/depends/native/JsonSchemaBuilder/JsonSchemaBuilder \
  141. $(STAGING_HOST_DIR)/usr/bin
  142. (cd $(WRKBUILD)/../../tools/depends/native/TexturePacker && PATH='$(HOST_PATH)' \
  143. cmake -DCORE_SOURCE_DIR=$(WRKBUILD)/../.. \
  144. -DCMAKE_MODULE_PATH=$(WRKBUILD)/../../project/cmake/modules \
  145. -DCMAKE_CXX_FLAGS="$(HOST_CXXFLAGS)" .)
  146. PATH='$(HOST_PATH)' make -C $(WRKBUILD)/../../tools/depends/native/TexturePacker
  147. cp $(WRKBUILD)/../../tools/depends/native/TexturePacker/TexturePacker \
  148. $(STAGING_HOST_DIR)/usr/bin
  149. pre-build:
  150. $(TARGET_CC) -shared -fPIC -o $(WRKBUILD)/kodi-shim.so \
  151. ./files/kodi-shim.c
  152. kodi-install:
  153. $(INSTALL_DIR) $(STAGING_TARGET_DIR)/usr/share/kodi
  154. $(CP) $(WRKINST)/usr/share/kodi/* \
  155. $(STAGING_TARGET_DIR)/usr/share/kodi
  156. # we need a symlink to /data
  157. cd $(IDIR_KODI)/ && ln -sf ../data/kodi .kodi
  158. $(INSTALL_DIR) $(IDIR_KODI)/usr/lib/kodi/addons
  159. $(CP) $(WRKINST)/usr/lib/kodi/* \
  160. $(IDIR_KODI)/usr/lib/kodi
  161. $(INSTALL_DIR) $(IDIR_KODI)/usr/share/kodi
  162. $(CP) $(WRKINST)/usr/share/kodi/* \
  163. $(IDIR_KODI)/usr/share/kodi
  164. $(INSTALL_DIR) $(IDIR_KODI)/usr/bin
  165. $(INSTALL_BIN) $(WRKINST)/usr/bin/kodi-standalone \
  166. $(IDIR_KODI)/usr/bin
  167. $(INSTALL_BIN) $(WRKINST)/usr/bin/kodi \
  168. $(IDIR_KODI)/usr/bin
  169. $(CP) $(WRKBUILD)/kodi-shim.so \
  170. $(IDIR_KODI)/usr/lib/kodi
  171. include ${ADK_TOPDIR}/mk/pkg-bottom.mk