diff --git a/packages/addons/service/tvheadend42/package.mk b/packages/addons/service/tvheadend42/package.mk index 6c88cf7c10..d7448ce784 100644 --- a/packages/addons/service/tvheadend42/package.mk +++ b/packages/addons/service/tvheadend42/package.mk @@ -17,8 +17,8 @@ ################################################################################ PKG_NAME="tvheadend42" -PKG_VERSION="a4afbee" -PKG_VERSION_NUMBER="4.1.1832" +PKG_VERSION="616413f" +PKG_VERSION_NUMBER="4.1.1892" PKG_REV="100" PKG_ARCH="any" PKG_LICENSE="GPL" @@ -37,6 +37,14 @@ PKG_ADDON_TYPE="xbmc.service" PKG_AUTORECONF="no" PKG_ADDON_REPOVERSION="7.0" +# transcoding only for generic +if [ "$TARGET_ARCH" = x86_64 ]; then + PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET libva-intel-driver" + TVH_TRANSCODING="--enable-ffmpeg_static --enable-libav --enable-libfdkaac --disable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --disable-qsv" +else + TVH_TRANSCODING="--disable-ffmpeg_static --disable-libav" +fi + PKG_CONFIGURE_OPTS_TARGET="--prefix=/usr \ --arch=$TARGET_ARCH \ --cpu=$TARGET_CPU \ @@ -52,8 +60,7 @@ PKG_CONFIGURE_OPTS_TARGET="--prefix=/usr \ --enable-inotify \ --disable-nvenc \ --disable-uriparser \ - --disable-libav \ - --disable-ffmpeg_static \ + $TVH_TRANSCODING \ --enable-tvhcsa \ --nowerror \ --python=$ROOT/$TOOLCHAIN/bin/python" @@ -67,10 +74,22 @@ pre_configure_target() { cd $ROOT/$PKG_BUILD rm -rf .$TARGET_NAME +# transcoding + if [ "$TARGET_ARCH" = x86_64 ]; then + export AS=$ROOT/$TOOLCHAIN/bin/yasm + fi + export CROSS_COMPILE=$TARGET_PREFIX export CFLAGS="$CFLAGS -I$SYSROOT_PREFIX/usr/include/iconv -L$SYSROOT_PREFIX/usr/lib/iconv" } +# transcoding link tvheadend with g++ +if [ "$TARGET_ARCH" = x86_64 ]; then + pre_make_target() { + export CXX=$TARGET_CXX + } +fi + post_make_target() { $CC -O -fbuiltin -fomit-frame-pointer -fPIC -shared -o capmt_ca.so src/extra/capmt_ca.c -ldl } diff --git a/packages/addons/service/tvheadend42/patches/tvheadend42-01_makefile.patch b/packages/addons/service/tvheadend42/patches/tvheadend42-01_makefile.patch new file mode 100644 index 0000000000..710d1b91fe --- /dev/null +++ b/packages/addons/service/tvheadend42/patches/tvheadend42-01_makefile.patch @@ -0,0 +1,89 @@ +From: Team LibreELEC - https://LibreELEC.tv +Subject: adjust Tvheadend ffmpeg build to work with LibreELEC (transcoding) 06.04.2016 + +--- + +diff --git a/Makefile b/Makefile +--- a/Makefile ++++ b/Makefile +@@ -91,50 +91,65 @@ FFMPEG_CONFIG := \ + PKG_CONFIG_LIBDIR=$(FFMPEG_LIBDIR)/pkgconfig $(PKG_CONFIG) \ + --define-variable=prefix=$(FFMPEG_PREFIX) --static + ++CFLAGS += -I${FFMPEG_PREFIX}/include ++LDFLAGS += ${FFMPEG_LIBDIR}/libavfilter.a ++LDFLAGS += ${FFMPEG_LIBDIR}/libswresample.a ++LDFLAGS += ${FFMPEG_LIBDIR}/libavresample.a ++LDFLAGS += ${FFMPEG_LIBDIR}/libswscale.a ++LDFLAGS += ${FFMPEG_LIBDIR}/libavformat.a ++LDFLAGS += ${FFMPEG_LIBDIR}/libavcodec.a ++LDFLAGS += ${FFMPEG_LIBDIR}/libavutil.a ++ + ifeq ($(CONFIG_LIBX264_STATIC),yes) + FFMPEG_DEPS += libx264 ++LDFLAGS += ${FFMPEG_LIBDIR}/libx264.a + endif + + ifeq ($(CONFIG_LIBX265_STATIC),yes) + FFMPEG_DEPS += libx265 ++LDFLAGS += ${FFMPEG_LIBDIR}/libx265.a + endif + + ifeq ($(CONFIG_LIBVPX_STATIC),yes) + FFMPEG_DEPS += libvpx ++LDFLAGS += ${FFMPEG_LIBDIR}/libvpx.a + endif + + ifeq ($(CONFIG_LIBOGG_STATIC),yes) + FFMPEG_DEPS += libogg ++LDFLAGS += ${FFMPEG_LIBDIR}/libogg.a + endif + + ifeq ($(CONFIG_LIBTHEORA_STATIC),yes) + FFMPEG_DEPS += libtheoraenc libtheoradec libtheora ++LDFLAGS += ${FFMPEG_LIBDIR}/libtheora.a ++LDFLAGS += ${FFMPEG_LIBDIR}/libtheoradec.a ++LDFLAGS += ${FFMPEG_LIBDIR}/libtheoraenc.a + endif + + ifeq ($(CONFIG_LIBVORBIS_STATIC),yes) + FFMPEG_DEPS += libvorbisfile libvorbisenc libvorbis ++LDFLAGS += ${FFMPEG_LIBDIR}/libvorbis.a ++LDFLAGS += ${FFMPEG_LIBDIR}/libvorbisenc.a ++LDFLAGS += ${FFMPEG_LIBDIR}/libvorbisfile.a + endif + + ifeq ($(CONFIG_LIBFDKAAC_STATIC),yes) + FFMPEG_DEPS += libfdk-aac ++LDFLAGS += ${FFMPEG_LIBDIR}/libfdk-aac.a + endif + + ifeq ($(CONFIG_LIBMFX_STATIC),yes) + FFMPEG_DEPS += libmfx ++LDFLAGS += ${FFMPEG_LIBDIR}/libmfx.a + endif + +-LDFLAGS += $(foreach lib,$(FFMPEG_LIBS),$(FFMPEG_LIBDIR)/$(lib).a) +-LDFLAGS += $(foreach lib,$(FFMPEG_DEPS),$(FFMPEG_LIBDIR)/$(lib).a) +- + else # !FFMPEG_STATIC + + FFMPEG_CONFIG := $(PKG_CONFIG) + + endif # FFMPEG_STATIC + +-CFLAGS += `$(FFMPEG_CONFIG) --cflags $(FFMPEG_LIBS)` +-LDFLAGS += `$(FFMPEG_CONFIG) --libs $(FFMPEG_LIBS)` +- + endif + + # LIBAV ######################################################################## +@@ -606,7 +606,7 @@ + + # Binary + ${PROG}: .config.mk make_webui $(OBJS) +- $(pCC) -o $@ $(OBJS) $(CFLAGS) $(LDFLAGS) ++ $(CXX) -o $@ $(OBJS) $(CFLAGS) $(LDFLAGS) + + # Object + ${BUILDDIR}/%.o: %.c diff --git a/packages/addons/service/tvheadend42/patches/tvheadend42-02_makefile_ffmpeg.patch b/packages/addons/service/tvheadend42/patches/tvheadend42-02_makefile_ffmpeg.patch new file mode 100644 index 0000000000..1f4db67b52 --- /dev/null +++ b/packages/addons/service/tvheadend42/patches/tvheadend42-02_makefile_ffmpeg.patch @@ -0,0 +1,82 @@ +From: Team LibreELEC - https://LibreELEC.tv +Subject: adjust Tvheadend ffmpeg build to work with LibreELEC (transcoding) 06.04.2016 + +--- + +diff --git a/Makefile.ffmpeg b/Makefile.ffmpeg +--- a/Makefile.ffmpeg ++++ b/Makefile.ffmpeg +@@ -24,6 +24,9 @@ + FFMPEG_TARGET := x86-linux-gcc + endif + ++FFMPEG_HOST := $(ARCH)-libreelec-linux-gnu ++FFMPEG_TARGET := $(ARCH)-libreelec-linux-gnu ++ + unexport CFLAGS + unexport LDFLAGS + +@@ -135,7 +141,7 @@ + + $(LIB_ROOT)/$(YASM)/.tvh_build: \ + $(LIB_ROOT)/$(YASM)/.tvh_download +- cd $(LIB_ROOT)/$(YASM) && $(CONFIGURE) ++ cd $(LIB_ROOT)/$(YASM) && $(CONFIGURE) CC=$(HOST_CC) + DESTDIR=$(EBUILDIR) \ + $(MAKE) -C $(LIB_ROOT)/$(YASM) install + @touch $@ +@@ -224,6 +226,7 @@ + cd $(LIB_ROOT)/$(LIBX265)/build/linux && cmake -G "Unix Makefiles" \ + -DCMAKE_INSTALL_PREFIX="/ffmpeg" \ + -DENABLE_SHARED:BOOL=OFF \ ++ -DEXTRA_LINK_FLAGS="-ldl" \ + ../../source + DESTDIR=$(EBUILDIR) \ + $(MAKE) -C $(LIB_ROOT)/$(LIBX265)/build/linux install +@@ -257,7 +260,7 @@ + ifeq (yes,$(CONFIG_LIBVPX_STATIC)) + + ifneq (,$(FFMPEG_TARGET)) +-LIBVPX_TARGET := --target=$(FFMPEG_TARGET) ++LIBVPX_TARGET := --target=generic-gnu + endif + + $(LIB_ROOT)/$(LIBVPX)/.tvh_download: +@@ -268,7 +271,7 @@ + $(LIB_ROOT)/$(LIBVPX)/.tvh_build: \ + $(LIB_ROOT)/$(YASM)/.tvh_build \ + $(LIB_ROOT)/$(LIBVPX)/.tvh_download +- cd $(LIB_ROOT)/$(LIBVPX) && $(CONFIGURE) \ ++ cd $(LIB_ROOT)/$(LIBVPX) && CROSS=$(FFMPEG_TARGET)- $(CONFIGURE) \ + --disable-examples \ + --disable-docs \ + --disable-unit-tests \ +@@ -342,7 +345,8 @@ + $(LIB_ROOT)/$(LIBOGG)/.tvh_build \ + $(LIB_ROOT)/$(LIBTHEORA)/.tvh_download + cd $(LIB_ROOT)/$(LIBTHEORA) && $(CONFIGURE) \ +- --with-ogg=$(EPREFIX) \ ++ OGG_CFLAGS=-I$(EPREFIX)/include \ ++ OGG_LIBS=-L$(EPREFIX)/lib \ + --disable-examples \ + $(LIBTHEORA_HOST) + DESTDIR=$(EBUILDIR) \ +@@ -387,7 +391,8 @@ + $(LIB_ROOT)/$(LIBOGG)/.tvh_build \ + $(LIB_ROOT)/$(LIBVORBIS)/.tvh_download + cd $(LIB_ROOT)/$(LIBVORBIS) && $(CONFIGURE) \ +- --with-ogg=$(EPREFIX) ++ OGG_CFLAGS=-I$(EPREFIX)/include \ ++ OGG_LIBS=-L$(EPREFIX)/lib + DESTDIR=$(EBUILDIR) \ + $(MAKE) -C $(LIB_ROOT)/$(LIBVORBIS) install + @touch $@ +@@ -538,6 +543,8 @@ + $(LIB_ROOT)/$(LIBMFX)/.tvh_build \ + $(LIB_ROOT)/$(FFMPEG)/.tvh_download + cd $(LIB_ROOT)/$(FFMPEG) && $(CONFIGURE) \ ++ --cc=$(FFMPEG_HOST)-gcc \ ++ --cxx=$(FFMPEG_HOST)-g++ \ + --disable-all \ + --enable-gpl \ + --extra-cflags="$(ECFLAGS)" \