/[gentoo-x86]/eclass/mythtv-plugins.eclass
Gentoo

Contents of /eclass/mythtv-plugins.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.40 - (hide annotations) (download)
Mon Aug 22 04:46:32 2011 UTC (3 years, 4 months ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.39: +7 -6 lines
fix random bugs in eclass documentation, and convert to new @AUTHOR tag

1 vapier 1.40 # Copyright 1999-2011 Gentoo Foundation
2 cardoe 1.1 # Distributed under the terms of the GNU General Public License v2
3 vapier 1.40 # $Header: /var/cvsroot/gentoo-x86/eclass/mythtv-plugins.eclass,v 1.39 2011/07/08 11:35:01 ssuominen Exp $
4    
5 cardoe 1.35 # @ECLASS: mythtv-plugins.eclass
6 vapier 1.40 # @MAINTAINER:
7     # Doug Goldstein <cardoe@gentoo.org>
8     # @AUTHOR:
9     # Doug Goldstein <cardoe@gentoo.org>
10 cardoe 1.35 # @BLURB: Installs MythTV plugins along with patches from the release-${PV}-fixes branch
11    
12     # NOTE: YOU MUST INHERIT EITHER qt3 or qt4 IN YOUR PLUGIN!
13    
14     inherit mythtv multilib versionator
15 cardoe 1.13
16     # Extra configure options to pass to econf
17     MTVCONF=${MTVCONF:=""}
18    
19     SLOT="0"
20 cardoe 1.14 IUSE="${IUSE} debug mmx"
21 cardoe 1.1
22 gentoofan23 1.34 if [[ -z $MYTHTV_NODEPS ]] ; then
23 swegener 1.19 RDEPEND="${RDEPEND}
24 cardoe 1.13 =media-tv/mythtv-${MY_PV}*"
25     DEPEND="${DEPEND}
26     =media-tv/mythtv-${MY_PV}*
27     >=sys-apps/sed-4"
28 gentoofan23 1.34 fi
29 cardoe 1.13
30 beandog 1.33 # bug 240325
31     RESTRICT="strip"
32    
33 cardoe 1.13 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"
38    
39     if version_is_at_least "0.20" ; then
40     MYTHPLUGINS="${MYTHPLUGINS} mytharchive"
41     fi
42 cardoe 1.20
43 cardoe 1.30 if version_is_at_least "0.21_beta" ; then
44 cardoe 1.31 MYTHPLUGINS="${MYTHPLUGINS} mythzoneminder mythmovies"
45 cardoe 1.24 MYTHPLUGINS="${MYTHPLUGINS/mythdvd/}"
46 cardoe 1.20 fi
47 cardoe 1.36
48     if version_is_at_least "0.22_beta" ; then
49     MYTHPLUGINS="${MYTHPLUGINS/mythcontrols/}"
50     MYTHPLUGINS="${MYTHPLUGINS/mythphone/}"
51     fi
52 cardoe 1.37
53 cardoe 1.38 if version_is_at_least "0.23_beta" ; then
54 cardoe 1.37 MYTHPLUGINS="${MYTHPLUGINS/mythflix/}"
55     MYTHPLUGINS="${MYTHPLUGINS} mythnetvision"
56     fi
57 cardoe 1.13 }
58 cardoe 1.1
59 cardoe 1.35 mythtv-plugins_src_prepare() {
60 cardoe 1.1 sed -e 's!PREFIX = /usr/local!PREFIX = /usr!' \
61     -i 'settings.pro' || die "fixing PREFIX to /usr failed"
62 swegener 1.8
63 cardoe 1.1 sed -e "s!QMAKE_CXXFLAGS_RELEASE = -O3 -march=pentiumpro -fomit-frame-pointer!QMAKE_CXXFLAGS_RELEASE = ${CXXFLAGS}!" \
64 cardoe 1.3 -i 'settings.pro' || die "Fixing QMake's CXXFLAGS failed"
65 swegener 1.8
66 cardoe 1.1 sed -e "s!QMAKE_CFLAGS_RELEASE = \$\${QMAKE_CXXFLAGS_RELEASE}!QMAKE_CFLAGS_RELEASE = ${CFLAGS}!" \
67 cardoe 1.3 -i 'settings.pro' || die "Fixing Qmake's CFLAGS failed"
68 eradicator 1.2
69 cardoe 1.13 find "${S}" -name '*.pro' -exec sed -i \
70 eradicator 1.2 -e "s:\$\${PREFIX}/lib/:\$\${PREFIX}/$(get_libdir)/:g" \
71     -e "s:\$\${PREFIX}/lib$:\$\${PREFIX}/$(get_libdir):g" \
72     {} \;
73 cardoe 1.1 }
74    
75 cardoe 1.35 mythtv-plugins_src_configure() {
76 cardoe 1.13 cd "${S}"
77 swegener 1.8
78 cardoe 1.1 if use debug; then
79     sed -e 's!CONFIG += release!CONFIG += debug!' \
80     -i 'settings.pro' || die "switching to debug build failed"
81     fi
82 swegener 1.8
83 cardoe 1.3 # if ( use x86 && ! use mmx ) || ! use amd64 ; then
84     if ( ! use mmx ); then
85 cardoe 1.1 sed -e 's!DEFINES += HAVE_MMX!DEFINES -= HAVE_MMX!' \
86     -i 'settings.pro' || die "disabling MMX failed"
87     fi
88    
89     local myconf=""
90    
91 ssuominen 1.39 if has ${PN} ${MYTHPLUGINS} ; then
92 cardoe 1.1 for x in ${MYTHPLUGINS} ; do
93     if [[ ${PN} == ${x} ]] ; then
94     myconf="${myconf} --enable-${x}"
95     else
96     myconf="${myconf} --disable-${x}"
97     fi
98     done
99     else
100     die "Package ${PN} is unsupported"
101     fi
102    
103 cardoe 1.35 chmod +x configure
104 cardoe 1.1 econf ${myconf} ${MTVCONF}
105 cardoe 1.35 }
106 cardoe 1.1
107 cardoe 1.35 mythtv-plugins_src_compile() {
108     if version_is_at_least "0.22" ; then
109     eqmake4 mythplugins.pro || die "eqmake4 failed"
110     else
111     eqmake3 mythplugins.pro || die "eqmake3 failed"
112     fi
113 cardoe 1.1 emake || die "make failed to compile"
114     }
115    
116     mythtv-plugins_src_install() {
117 ssuominen 1.39 if has ${PN} ${MYTHPLUGINS} ; then
118 cardoe 1.13 cd "${S}"/${PN}
119 cardoe 1.1 else
120     die "Package ${PN} is unsupported"
121     fi
122    
123     einstall INSTALL_ROOT="${D}"
124     for doc in AUTHORS COPYING FAQ UPGRADING ChangeLog README; do
125     test -e "${doc}" && dodoc ${doc}
126     done
127     }
128 cardoe 1.13
129 cardoe 1.35 EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_compile src_install

  ViewVC Help
Powered by ViewVC 1.1.20