Gentoo Archives: gentoo-commits

From: Pacho Ramos <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-tv/mythtv/
Date: Sat, 05 Jan 2019 13:24:52
Message-Id: 1546694398.3b9308ff82ff8e0a0b3277efcaad0d17e31454a7.pacho@gentoo
1 commit: 3b9308ff82ff8e0a0b3277efcaad0d17e31454a7
2 Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jan 5 13:19:58 2019 +0000
4 Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 5 13:19:58 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b9308ff
7
8 media-tv/mythtv: libmp3lame is needed
9
10 for some broadcasts for silence detection of commercials
11
12 Thanks-to: Donald Simpson <simpson.donald <AT> googlemail.com>
13 Package-Manager: Portage-2.3.53, Repoman-2.3.12
14 Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>
15
16 media-tv/mythtv/Manifest | 1 +
17 media-tv/mythtv/mythtv-29.1-r1.ebuild | 370 ++++++++++++++++++++++++++++++++++
18 2 files changed, 371 insertions(+)
19
20 diff --git a/media-tv/mythtv/Manifest b/media-tv/mythtv/Manifest
21 index c7eb8addfb8..2be7bc50201 100644
22 --- a/media-tv/mythtv/Manifest
23 +++ b/media-tv/mythtv/Manifest
24 @@ -1 +1,2 @@
25 +DIST mythtv-29.1-r1.tar.gz 105657217 BLAKE2B 9d42464b0c75c2d3a359b528e3f7917cfb281f48451167afc6517caa9702da44fce2d48566fd902ec08af35117232113b4d499e2c9a3cf2ad2634d91cf532ca7 SHA512 0eadc37661d9fa93a63c0f425cd43d43533889b0afcea1478b2645e083ba6c96eebf2eec088db1ed6f0a0727c03b7c90c0c18b83c194d630dda3bac45bca5d87
26 DIST mythtv-29.1.tar.gz 105656634 BLAKE2B 8b9dfc6b1e1178bfd1b35e8d499afe570edeb1f07cefa64fc91c2ed74f8155f5ca00cee49a024848f715c0bb782fc22f3c4d04fd8eac8562d108e105d3a41421 SHA512 c80d84c40c019d093d44487fb4cd07d9ce3174781ff8f24a4709fd10294cb8f6186b3e480dad3a09f7a496835fa0cffcc9eca114f807794b693ffcd57acd4e39
27
28 diff --git a/media-tv/mythtv/mythtv-29.1-r1.ebuild b/media-tv/mythtv/mythtv-29.1-r1.ebuild
29 new file mode 100644
30 index 00000000000..85c778c6135
31 --- /dev/null
32 +++ b/media-tv/mythtv/mythtv-29.1-r1.ebuild
33 @@ -0,0 +1,370 @@
34 +# Copyright 1999-2019 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=6
38 +PYTHON_COMPAT=( python2_7 )
39 +
40 +# git diff --relative=mythtv v0.27.6.. > ~/mythtv-0.27.6/patches/mythtv.patch
41 +BACKPORTS="d8a2db77f5731cf32c6d31127452391c6cf7f91f"
42 +MY_P=${P%_p*}
43 +MY_PV=${PV%_p*}
44 +
45 +inherit flag-o-matic python-single-r1 qmake-utils user readme.gentoo-r1 systemd vcs-snapshot
46 +
47 +MYTHTV_BRANCH="fixes/29"
48 +
49 +DESCRIPTION="Homebrew PVR project"
50 +HOMEPAGE="https://www.mythtv.org"
51 +SRC_URI="https://github.com/MythTV/mythtv/archive/${BACKPORTS}.tar.gz -> ${PF}.tar.gz"
52 +
53 +LICENSE="GPL-2"
54 +KEYWORDS="~amd64 ~x86"
55 +SLOT="0/${PV}"
56 +
57 +IUSE_INPUT_DEVICES="input_devices_joystick"
58 +IUSE="alsa altivec autostart bluray cec crystalhd debug dvb dvd egl fftw +hls \
59 + ieee1394 jack lcd libass lirc mythlogserver perl pulseaudio python systemd +theora \
60 + vaapi vdpau +vorbis +wrapper +xml xmltv +xvid zeroconf ${IUSE_INPUT_DEVICES}"
61 +REQUIRED_USE="${PYTHON_REQUIRED_USE}
62 + bluray? ( xml )
63 + theora? ( vorbis )
64 +"
65 +
66 +COMMON="
67 + dev-libs/glib:2
68 + dev-qt/qtcore:5
69 + dev-qt/qtdbus:5
70 + dev-qt/qtgui:5
71 + dev-qt/qtnetwork:5
72 + dev-qt/qtscript:5
73 + dev-qt/qtsql:5[mysql]
74 + dev-qt/qtopengl:5
75 + dev-qt/qtwebkit:5
76 + dev-qt/qtwidgets:5
77 + dev-qt/qtxml:5
78 + media-gfx/exiv2:=
79 + media-libs/freetype:2
80 + media-libs/taglib
81 + >=media-sound/lame-3.93.1
82 + sys-libs/zlib
83 + virtual/mysql
84 + virtual/opengl
85 + x11-libs/libX11
86 + x11-libs/libXext
87 + x11-libs/libXinerama
88 + x11-libs/libXv
89 + x11-libs/libXrandr
90 + x11-libs/libXxf86vm
91 + x11-misc/wmctrl
92 + alsa? ( >=media-libs/alsa-lib-1.0.24 )
93 + bluray? (
94 + dev-libs/libcdio:=
95 + media-libs/libbluray:=
96 + sys-fs/udisks:2
97 + )
98 + cec? ( dev-libs/libcec )
99 + dvb? (
100 + virtual/linuxtv-dvb-headers
101 + )
102 + dvd? (
103 + dev-libs/libcdio:=
104 + sys-fs/udisks:2
105 + )
106 + egl? ( media-libs/mesa[egl] )
107 + fftw? ( sci-libs/fftw:3.0= )
108 + hls? (
109 + <media-libs/libvpx-1.7.0:=
110 + >=media-libs/x264-0.0.20111220:=
111 + )
112 + ieee1394? (
113 + >=media-libs/libiec61883-1.0.0
114 + >=sys-libs/libavc1394-0.5.3
115 + >=sys-libs/libraw1394-1.2.0
116 + )
117 + jack? ( media-sound/jack-audio-connection-kit )
118 + lcd? ( app-misc/lcdproc )
119 + libass? ( >=media-libs/libass-0.9.11:= )
120 + lirc? ( app-misc/lirc )
121 + perl? (
122 + >=dev-perl/libwww-perl-5
123 + dev-perl/DBD-mysql
124 + dev-perl/HTTP-Message
125 + dev-perl/IO-Socket-INET6
126 + dev-perl/LWP-Protocol-https
127 + dev-perl/Net-UPnP
128 + )
129 + pulseaudio? ( media-sound/pulseaudio )
130 + python? (
131 + ${PYTHON_DEPS}
132 + dev-python/lxml
133 + dev-python/mysql-python
134 + dev-python/urlgrabber
135 + dev-python/future
136 + dev-python/requests-cache
137 + )
138 + systemd? ( sys-apps/systemd:= )
139 + theora? ( media-libs/libtheora media-libs/libogg )
140 + vaapi? ( x11-libs/libva:=[opengl] )
141 + vdpau? ( x11-libs/libvdpau )
142 + vorbis? ( >=media-libs/libvorbis-1.0 media-libs/libogg )
143 + xml? ( >=dev-libs/libxml2-2.6.0 )
144 + xvid? ( >=media-libs/xvid-1.1.0 )
145 + zeroconf? (
146 + dev-libs/openssl:0=
147 + net-dns/avahi[mdnsresponder-compat]
148 + )
149 +"
150 +RDEPEND="${COMMON}
151 + !media-tv/mythtv-bindings
152 + !x11-themes/mythtv-themes
153 + media-fonts/corefonts
154 + media-fonts/dejavu
155 + media-fonts/liberation-fonts
156 + x11-apps/xinit
157 + autostart? (
158 + net-dialup/mingetty
159 + x11-apps/xset
160 + x11-wm/evilwm
161 + )
162 + dvd? ( media-libs/libdvdcss )
163 + xmltv? ( >=media-tv/xmltv-0.5.43 )
164 +"
165 +DEPEND="${COMMON}
166 + dev-lang/yasm
167 + virtual/pkgconfig
168 + x11-base/xorg-proto
169 +"
170 +
171 +S="${WORKDIR}/${PF}/mythtv"
172 +
173 +DISABLE_AUTOFORMATTING="yes"
174 +DOC_CONTENTS="
175 +To have this machine operate as recording host for MythTV,
176 +mythbackend must be running. Run the following:
177 +rc-update add mythbackend default
178 +
179 +Your recordings folder must be owned 'mythtv'. e.g.
180 +chown -R mythtv /var/lib/mythtv
181 +
182 +Want mythfrontend to start automatically?
183 +Set USE=autostart. Details can be found at:
184 +https://dev.gentoo.org/~cardoe/mythtv/autostart.html
185 +
186 +Note that the systemd unit now restarts by default and logs
187 +to journald via the console at the notice verbosity.
188 +"
189 +
190 +MYTHTV_GROUPS="video,audio,tty,uucp"
191 +
192 +pkg_setup() {
193 + python-single-r1_pkg_setup
194 + enewuser mythtv -1 /bin/bash /home/mythtv ${MYTHTV_GROUPS}
195 + usermod -a -G ${MYTHTV_GROUPS} mythtv
196 +}
197 +
198 +src_prepare() {
199 + default
200 +
201 + # Perl bits need to go into vender_perl and not site_perl
202 + sed -e "s:pure_install:pure_install INSTALLDIRS=vendor:" \
203 + -i "${S}"/bindings/perl/Makefile
204 +
205 + # Fix up the version info since we are using the fixes/${PV} branch
206 + echo "SOURCE_VERSION=\"v${MY_PV}\"" > "${S}"/VERSION
207 + echo "BRANCH=\"${MYTHTV_BRANCH}\"" >> "${S}"/VERSION
208 + echo "SOURCE_VERSION=\"${BACKPORTS}\"" > "${S}"/EXPORTED_VERSION
209 + echo "BRANCH=\"${MYTHTV_BRANCH}\"" >> "${S}"/EXPORTED_VERSION
210 +
211 + echo "setting.extra -= -ldconfig" >> "${S}"/programs/mythfrontend/mythfrontend.pro
212 +}
213 +
214 +src_configure() {
215 + local myconf=
216 +
217 + # Setup paths
218 + myconf="${myconf} --prefix=${EPREFIX}/usr"
219 + myconf="${myconf} --libdir=${EPREFIX}/usr/$(get_libdir)"
220 + myconf="${myconf} --libdir-name=$(get_libdir)"
221 + myconf="${myconf} --mandir=${EPREFIX}/usr/share/man"
222 +
223 + # Audio
224 + myconf="${myconf} $(use_enable alsa audio-alsa)"
225 + myconf="${myconf} $(use_enable jack audio-jack)"
226 + use pulseaudio || myconf="${myconf} --disable-audio-pulseoutput"
227 +
228 + use altivec || myconf="${myconf} --disable-altivec"
229 + myconf="${myconf} $(use_enable dvb)"
230 + myconf="${myconf} $(use_enable ieee1394 firewire)"
231 + myconf="${myconf} $(use_enable lirc)"
232 + myconf="${myconf} $(use_enable xvid libxvid)"
233 + myconf="${myconf} --dvb-path=/usr/include"
234 + myconf="${myconf} --enable-xrandr"
235 + myconf="${myconf} --enable-xv"
236 + myconf="${myconf} --enable-x11"
237 + myconf="${myconf} --enable-nonfree"
238 + myconf="${myconf} --enable-libmp3lame" # lame is not optional it is required for some broadcasts for silence detection of commercials
239 + use cec || myconf="${myconf} --disable-libcec"
240 + use zeroconf || myconf="${myconf} --disable-libdns-sd"
241 + myconf="${myconf} $(use_enable theora libtheora)"
242 + myconf="${myconf} $(use_enable vorbis libvorbis)"
243 +
244 + if use hls; then
245 + myconf="${myconf} --enable-libx264"
246 + myconf="${myconf} --enable-libvpx"
247 + fi
248 +
249 + myconf="${myconf} $(use_enable libass)"
250 +
251 + if use perl && use python; then
252 + myconf="${myconf} --with-bindings=perl,python"
253 + elif use perl; then
254 + myconf="${myconf} --without-bindings=python"
255 + myconf="${myconf} --with-bindings=perl"
256 + elif use python; then
257 + myconf="${myconf} --without-bindings=perl"
258 + myconf="${myconf} --with-bindings=python"
259 + else
260 + myconf="${myconf} --without-bindings=perl,python"
261 + fi
262 +
263 + use python && myconf="${myconf} --python=${EPYTHON}"
264 +
265 + if use debug; then
266 + myconf="${myconf} --compile-type=debug"
267 + else
268 + myconf="${myconf} --compile-type=release"
269 + #myconf="${myconf} --enable-debug" does nothing per sphery
270 + myconf="${myconf} --disable-stripping" # FIXME: does not disable for all files, only for some
271 + fi
272 +
273 + # Video
274 + myconf="${myconf} $(use_enable vdpau)"
275 + myconf="${myconf} $(use_enable vaapi)"
276 + myconf="${myconf} $(use_enable crystalhd)"
277 +
278 + # Input
279 + use input_devices_joystick || myconf="${myconf} --disable-joystick-menu"
280 +
281 + # Clean up DSO load times and other compiler bits
282 + myconf="${myconf} --enable-symbol-visibility"
283 + myconf="${myconf} --enable-pic"
284 +
285 + # CPU settings
286 + for i in $(get-flag march) $(get-flag mcpu) $(get-flag mtune) ; do
287 + [ "${i}" = "native" ] && i="host"
288 + myconf="${myconf} --cpu=${i}"
289 + break
290 + done
291 +
292 + if tc-is-cross-compiler ; then
293 + myconf="${myconf} --enable-cross-compile --arch=$(tc-arch-kernel)"
294 + myconf="${myconf} --cross-prefix=${CHOST}-"
295 + fi
296 +
297 + # Build boosters
298 + has distcc ${FEATURES} || myconf="${myconf} --disable-distcc"
299 + has ccache ${FEATURES} || myconf="${myconf} --disable-ccache"
300 +
301 + myconf="${myconf} $(use_enable systemd systemd_notify)"
302 + myconf="${myconf} $(use_enable systemd systemd_journal)"
303 + use systemd || myconf="${myconf} $(use_enable mythlogserver)"
304 +
305 + chmod +x ./external/FFmpeg/version.sh
306 +
307 + einfo "Running ./configure ${myconf}"
308 + ./configure \
309 + --cc="$(tc-getCC)" \
310 + --cxx="$(tc-getCXX)" \
311 + --ar="$(tc-getAR)" \
312 + --extra-cflags="${CFLAGS}" \
313 + --extra-cxxflags="${CXXFLAGS}" \
314 + --extra-ldflags="${LDFLAGS}" \
315 + --qmake=$(qt5_get_bindir)/qmake \
316 + ${myconf} || die "configure died"
317 +}
318 +
319 +src_install() {
320 + emake STRIP="true" INSTALL_ROOT="${D}" install
321 + dodoc AUTHORS UPGRADING README
322 + readme.gentoo_create_doc
323 +
324 + insinto /usr/share/mythtv/database
325 + doins database/*
326 +
327 + newinitd "${FILESDIR}"/mythbackend.init-r2 mythbackend
328 + newconfd "${FILESDIR}"/mythbackend.conf-r1 mythbackend
329 + systemd_newunit "${FILESDIR}"/mythbackend.service-28 mythbackend.service
330 +
331 + dodoc keys.txt
332 +
333 + keepdir /etc/mythtv
334 + chown -R mythtv "${ED}"/etc/mythtv
335 + keepdir /var/log/mythtv
336 + chown -R mythtv "${ED}"/var/log/mythtv
337 + dodir /var/log/mythtv/old
338 +
339 + insinto /etc/logrotate.d
340 + newins "${FILESDIR}"/mythtv.logrotate.d-r4 mythtv
341 +
342 + insinto /usr/share/mythtv/contrib
343 + # Ensure we don't install scripts needing the perl bindings (bug #516968)
344 + use perl || find contrib/ -name '*.pl' -exec rm -f {} \;
345 + # Ensure we don't install scripts needing the python bindings (bug #516968)
346 + use python || find contrib/ -name '*.py' -exec rm -f {} \;
347 + doins -r contrib/*
348 +
349 + # Install our mythfrontend wrapper which is similar to Mythbuntu's
350 + if use wrapper; then
351 + mv "${ED}/usr/bin/mythfrontend" "${ED}/usr/bin/mythfrontend.real"
352 + newbin "${FILESDIR}"/mythfrontend.wrapper mythfrontend
353 + newconfd "${FILESDIR}"/mythfrontend.conf mythfrontend
354 + fi
355 +
356 + if use autostart; then
357 + dodir /etc/env.d/
358 + echo 'CONFIG_PROTECT="/home/mythtv/"' > "${ED}"/etc/env.d/95mythtv
359 +
360 + insinto /home/mythtv
361 + newins "${FILESDIR}"/bash_profile .bash_profile
362 + newins "${FILESDIR}"/xinitrc-r1 .xinitrc
363 + fi
364 +
365 + # Make Python files executable
366 + find "${ED}/usr/share/mythtv" -type f -name '*.py' | while read file; do
367 + if [[ ! "${file##*/}" = "__init__.py" ]]; then
368 + chmod a+x "${file}"
369 + fi
370 + done
371 +
372 + # Ensure that Python scripts are executed by Python 2
373 + python_fix_shebang "${ED}/usr/share/mythtv"
374 +
375 + # Make shell & perl scripts executable
376 + find "${ED}" -type f -name '*.sh' -o -type f -name '*.pl' | \
377 + while read file; do
378 + chmod a+x "${file}"
379 + done
380 +
381 + # Remove empty dir
382 + rmdir "${ED}"/var/log/mythtv/old
383 +}
384 +
385 +pkg_preinst() {
386 + export CONFIG_PROTECT="${CONFIG_PROTECT} ${EROOT}/home/mythtv/"
387 +}
388 +
389 +pkg_postinst() {
390 + readme.gentoo_print_elog
391 +}
392 +
393 +pkg_info() {
394 + if [[ -f "${EROOT}"/usr/bin/mythfrontend ]]; then
395 + "${EROOT}"/usr/bin/mythfrontend --version
396 + fi
397 +}
398 +
399 +pkg_config() {
400 + echo "Creating mythtv MySQL user and mythconverg database if it does not"
401 + echo "already exist. You will be prompted for your MySQL root password."
402 + "${EROOT}"/usr/bin/mysql -u root -p < "${EROOT}"/usr/share/mythtv/database/mc.sql
403 +}