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