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.

247 lines
6.3 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. CONFIGURE_ARGS += \
  165. --arch=$(ARCH) \
  166. --disable-libsystemd_daemon \
  167. --disable-dbus_1 \
  168. --disable-libav \
  169. --disable-ffmpeg_static \
  170. --disable-libx264 \
  171. --disable-libx264_static \
  172. --disable-libx265 \
  173. --disable-libx265_static \
  174. --disable-libvpx \
  175. --disable-libvpx_static \
  176. --disable-libtheora \
  177. --disable-libtheora_static \
  178. --disable-libvorbis \
  179. --disable-libvorbis_static \
  180. --disable-libopus \
  181. --disable-libopus_static \
  182. --disable-libfdkaac \
  183. --disable-libfdkaac_static \
  184. --disable-pcloud_cache \
  185. --enable-bundle \
  186. --nowerror=unused-variable
  187. ## Transcoding | Remove these from CONFIGURE_ARGS.
  188. ## --disable-libav \
  189. ## --disable-libx265 \
  190. ## --disable-libx265_static \
  191. ## --disable-libx264_static \
  192. ## --disable-libvpx_static \
  193. ## --disable-libtheora_static \
  194. ## --disable-libvorbis_static \
  195. ## --disable-libopus_static \
  196. ## --disable-libfdkaac_static \
  197. ## --disable-pcloud_cache \
  198. define Build/Prepare
  199. $(call Build/Prepare/Default)
  200. echo 'Tvheadend $(shell echo $(PKG_SOURCE_VERSION) | sed "s/^v//")~openwrt$(PKG_RELEASE)' \
  201. > $(PKG_BUILD_DIR)/debian/changelog
  202. endef
  203. define Package/conffiles
  204. /etc/config/tvheadend
  205. endef
  206. define Package/tvheadend/install
  207. $(INSTALL_DIR) $(1)/etc/init.d
  208. $(INSTALL_BIN) ./files/tvheadend.init $(1)/etc/init.d/tvheadend
  209. $(INSTALL_DIR) $(1)/etc/config
  210. $(INSTALL_CONF) ./files/tvheadend.config $(1)/etc/config/tvheadend
  211. $(INSTALL_DIR) $(1)/etc/hotplug.d/usb
  212. $(INSTALL_BIN) ./files/dvb.hotplug $(1)/etc/hotplug.d/usb/50-dvb
  213. $(INSTALL_DIR) $(1)/usr/bin
  214. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build.linux/tvheadend $(1)/usr/bin/
  215. endef
  216. $(eval $(call BuildPackage,tvheadend))