1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 # @ECLASS: mythtv-plugins.eclass
7 # Doug Goldstein <cardoe@gentoo.org>
9 # Doug Goldstein <cardoe@gentoo.org>
10 # @BLURB: Installs MythTV plugins along with patches from the release-${PV}-fixes branch
12 # NOTE: YOU MUST INHERIT EITHER qt3 or qt4 IN YOUR PLUGIN!
14 inherit mythtv multilib versionator
16 # Extra configure options to pass to econf
17 MTVCONF=${MTVCONF:=""}
20 IUSE="${IUSE} debug mmx"
22 if [[ -z $MYTHTV_NODEPS ]] ; then
24 =media-tv/mythtv-${MY_PV}*"
26 =media-tv/mythtv-${MY_PV}*
33 mythtv-plugins_pkg_setup() {
34 # List of available plugins (needs to include ALL of them in the tarball)
35 MYTHPLUGINS="mythbrowser mythcontrols mythdvd mythflix mythgallery"
36 MYTHPLUGINS="${MYTHPLUGINS} mythgame mythmusic mythnews mythphone"
37 MYTHPLUGINS="${MYTHPLUGINS} mythvideo mythweather mythweb"
39 if version_is_at_least "0.20" ; then
40 MYTHPLUGINS="${MYTHPLUGINS} mytharchive"
43 if version_is_at_least "0.21_beta" ; then
44 MYTHPLUGINS="${MYTHPLUGINS} mythzoneminder mythmovies"
45 MYTHPLUGINS="${MYTHPLUGINS/mythdvd/}"
48 if version_is_at_least "0.22_beta" ; then
49 MYTHPLUGINS="${MYTHPLUGINS/mythcontrols/}"
50 MYTHPLUGINS="${MYTHPLUGINS/mythphone/}"
53 if version_is_at_least "0.23_beta" ; then
54 MYTHPLUGINS="${MYTHPLUGINS/mythflix/}"
55 MYTHPLUGINS="${MYTHPLUGINS} mythnetvision"
59 mythtv-plugins_src_prepare() {
60 sed -e 's!PREFIX = /usr/local!PREFIX = /usr!' \
61 -i 'settings.pro' || die "fixing PREFIX to /usr failed"
63 sed -e "s!QMAKE_CXXFLAGS_RELEASE = -O3 -march=pentiumpro -fomit-frame-pointer!QMAKE_CXXFLAGS_RELEASE = ${CXXFLAGS}!" \
64 -i 'settings.pro' || die "Fixing QMake's CXXFLAGS failed"
66 sed -e "s!QMAKE_CFLAGS_RELEASE = \$\${QMAKE_CXXFLAGS_RELEASE}!QMAKE_CFLAGS_RELEASE = ${CFLAGS}!" \
67 -i 'settings.pro' || die "Fixing Qmake's CFLAGS failed"
69 find "${S}" -name '*.pro' -exec sed -i \
70 -e "s:\$\${PREFIX}/lib/:\$\${PREFIX}/$(get_libdir)/:g" \
71 -e "s:\$\${PREFIX}/lib$:\$\${PREFIX}/$(get_libdir):g" \
75 mythtv-plugins_src_configure() {
79 sed -e 's!CONFIG += release!CONFIG += debug!' \
80 -i 'settings.pro' || die "switching to debug build failed"
83 # if ( use x86 && ! use mmx ) || ! use amd64 ; then
84 if ( ! use mmx ); then
85 sed -e 's!DEFINES += HAVE_MMX!DEFINES -= HAVE_MMX!' \
86 -i 'settings.pro' || die "disabling MMX failed"
91 if has ${PN} ${MYTHPLUGINS} ; then
92 for x in ${MYTHPLUGINS} ; do
93 if [[ ${PN} == ${x} ]] ; then
94 myconf="${myconf} --enable-${x}"
96 myconf="${myconf} --disable-${x}"
100 die "Package ${PN} is unsupported"
104 econf ${myconf} ${MTVCONF}
107 mythtv-plugins_src_compile() {
108 if version_is_at_least "0.22" ; then
109 eqmake4 mythplugins.pro || die "eqmake4 failed"
111 eqmake3 mythplugins.pro || die "eqmake3 failed"
113 emake || die "make failed to compile"
116 mythtv-plugins_src_install() {
117 if has ${PN} ${MYTHPLUGINS} ; then
120 die "Package ${PN} is unsupported"
123 einstall INSTALL_ROOT="${D}"
124 for doc in AUTHORS COPYING FAQ UPGRADING ChangeLog README; do
125 test -e "${doc}" && dodoc ${doc}
129 EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_compile src_install