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