media-tv/tvheadend: Version bump to 4.2.4 and 9999 update
authorJames Le Cuirot <chewi@gentoo.org>
Mon, 4 Dec 2017 22:11:05 +0000 (22:11 +0000)
committerJames Le Cuirot <chewi@gentoo.org>
Mon, 4 Dec 2017 22:20:07 +0000 (22:20 +0000)
* Add support for dvbcsa via USE flag
* Add support for dvben50221 via USE flag
* Drop support for libav (fails version checks, missing symbols)
* Source DTV scan tables from new media-tv/dtv-scan-tables package
* Set tvheadend user HOME to /etc/tvheadend to allow for XMLTV data
* Tighten up the systemd service unit
* Add debug USE flag for trace support
* Fix inotify kernel config check
* Add ffmpeg sub-dependencies and associated USE flags (9999 only)

Closes: https://bugs.gentoo.org/579048
Closes: https://bugs.gentoo.org/579986
Closes: https://bugs.gentoo.org/586448
Closes: https://bugs.gentoo.org/588210
Closes: https://bugs.gentoo.org/626238
Package-Manager: Portage-2.3.16, Repoman-2.3.6

media-tv/tvheadend/Manifest
media-tv/tvheadend/files/tvheadend-4.0.9-use_system_queue.patch [new file with mode: 0644]
media-tv/tvheadend/files/tvheadend-4.2.1-hdhomerun.patch [new file with mode: 0644]
media-tv/tvheadend/files/tvheadend-4.2.2-dtv_scan_tables.patch [new file with mode: 0644]
media-tv/tvheadend/files/tvheadend.service
media-tv/tvheadend/metadata.xml
media-tv/tvheadend/tvheadend-4.2.4.ebuild [new file with mode: 0644]
media-tv/tvheadend/tvheadend-9999.ebuild

index f74c515869af023ee08f9c97c186bafcac8f176b..7d3e91d7b72e8e579213ddb52f93d4527f645477 100644 (file)
@@ -1,2 +1,3 @@
-DIST dtv-scan-tables-2015-02-08-f2053b3.tar.bz2 123415 SHA256 83ed1b669009ef325e5d9ccb897e48b31e15e71e81bff442b3d0bbd650131c77 SHA512 aedf0429c2ec0a4692e19c0b4ae1e8c063a5a0fb8695359aa8f716a7f40fd88435ed8b1d2aec2461de3f49b533d6cd012c2a54d06058a5291781da4adf82d609 WHIRLPOOL afaef58cdf2ce1ca03c0a695dbf13192b544e3c5a0012cc70a55834d0b1034d509174684fd0fe3f2111becbe32aac16cad5d467adc278a4b6b16c7dbd384757f
-DIST tvheadend-4.0.9.tar.gz 15825419 SHA256 cea1106f45e286e8c25e6b2f0a581c28bd85e93ce3801ecaac7041568a214977 SHA512 ba8c6edcef126c6a260a9251b0948747074061c8f16fb20f03b250c6698645172c9396530b7fa44bf9cf4d8305fcece08c672c812ba6c48211edfbb2691fb58e WHIRLPOOL c0db6afa8d16201eab5fb188f81d062f84066037395f7e47e496d377e8207e2ffef021a58e07cba4af1217963fb2541b1822681fd33799113858329e9ff287bf
+DIST dtv-scan-tables-2015-02-08-f2053b3.tar.bz2 123415 BLAKE2B 569987bc91f2060e5bb18b5caf35baebe1e72d95953bc69e19a713b33521668550f04dfc7ba125e3cf5ba6badee5a80c5bcdd37e2a5ca086d5dcc29cb0031c16 SHA512 aedf0429c2ec0a4692e19c0b4ae1e8c063a5a0fb8695359aa8f716a7f40fd88435ed8b1d2aec2461de3f49b533d6cd012c2a54d06058a5291781da4adf82d609
+DIST tvheadend-4.0.9.tar.gz 15825419 BLAKE2B b719032e46df24f37614c4a9d1da690b82f15906b1cff7eaa9573162a08e70e2813515972a9dd478530ad4ba984b01dd3fb3bf178e1c3973465000357b541f7e SHA512 ba8c6edcef126c6a260a9251b0948747074061c8f16fb20f03b250c6698645172c9396530b7fa44bf9cf4d8305fcece08c672c812ba6c48211edfbb2691fb58e
+DIST tvheadend-4.2.4.tar.gz 21526564 BLAKE2B 19c571bb253041bd122306eaa516071d096d747b03eaf623b45b79fc0511633a75f1a0925a890207c994da001a2ba3404d1860b91236adae34e307bcf8c57796 SHA512 333a3509da198f5d96316f30fd010a216262315614db302c83405de78d29b32b1d878c0abd7fae2214713107e6955478ee3222b18888a84c57810035af882df4
diff --git a/media-tv/tvheadend/files/tvheadend-4.0.9-use_system_queue.patch b/media-tv/tvheadend/files/tvheadend-4.0.9-use_system_queue.patch
new file mode 100644 (file)
index 0000000..13ac357
--- /dev/null
@@ -0,0 +1,12 @@
+diff -up ./src/queue.h.orig ./src/queue.h
+--- ./src/queue.h.orig 2016-03-14 10:10:57.000000000 +0100
++++ ./src/queue.h      2016-07-04 17:47:22.480252171 +0200
+@@ -5,7 +5,7 @@
+ #ifndef HTSQ_H
+ #define HTSQ_H
+-#include "../vendor/include/sys/queue.h"
++#include <sys/queue.h>
+ /*
+  * Extra LIST-ops
diff --git a/media-tv/tvheadend/files/tvheadend-4.2.1-hdhomerun.patch b/media-tv/tvheadend/files/tvheadend-4.2.1-hdhomerun.patch
new file mode 100644 (file)
index 0000000..64f6f69
--- /dev/null
@@ -0,0 +1,24 @@
+diff -up ./configure.orig ./configure
+--- ./configure.orig   2017-04-21 10:32:22.000000000 +0200
++++ ./configure        2017-04-23 13:31:08.717237211 +0200
+@@ -357,7 +357,7 @@ if enabled hdhomerun_static; then
+ else
+   if enabled_or_auto hdhomerun_client; then
+-    if check_cc_header 'libhdhomerun/hdhomerun' libhdhomerun; then
++    if check_cc_header 'hdhomerun/hdhomerun' libhdhomerun; then
+       enable  hdhomerun_client
+       LDFLAGS="$LDFLAGS -lhdhomerun"
+     fi
+diff -up ./src/input/mpegts/tvhdhomerun/tvhdhomerun_private.h.orig ./src/input/mpegts/tvhdhomerun/tvhdhomerun_private.h
+--- ./src/input/mpegts/tvhdhomerun/tvhdhomerun_private.h.orig  2017-04-21 10:32:22.000000000 +0200
++++ ./src/input/mpegts/tvhdhomerun/tvhdhomerun_private.h       2017-04-23 13:31:08.717237211 +0200
+@@ -24,7 +24,7 @@
+ #include "htsbuf.h"
+ #include "tvhdhomerun.h"
+-#include "libhdhomerun/hdhomerun.h"
++#include <hdhomerun/hdhomerun.h>
+ typedef struct tvhdhomerun_device_info tvhdhomerun_device_info_t;
+ typedef struct tvhdhomerun_device      tvhdhomerun_device_t;
diff --git a/media-tv/tvheadend/files/tvheadend-4.2.2-dtv_scan_tables.patch b/media-tv/tvheadend/files/tvheadend-4.2.2-dtv_scan_tables.patch
new file mode 100644 (file)
index 0000000..5131026
--- /dev/null
@@ -0,0 +1,12 @@
+diff -up ./src/input/mpegts/scanfile.c.orig ./src/input/mpegts/scanfile.c
+--- ./src/input/mpegts/scanfile.c.orig 2017-05-16 13:15:24.000000000 +0200
++++ ./src/input/mpegts/scanfile.c      2017-06-01 22:30:29.150834135 +0200
+@@ -903,7 +903,7 @@ scanfile_init ( const char *muxconf_path
+ #elif defined(PLATFORM_FREEBSD)
+     path = "/usr/local/share/dtv-scan-tables";
+ #else
+-    path = "/usr/share/dvb";
++    path = "/usr/share/dvbv5";
+ #endif
+   if (!initialized) {
index 227faffcb08249a77461340daf9a78f3b6d65076..2d0573ca910f6e18f6365b799d75272bc1a3157a 100644 (file)
@@ -4,11 +4,20 @@ After=network.target
 
 [Service]
 Type=forking
-PIDFile=/run/tvheadend.pid
-ExecStart=/usr/bin/tvheadend -f -p /run/tvheadend.pid -C -c /etc/tvheadend -u tvheadend -g video
-ExecStop=/usr/bin/rm /run/tvheadend.pid
+User=tvheadend
+Group=video
+RuntimeDirectory=tvheadend
+PIDFile=/run/tvheadend/tvheadend.pid
+ExecStart=/usr/bin/tvheadend -6 -f -p /run/tvheadend.pid -C -c /etc/tvheadend
 Restart=always
 RestartSec=5
+DevicePolicy=closed
+DeviceAllow=char-DVB rw # DVB devices
+DeviceAllow=char-drm rw # GPUs for transcoding
+RestrictAddressFamilies=AF_INET AF_INET6
+ProtectSystem=strict
+ProtectHome=yes
+NoNewPrivileges=yes
 
 [Install]
 WantedBy=multi-user.target
index 9d99f1238417187422a26b3ea7d8d2977cd97412..f8bdade22686bb31a76d887cfbdd84629fbea9e6 100644 (file)
@@ -9,14 +9,20 @@
                <flag name="capmt">Enable support for capmt (dvbapi) protocol</flag>
                <flag name="constcw">Enable support for the constcw protocol</flag>
                <flag name="cwc">Enable support for the cwc (newcamd) protocol</flag>
+               <flag name="dvbcsa">Enable decryption of the DVB Common Scrambling Algorithm</flag>
+               <flag name="dvbscan">Use scan tables from dtv-scan-tables git repository</flag>
+               <flag name="dvben50221">Enable support for hardware CAM</flag>
                <flag name="hdhomerun">Enable support for the HDHomeRun device</flag>
+               <flag name="imagecache">Enable support for image caching</flag>
                <flag name="iptv">Enable support for Internet Protocol TV</flag>
+               <flag name="opus">Enable transcoding with the Opus audio codec</flag>
                <flag name="satip">Enable support for IP-based Satellite TV</flag>
                <flag name="timeshift">Enable TimeShift support</flag>
-               <flag name="xmltv">Use <pkg>media-tv/xmltv</pkg></flag>
-               <flag name="dvbscan">Use <pkg>media-tv/linuxtv-dvb-apps</pkg></flag>
-               <flag name="imagecache">Enable support for image caching</flag>
                <flag name="uriparser">Use <pkg>dev-libs/uriparser</pkg></flag>
+               <flag name="vpx">Enable transcoding with the VP8/VP9 video codecs</flag>
+               <flag name="x264">Enable transcoding with the H.264 video codec</flag>
+               <flag name="x265">Enable transcoding with the HEVC video codec</flag>
+               <flag name="xmltv">Use <pkg>media-tv/xmltv</pkg></flag>
        </use>
        <upstream>
                <remote-id type="github">tvheadend/tvheadend</remote-id>
diff --git a/media-tv/tvheadend/tvheadend-4.2.4.ebuild b/media-tv/tvheadend/tvheadend-4.2.4.ebuild
new file mode 100644 (file)
index 0000000..d56276f
--- /dev/null
@@ -0,0 +1,117 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit linux-info systemd toolchain-funcs user
+
+DESCRIPTION="Tvheadend is a TV streaming server and digital video recorder"
+HOMEPAGE="https://tvheadend.org/"
+SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+
+IUSE="+capmt +constcw +cwc dbus debug dvbcsa dvben50221 +dvb +ffmpeg hdhomerun +imagecache +inotify iptv satip systemd +timeshift uriparser xmltv zeroconf zlib"
+
+RDEPEND="
+       dev-libs/openssl:=
+       virtual/libiconv
+       dbus? ( sys-apps/dbus )
+       dvbcsa? ( media-libs/libdvbcsa )
+       dvben50221? ( media-tv/linuxtv-dvb-apps )
+       ffmpeg? ( media-video/ffmpeg:0/55.57.57 )
+       hdhomerun? ( media-libs/libhdhomerun )
+       uriparser? ( dev-libs/uriparser )
+       zeroconf? ( net-dns/avahi )
+       zlib? ( sys-libs/zlib )"
+
+DEPEND="
+       ${RDEPEND}
+       sys-devel/gettext
+       virtual/pkgconfig
+       dvb? ( virtual/linuxtv-dvb-headers )"
+
+RDEPEND+="
+       dvb? ( media-tv/dtv-scan-tables )
+       xmltv? ( media-tv/xmltv )"
+
+REQUIRED_USE="dvbcsa? ( || ( capmt constcw cwc dvben50221 ) )"
+
+# Some patches from:
+# https://github.com/rpmfusion/tvheadend
+
+PATCHES=(
+       "${FILESDIR}/${PN}-4.0.9-use_system_queue.patch"
+       "${FILESDIR}/${PN}-4.2.1-hdhomerun.patch"
+       "${FILESDIR}/${PN}-4.2.2-dtv_scan_tables.patch"
+)
+
+DOCS=( README.md )
+
+pkg_setup() {
+       use inotify &&
+               CONFIG_CHECK="~INOTIFY_USER" linux-info_pkg_setup
+
+       enewuser tvheadend -1 -1 /etc/tvheadend video
+}
+
+src_configure() {
+       CC="$(tc-getCC)" \
+       PKG_CONFIG="${CHOST}-pkg-config" \
+       econf \
+               --disable-bundle \
+               --disable-ccache \
+               --disable-dvbscan \
+               --disable-ffmpeg_static \
+               --disable-hdhomerun_static \
+               --nowerror \
+               $(use_enable capmt) \
+               $(use_enable constcw) \
+               $(use_enable cwc) \
+               $(use_enable dbus dbus_1) \
+               $(use_enable debug trace) \
+               $(use_enable dvb linuxdvb) \
+               $(use_enable dvbcsa) \
+               $(use_enable dvben50221) \
+               $(use_enable ffmpeg libav) \
+               $(use_enable hdhomerun hdhomerun_client) \
+               $(use_enable imagecache) \
+               $(use_enable inotify) \
+               $(use_enable iptv) \
+               $(use_enable satip satip_server) \
+               $(use_enable satip satip_client) \
+               $(use_enable systemd libsystemd_daemon) \
+               $(use_enable timeshift) \
+               $(use_enable uriparser) \
+               $(use_enable zeroconf avahi) \
+               $(use_enable zlib)
+}
+
+src_compile() {
+       emake CC="$(tc-getCC)"
+}
+
+src_install() {
+       default
+
+       newinitd "${FILESDIR}"/tvheadend.initd tvheadend
+       newconfd "${FILESDIR}"/tvheadend.confd tvheadend
+
+       use systemd &&
+               systemd_dounit "${FILESDIR}"/tvheadend.service
+
+       dodir /etc/tvheadend
+       fperms 0700 /etc/tvheadend
+       fowners tvheadend:video /etc/tvheadend
+}
+
+pkg_postinst() {
+       elog "The Tvheadend web interface can be reached at:"
+       elog "http://localhost:9981/"
+       elog
+       elog "Make sure that you change the default username"
+       elog "and password via the Configuration / Access control"
+       elog "tab in the web interface."
+}
index e6779acb3c1f22a01f685bddfc602480bf36fcc3..b3eb58292b32c700225ae5198ca219182aaf415a 100644 (file)
@@ -1,9 +1,9 @@
 # Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
+EAPI=6
 
-inherit eutils git-r3 linux-info systemd toolchain-funcs user
+inherit git-r3 linux-info systemd toolchain-funcs user
 
 DESCRIPTION="Tvheadend is a TV streaming server and digital video recorder"
 HOMEPAGE="https://tvheadend.org/"
@@ -13,64 +13,101 @@ LICENSE="GPL-3"
 SLOT="0"
 KEYWORDS=""
 
-IUSE="capmt constcw +cwc dbus +dvb +dvbscan ffmpeg hdhomerun libav imagecache inotify iptv satip +timeshift uriparser xmltv zeroconf zlib"
+IUSE="+capmt +constcw +cwc dbus debug dvbcsa dvben50221 +dvb +ffmpeg hdhomerun +imagecache +inotify iptv opus satip systemd +timeshift uriparser vpx x264 x265 xmltv zeroconf zlib"
 
-RDEPEND="dev-libs/openssl:=
+RDEPEND="
+       dev-libs/openssl:=
        virtual/libiconv
        dbus? ( sys-apps/dbus )
-       ffmpeg? (
-               !libav? ( >=media-video/ffmpeg-3:= )
-               libav? ( media-video/libav:= )
-       )
+       dvbcsa? ( media-libs/libdvbcsa )
+       dvben50221? ( media-tv/linuxtv-dvb-apps )
+       ffmpeg? ( media-video/ffmpeg:0/55.57.57[opus?,vpx?,x264?,x265?] )
        hdhomerun? ( media-libs/libhdhomerun )
        uriparser? ( dev-libs/uriparser )
        zeroconf? ( net-dns/avahi )
        zlib? ( sys-libs/zlib )"
 
-DEPEND="${RDEPEND}
+# ffmpeg sub-dependencies needed for headers only. Check under
+# src/transcoding/codec/codecs/libs for include statements.
+
+DEPEND="
+       ${RDEPEND}
+       sys-devel/gettext
+       virtual/pkgconfig
        dvb? ( virtual/linuxtv-dvb-headers )
-       capmt? ( virtual/linuxtv-dvb-headers )
-       virtual/pkgconfig"
+       ffmpeg? (
+               opus? ( media-libs/opus )
+               vpx? ( media-libs/libvpx )
+               x264? ( media-libs/x264 )
+               x265? ( media-libs/x265 )
+       )"
 
 RDEPEND+="
-       dvbscan? ( media-tv/linuxtv-dvb-apps )
+       dvb? ( media-tv/dtv-scan-tables )
        xmltv? ( media-tv/xmltv )"
 
-CONFIG_CHECK="~INOTIFY_USER"
+REQUIRED_USE="dvbcsa? ( || ( capmt constcw cwc dvben50221 ) )"
+
+# Some patches from:
+# https://github.com/rpmfusion/tvheadend
+
+PATCHES=(
+       "${FILESDIR}/${PN}-4.0.9-use_system_queue.patch"
+       "${FILESDIR}/${PN}-4.2.1-hdhomerun.patch"
+       "${FILESDIR}/${PN}-4.2.2-dtv_scan_tables.patch"
+)
 
 DOCS=( README.md )
 
 pkg_setup() {
-       enewuser tvheadend -1 -1 /dev/null video
-}
+       use inotify &&
+               CONFIG_CHECK="~INOTIFY_USER" linux-info_pkg_setup
 
-src_prepare() {
-       # remove '-Werror' wrt bug #438424
-       sed -e 's:-Werror::' -i Makefile || die 'sed failed!'
+       enewuser tvheadend -1 -1 /etc/tvheadend video
 }
 
+# We unconditionally enable codecs that do not require additional
+# dependencies when building tvheadend. If support is missing from
+# ffmpeg at runtime then tvheadend will simply disable these codecs.
+
+# It is not necessary to specific all the --disable-*-static options as
+# most of them only take effect when --enable-ffmpeg_static is given.
+
 src_configure() {
        CC="$(tc-getCC)" \
-       econf --prefix="${EPREFIX}"/usr \
-               --datadir="${EPREFIX}"/usr/share \
-               --disable-hdhomerun_static \
-               --disable-ffmpeg_static \
+       PKG_CONFIG="${CHOST}-pkg-config" \
+       econf \
+               --disable-bundle \
                --disable-ccache \
                --disable-dvbscan \
+               --disable-ffmpeg_static \
+               --disable-hdhomerun_static \
+               --enable-libfdkaac \
+               --enable-libtheora \
+               --enable-libvorbis \
+               --nowerror \
                $(use_enable capmt) \
                $(use_enable constcw) \
                $(use_enable cwc) \
-               $(use_enable dbus) \
+               $(use_enable dbus dbus_1) \
+               $(use_enable debug trace) \
                $(use_enable dvb linuxdvb) \
+               $(use_enable dvbcsa) \
+               $(use_enable dvben50221) \
                $(use_enable ffmpeg libav) \
                $(use_enable hdhomerun hdhomerun_client) \
                $(use_enable imagecache) \
                $(use_enable inotify) \
                $(use_enable iptv) \
+               $(use_enable opus libopus) \
                $(use_enable satip satip_server) \
                $(use_enable satip satip_client) \
+               $(use_enable systemd libsystemd_daemon) \
                $(use_enable timeshift) \
                $(use_enable uriparser) \
+               $(use_enable vpx libvpx) \
+               $(use_enable x264 libx264) \
+               $(use_enable x265 libx265) \
                $(use_enable zeroconf avahi) \
                $(use_enable zlib)
 }
@@ -82,10 +119,11 @@ src_compile() {
 src_install() {
        default
 
-       newinitd "${FILESDIR}/tvheadend.initd" tvheadend
-       newconfd "${FILESDIR}/tvheadend.confd" tvheadend
+       newinitd "${FILESDIR}"/tvheadend.initd tvheadend
+       newconfd "${FILESDIR}"/tvheadend.confd tvheadend
 
-       systemd_dounit "${FILESDIR}/tvheadend.service"
+       use systemd &&
+               systemd_dounit "${FILESDIR}"/tvheadend.service
 
        dodir /etc/tvheadend
        fperms 0700 /etc/tvheadend