| 3 |
3 |
|
| 4 |
4 |
EAPI=8
|
| 5 |
5 |
|
| 6 |
|
COMMIT="e855f62e6697cf756ad2eed2ed03b8d06ba2019b"
|
| 7 |
|
PYTHON_COMPAT=( python3_{11..14} )
|
|
6 |
PYTHON_COMPAT=( python3_{11..15} )
|
| 8 |
7 |
|
| 9 |
|
inherit ffmpeg-compat flag-o-matic linux-info python-single-r1 systemd toolchain-funcs
|
|
8 |
inherit flag-o-matic linux-info python-single-r1 systemd toolchain-funcs
|
|
9 |
|
|
10 |
# We need to re-host the pre-built assets tarball because it's hidden behind a
|
|
11 |
# download API. It's smaller than the npm cache needed to rebuild them.
|
|
12 |
# When bumping, run this, and update WEBUI_VUE_HASH below.
|
|
13 |
# EXTRA_ECONF="--enable-vue_cache --disable-vue_build" ebuild tvheadend-9999.ebuild clean compile
|
|
14 |
# cp -v /var/tmp/portage/media-tv/tvheadend-9999/work/tvheadend-9999/build.linux/webui-vue-*.tgz /var/cache/distfiles/
|
|
15 |
|
|
16 |
if [[ ${PV} == *9999* ]]; then
|
|
17 |
EGIT_REPO_URI="https://github.com/${PN}/${PN}.git"
|
|
18 |
inherit git-r3
|
|
19 |
else
|
|
20 |
COMMIT=""
|
|
21 |
WEBUI_VUE_HASH=""
|
|
22 |
SRC_URI="https://github.com/tvheadend/tvheadend/archive/${COMMIT}.tar.gz -> ${P}.tar.gz
|
|
23 |
https://dev.gentoo.org/~chewi/distfiles/webui-vue-${WEBUI_VUE_HASH}.tgz"
|
|
24 |
S="${WORKDIR}/${PN}-${COMMIT}"
|
|
25 |
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
|
|
26 |
export TVHEADEND_FILE_CACHE="${DISTDIR}"
|
|
27 |
fi
|
| 10 |
28 |
|
| 11 |
29 |
DESCRIPTION="Tvheadend is a TV streaming server and digital video recorder"
|
| 12 |
30 |
HOMEPAGE="https://tvheadend.org/"
|
| 13 |
|
SRC_URI="https://github.com/tvheadend/tvheadend/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
|
| 14 |
|
S="${WORKDIR}/${PN}-${COMMIT}"
|
|
31 |
|
| 15 |
32 |
LICENSE="GPL-3"
|
| 16 |
33 |
SLOT="0"
|
| 17 |
|
KEYWORDS="amd64 arm arm64 x86"
|
| 18 |
|
IUSE="dbus debug +ddci dvbcsa +dvb +ffmpeg hdhomerun +imagecache +inotify iptv opus satip systemd +timeshift uriparser vpx x264 x265 xmltv zeroconf zlib"
|
|
34 |
IUSE="dbus debug +ddci dvbcsa +dvb +ffmpeg hdhomerun +imagecache +inotify iptv opus satip systemd +timeshift uriparser vaapi vpx x264 x265 xmltv zeroconf zlib"
|
| 19 |
35 |
|
| 20 |
36 |
REQUIRED_USE="
|
| 21 |
37 |
${PYTHON_REQUIRED_USE}
|
| 22 |
38 |
ddci? ( dvb )
|
|
39 |
vaapi? ( ffmpeg )
|
| 23 |
40 |
"
|
| 24 |
41 |
|
| 25 |
42 |
BDEPEND="
|
| ... | ... | |
| 34 |
51 |
virtual/libiconv
|
| 35 |
52 |
dbus? ( sys-apps/dbus )
|
| 36 |
53 |
dvbcsa? ( media-libs/libdvbcsa )
|
| 37 |
|
ffmpeg? ( media-video/ffmpeg-compat:6=[opus?,vpx?,x264?,x265?] )
|
|
54 |
ffmpeg? ( =media-video/ffmpeg-8.1*:=[opus?,vpx?,x264?,x265?] )
|
| 38 |
55 |
hdhomerun? ( media-libs/libhdhomerun )
|
| 39 |
56 |
dev-libs/openssl:0=
|
| 40 |
57 |
uriparser? ( dev-libs/uriparser )
|
| ... | ... | |
| 54 |
71 |
x264? ( media-libs/x264 )
|
| 55 |
72 |
x265? ( media-libs/x265 )
|
| 56 |
73 |
)
|
|
74 |
vaapi? ( media-libs/libva:= )
|
| 57 |
75 |
"
|
| 58 |
76 |
|
| 59 |
77 |
RDEPEND+="
|
| ... | ... | |
| 64 |
82 |
xmltv? ( media-tv/xmltv )
|
| 65 |
83 |
"
|
| 66 |
84 |
|
|
85 |
[[ ${PV} == *9999* ]] && BDEPEND+="
|
|
86 |
net-libs/nodejs[npm]
|
|
87 |
"
|
|
88 |
|
| 67 |
89 |
# Some patches from:
|
| 68 |
90 |
# https://github.com/rpmfusion/tvheadend
|
| 69 |
91 |
|
| ... | ... | |
| 72 |
94 |
"${FILESDIR}"/${PN}-4.3-hdhomerun.patch
|
| 73 |
95 |
"${FILESDIR}"/${PN}-4.2.2-dtv_scan_tables.patch
|
| 74 |
96 |
"${FILESDIR}"/${PN}-4.2.7-python3.patch
|
|
97 |
"${FILESDIR}"/${PN}-4.3-ffmpeg9.patch
|
| 75 |
98 |
)
|
| 76 |
99 |
|
| 77 |
100 |
DOCS=( README.md )
|
| 78 |
101 |
|
|
102 |
# Make npm behave.
|
|
103 |
export npm_config_audit=false
|
|
104 |
export npm_config_color=false
|
|
105 |
export npm_config_foreground_scripts=true
|
|
106 |
export npm_config_loglevel=verbose
|
|
107 |
export npm_config_optional=true
|
|
108 |
export npm_config_progress=false
|
|
109 |
export npm_config_save=false
|
|
110 |
|
| 79 |
111 |
pkg_setup() {
|
| 80 |
112 |
python-single-r1_pkg_setup
|
| 81 |
113 |
|
| ... | ... | |
| 83 |
115 |
CONFIG_CHECK="~INOTIFY_USER" linux-info_pkg_setup
|
| 84 |
116 |
}
|
| 85 |
117 |
|
|
118 |
src_unpack() {
|
|
119 |
if [[ ${PV} == *9999* ]]; then
|
|
120 |
git-r3_src_unpack
|
|
121 |
# This downloads things so must go in src_unpack to avoid the sandbox.
|
|
122 |
env -C "${S}"/src/webui/static-vue npm install || die
|
|
123 |
else
|
|
124 |
unpack ${P}.tar.gz
|
|
125 |
fi
|
|
126 |
}
|
|
127 |
|
| 86 |
128 |
# We unconditionally enable codecs that do not require additional
|
| 87 |
129 |
# dependencies when building tvheadend. If support is missing from
|
| 88 |
130 |
# ffmpeg at runtime then tvheadend will simply disable these codecs.
|
| ... | ... | |
| 91 |
133 |
# most of them only take effect when --enable-ffmpeg_static is given.
|
| 92 |
134 |
|
| 93 |
135 |
src_configure() {
|
| 94 |
|
# TODO: fix with >=ffmpeg-7 then drop compat (bug #954780)
|
| 95 |
|
use ffmpeg && ffmpeg_compat_setup 6
|
| 96 |
|
|
| 97 |
136 |
# -Werror=lto-type-mismatch
|
| 98 |
137 |
# https://bugs.gentoo.org/932794
|
| 99 |
138 |
# https://github.com/tvheadend/tvheadend/issues/1732
|
| 100 |
139 |
filter-lto
|
| 101 |
140 |
|
|
141 |
local myconf=(
|
|
142 |
--disable-bundle
|
|
143 |
--disable-ccache
|
|
144 |
--disable-dvbscan
|
|
145 |
--disable-ffmpeg_static
|
|
146 |
--disable-hdhomerun_static
|
|
147 |
--enable-libfdkaac
|
|
148 |
--enable-libtheora
|
|
149 |
--enable-libvorbis
|
|
150 |
--nowerror
|
|
151 |
$(use_enable dbus dbus_1)
|
|
152 |
$(use_enable debug trace)
|
|
153 |
$(use_enable ddci)
|
|
154 |
$(use_enable dvb linuxdvb)
|
|
155 |
$(use_enable dvbcsa)
|
|
156 |
$(use_enable dvbcsa capmt)
|
|
157 |
$(use_enable dvbcsa cccam)
|
|
158 |
$(use_enable dvbcsa constcw)
|
|
159 |
$(use_enable dvbcsa cwc)
|
|
160 |
$(use_enable ffmpeg libav)
|
|
161 |
$(use_enable hdhomerun hdhomerun_client)
|
|
162 |
$(use_enable imagecache)
|
|
163 |
$(use_enable inotify)
|
|
164 |
$(use_enable iptv)
|
|
165 |
$(use_enable opus libopus)
|
|
166 |
$(use_enable satip satip_server)
|
|
167 |
$(use_enable satip satip_client)
|
|
168 |
$(use_enable systemd libsystemd_daemon)
|
|
169 |
$(use_enable timeshift)
|
|
170 |
$(use_enable uriparser)
|
|
171 |
$(use_enable vaapi)
|
|
172 |
$(use_enable vpx libvpx)
|
|
173 |
$(use_enable x264 libx264)
|
|
174 |
$(use_enable x265 libx265)
|
|
175 |
$(use_enable zeroconf avahi)
|
|
176 |
$(use_enable zlib)
|
|
177 |
)
|
|
178 |
|
|
179 |
# For live, we build the assets, but for non-live, we just use pre-built
|
|
180 |
# assets. If you want to modify the assets, use the live ebuild.
|
|
181 |
if [[ ${PV} == *9999* ]]; then
|
|
182 |
myconf+=(
|
|
183 |
--disable-vue_cache
|
|
184 |
--enable-vue_build
|
|
185 |
)
|
|
186 |
else
|
|
187 |
myconf+=(
|
|
188 |
--enable-vue_cache
|
|
189 |
--disable-vue_build
|
|
190 |
)
|
|
191 |
fi
|
|
192 |
|
| 102 |
193 |
CC="$(tc-getCC)" \
|
| 103 |
194 |
PKG_CONFIG="$(tc-getPKG_CONFIG)" \
|
| 104 |
|
econf \
|
| 105 |
|
--disable-bundle \
|
| 106 |
|
--disable-ccache \
|
| 107 |
|
--disable-dvbscan \
|
| 108 |
|
--disable-ffmpeg_static \
|
| 109 |
|
--disable-hdhomerun_static \
|
| 110 |
|
--enable-libfdkaac \
|
| 111 |
|
--enable-libtheora \
|
| 112 |
|
--enable-libvorbis \
|
| 113 |
|
--nowerror \
|
| 114 |
|
$(use_enable dbus dbus_1) \
|
| 115 |
|
$(use_enable debug trace) \
|
| 116 |
|
$(use_enable ddci) \
|
| 117 |
|
$(use_enable dvb linuxdvb) \
|
| 118 |
|
$(use_enable dvbcsa) \
|
| 119 |
|
$(use_enable dvbcsa capmt) \
|
| 120 |
|
$(use_enable dvbcsa cccam) \
|
| 121 |
|
$(use_enable dvbcsa constcw) \
|
| 122 |
|
$(use_enable dvbcsa cwc) \
|
| 123 |
|
$(use_enable ffmpeg libav) \
|
| 124 |
|
$(use_enable hdhomerun hdhomerun_client) \
|
| 125 |
|
$(use_enable imagecache) \
|
| 126 |
|
$(use_enable inotify) \
|
| 127 |
|
$(use_enable iptv) \
|
| 128 |
|
$(use_enable opus libopus) \
|
| 129 |
|
$(use_enable satip satip_server) \
|
| 130 |
|
$(use_enable satip satip_client) \
|
| 131 |
|
$(use_enable systemd libsystemd_daemon) \
|
| 132 |
|
$(use_enable timeshift) \
|
| 133 |
|
$(use_enable uriparser) \
|
| 134 |
|
$(use_enable vpx libvpx) \
|
| 135 |
|
$(use_enable x264 libx264) \
|
| 136 |
|
$(use_enable x265 libx265) \
|
| 137 |
|
$(use_enable zeroconf avahi) \
|
| 138 |
|
$(use_enable zlib)
|
|
195 |
npm_config_offline=1 \
|
|
196 |
econf "${myconf[@]}"
|
| 139 |
197 |
}
|
| 140 |
198 |
|
| 141 |
199 |
src_compile() {
|