You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

259 lines
6.7 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=tvheadend
  3. PKG_VERSION:=2021-11-16
  4. PKG_RELEASE:=$(AUTORELEASE)
  5. PKG_SOURCE_PROTO:=git
  6. PKG_SOURCE_URL:=https://github.com/tvheadend/tvheadend.git
  7. PKG_MIRROR_HASH:=1645e90b6b8f104f2749fb0911493010f7ae3176253f2a96a4d6094536207c03
  8. PKG_SOURCE_VERSION:=2efe90cdcf74fdc4179692d283cf46c85e1cf681
  9. PKG_SOURCE_DATE:=2021-11-16
  10. PKG_LICENSE:=GPL-3.0
  11. PKG_LICENSE_FILES:=LICENSE.md
  12. PKG_BUILD_PARALLEL:=1
  13. PKG_FIXUP:=autoreconf
  14. PKG_USE_MIPS16:=0
  15. include $(INCLUDE_DIR)/package.mk
  16. include $(INCLUDE_DIR)/nls.mk
  17. define Package/tvheadend
  18. SECTION:=multimedia
  19. CATEGORY:=Multimedia
  20. TITLE:=TV streaming server
  21. MENU:=1
  22. USERID:=tvheadend:dvb
  23. URL:=https://tvheadend.org
  24. MAINTAINER:=Marius Dinu <m95d+git@psihoexpert.ro>
  25. DEPENDS:= \
  26. +librt \
  27. +libffi \
  28. +libopenssl \
  29. $(ICONV_DEPENDS) \
  30. +zlib \
  31. +TVHEADEND_AVAHI_SUPPORT:libavahi-client \
  32. +TVHEADEND_REGEX_PCRE:libpcre \
  33. +TVHEADEND_REGEX_PCRE2:libpcre2 \
  34. +BUILD_PATENTED&&TVHEADEND_CSA:libdvbcsa
  35. ## Transcoding | Add these to DEPENDS.
  36. ## +TVHEADEND_LIBFFMPEG:libffmpeg-full \
  37. ## +TVHEADEND_LIBVPX:libvpx \
  38. ## +TVHEADEND_LIBTHEORA:libtheora \
  39. ## +TVHEADEND_LIBVORBIS:libvorbis \
  40. ## +TVHEADEND_LIBOPUS:libopusenc \
  41. ## +TVHEADEND_LIBFDKAAC:fdk-aac \
  42. ## +BUILD_PATENTED&&TVHEADEND_LIBX264:libx264 \
  43. endef
  44. define Package/tvheadend/description
  45. Tvheadend is a TV streaming server and recorder for Linux, FreeBSD and Android
  46. supporting DVB-S, DVB-S2, DVB-C, DVB-T, ATSC, IPTV, SAT>IP and HDHomeRun as input sources.
  47. Tvheadend offers the HTTP (VLC, MPlayer), HTSP (Kodi, Movian) and SAT>IP streaming.
  48. endef
  49. define Package/tvheadend/config
  50. source "$(SOURCE)/Config.in"
  51. endef
  52. ## Generic OpenWrt options
  53. ifneq ($(CONFIG_PKG_ASLR_PIE_NONE),)
  54. CONFIGURE_ARGS += --disable-pie
  55. endif
  56. ## Generic tvheadend options
  57. ifneq ($(CONFIG_TVHEADEND_OPTIMIZE_SPEED),)
  58. TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS)) -O3 -flto
  59. TARGET_CXXFLAGS := $(filter-out -O%,$(TARGET_CXXFLAGS)) -O3 -flto
  60. TARGET_LDFLAGS += -flto
  61. endif
  62. ifeq ($(CONFIG_TVHEADEND_TRACE),)
  63. CONFIGURE_ARGS += --disable-trace
  64. endif
  65. ifneq ($(CONFIG_TVHEADEND_REGEX_PCRE2),)
  66. CONFIGURE_ARGS += --disable-pcre --enable-pcre2
  67. else
  68. ifneq ($(CONFIG_TVHEADEND_REGEX_PCRE),)
  69. CONFIGURE_ARGS += --enable-pcre --disable-pcre2
  70. else
  71. ifneq ($(CONFIG_TVHEADEND_REGEX_POSIX),)
  72. CONFIGURE_ARGS += --disable-pcre --disable-pcre2
  73. endif
  74. endif
  75. endif
  76. ifeq ($(CONFIG_TVHEADEND_AVAHI_SUPPORT),)
  77. CONFIGURE_ARGS += --disable-avahi
  78. else
  79. CONFIGURE_ARGS += --enable-avahi
  80. endif
  81. ifeq ($(CONFIG_TVHEADEND_IMAGECACHE),)
  82. CONFIGURE_ARGS += --disable-imagecache
  83. else
  84. CONFIGURE_ARGS += --enable-imagecache
  85. endif
  86. ## TV sources
  87. ifeq ($(CONFIG_TVHEADEND_LINUXDVB_SUPPORT),)
  88. CONFIGURE_ARGS += --disable-linuxdvb
  89. endif
  90. ifeq ($(CONFIG_TVHEADEND_DVBSCAN_SUPPORT),)
  91. CONFIGURE_ARGS += --disable-dvbscan
  92. endif
  93. ifeq ($(CONFIG_TVHEADEND_IPTV),)
  94. CONFIGURE_ARGS += --disable-iptv
  95. endif
  96. ifeq ($(CONFIG_TVHEADEND_SATIP_SERVER),)
  97. CONFIGURE_ARGS += --disable-satip_server
  98. endif
  99. ifeq ($(CONFIG_TVHEADEND_SATIP_CLIENT),)
  100. CONFIGURE_ARGS += --disable-satip_client
  101. endif
  102. ifeq ($(CONFIG_TVHEADEND_HDHOMERUN_CLIENT),)
  103. CONFIGURE_ARGS += --disable-hdhomerun_static
  104. else
  105. CONFIGURE_ARGS += --enable-hdhomerun_client
  106. endif
  107. ## Descrambling
  108. ifeq ($(CONFIG_BUILD_PATENTED),)
  109. CONFIGURE_ARGS += --disable-tvhcsa --disable-dvbcsa --disable-constcw --disable-cwc --disable-capmt --disable-cccam
  110. else
  111. ifeq ($(CONFIG_TVHEADEND_CSA),)
  112. CONFIGURE_ARGS += --disable-tvhcsa --disable-dvbcsa --disable-constcw --disable-cwc --disable-capmt --disable-cccam
  113. else
  114. CONFIGURE_ARGS += --enable-tvhcsa --enable-dvbcsa
  115. ifeq ($(CONFIG_TVHEADEND_CONSTCW),)
  116. CONFIGURE_ARGS += --disable-constcw
  117. endif
  118. ifeq ($(CONFIG_TVHEADEND_NEWCAMD),)
  119. CONFIGURE_ARGS += --disable-cwc
  120. endif
  121. ifeq ($(CONFIG_TVHEADEND_CAPMT),)
  122. CONFIGURE_ARGS += --disable-capmt
  123. endif
  124. ifeq ($(CONFIG_TVHEADEND_CCCAM),)
  125. CONFIGURE_ARGS += --disable-cccam
  126. endif
  127. endif
  128. endif
  129. ## Transcoding | Uncomment these.
  130. ##ifeq ($(CONFIG_BUILD_PATENTED),)
  131. ## CONFIGURE_ARGS += --disable-libav --disable-libx264 --disable-libx265 --disable-libx265_static
  132. ##else
  133. ##ifeq ($(CONFIG_TVHEADEND_LIBFFMPEG),)
  134. ## CONFIGURE_ARGS += --disable-libav
  135. ##else
  136. ## CONFIGURE_ARGS += --enable-libav
  137. ##endif
  138. ##ifeq ($(CONFIG_TVHEADEND_LIBX264),)
  139. ## CONFIGURE_ARGS += --disable-libx264
  140. ##endif
  141. ##ifeq ($(CONFIG_TVHEADEND_LIBX265),)
  142. ## CONFIGURE_ARGS += --disable-libx265 --disable-libx265_static
  143. ##endif
  144. ##ifneq ($(CONFIG_TVHEADEND_LIBFDKAAC),)
  145. ## CONFIGURE_ARGS += --enable-libfdkaac
  146. ##endif
  147. ##endif
  148. ##
  149. ##ifeq ($(CONFIG_TVHEADEND_LIBVPX),)
  150. ## CONFIGURE_ARGS += --disable-libvpx
  151. ##endif
  152. ##
  153. ##ifeq ($(CONFIG_TVHEADEND_LIBlibtheora),)
  154. ## CONFIGURE_ARGS += --disable-libtheora
  155. ##endif
  156. ##
  157. ##ifeq ($(CONFIG_TVHEADEND_LIBVORBIS),)
  158. ## CONFIGURE_ARGS += --disable-libvorbis
  159. ##endif
  160. ##
  161. ##ifeq ($(CONFIG_TVHEADEND_LIBOPUS),)
  162. ## CONFIGURE_ARGS += --disable-libopus
  163. ##endif
  164. #required to cross-compile hdhomerun on non-Linux build host
  165. MAKE_FLAGS += \
  166. OS=Linux
  167. #required to always have "build.linux" dir, not "build.darwin" on macos
  168. CONFIGURE_VARS += \
  169. PLATFORM=linux
  170. #--platfrom=linux is required to cross-compile tvheadend on non-Linux build host
  171. CONFIGURE_ARGS += \
  172. --platform=linux \
  173. --arch=$(ARCH) \
  174. --disable-libsystemd_daemon \
  175. --disable-dbus_1 \
  176. --disable-libav \
  177. --disable-ffmpeg_static \
  178. --disable-libx264 \
  179. --disable-libx264_static \
  180. --disable-libx265 \
  181. --disable-libx265_static \
  182. --disable-libvpx \
  183. --disable-libvpx_static \
  184. --disable-libtheora \
  185. --disable-libtheora_static \
  186. --disable-libvorbis \
  187. --disable-libvorbis_static \
  188. --disable-libopus \
  189. --disable-libopus_static \
  190. --disable-libfdkaac \
  191. --disable-libfdkaac_static \
  192. --disable-pcloud_cache \
  193. --enable-bundle \
  194. --disable-uriparser \
  195. --nowerror=unused-variable
  196. ## Transcoding | Remove these from CONFIGURE_ARGS.
  197. ## --disable-libav \
  198. ## --disable-libx265 \
  199. ## --disable-libx265_static \
  200. ## --disable-libx264_static \
  201. ## --disable-libvpx_static \
  202. ## --disable-libtheora_static \
  203. ## --disable-libvorbis_static \
  204. ## --disable-libopus_static \
  205. ## --disable-libfdkaac_static \
  206. ## --disable-pcloud_cache \
  207. define Build/Prepare
  208. $(call Build/Prepare/Default)
  209. echo 'Tvheadend $(shell echo $(PKG_SOURCE_VERSION) | sed "s/^v//")~openwrt$(PKG_RELEASE)' \
  210. > $(PKG_BUILD_DIR)/debian/changelog
  211. endef
  212. define Package/tvheadend/conffiles
  213. /etc/config/tvheadend
  214. /etc/tvheadend
  215. endef
  216. define Package/tvheadend/install
  217. $(INSTALL_DIR) $(1)/etc/init.d
  218. $(INSTALL_BIN) ./files/tvheadend.init $(1)/etc/init.d/tvheadend
  219. $(INSTALL_DIR) $(1)/etc/config
  220. $(INSTALL_CONF) ./files/tvheadend.config $(1)/etc/config/tvheadend
  221. $(INSTALL_DIR) $(1)/etc/hotplug.d/usb
  222. $(INSTALL_BIN) ./files/dvb.hotplug $(1)/etc/hotplug.d/usb/50-dvb
  223. $(INSTALL_DIR) $(1)/usr/bin
  224. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build.linux/tvheadend $(1)/usr/bin/
  225. endef
  226. $(eval $(call BuildPackage,tvheadend))