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

Contents of /eclass/mythtv-plugins.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Fri May 20 02:39:14 2005 UTC (9 years, 6 months ago) by cardoe
Branch: MAIN
new eclass cause the other one was the devil.

1 cardoe 1.1 # Copyright 1999-2004 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3     # $Header: /var/cvsroot/gentoo-x86/eclass/myth.eclass,v 1.11 2005/04/21 08:25:18 eradicator Exp $
4     #
5     # Author: Doug Goldstein <cardoe@gentoo.org
6     #
7    
8     ECLASS=mythtv-plugins
9     INHERITED="${INHERITED} ${ECLASS} debug"
10     IUSE="${IUSE} mmx"
11    
12     EXPORT_FUNCTIONS src_unpack src_compile src_install
13     MYTHPLUGINS="mythbrowser mythdvd mythgallery mythgame mythmusic mythnews mythphone mythvideo mythweather mythweb"
14     MTVCONF=""
15     S="${WORKDIR}/mythplugins-${PV}"
16    
17     DEPEND=">=sys-apps/sed-4"
18    
19     mythtv-plugins_src_unpack() {
20     unpack ${A}
21     cd ${S}
22    
23     sed -e 's!PREFIX = /usr/local!PREFIX = /usr!' \
24     -i 'settings.pro' || die "fixing PREFIX to /usr failed"
25    
26     sed -e "s!QMAKE_CXXFLAGS_RELEASE = -O3 -march=pentiumpro -fomit-frame-pointer!QMAKE_CXXFLAGS_RELEASE = ${CXXFLAGS}!" \
27     -i 'settings.pro' || die "ciarnam sucks"
28     #sed -e "/^QMAKE_CXXFLAGS_RELEASE/s!= .*!= ${CXXFLAGS}!" \
29     #-i 'settings.pro' || die "Fixing QMake's CXXFLAGS failed"
30    
31     sed -e "s!QMAKE_CFLAGS_RELEASE = \$\${QMAKE_CXXFLAGS_RELEASE}!QMAKE_CFLAGS_RELEASE = ${CFLAGS}!" \
32     -i 'settings.pro' || die "ciaranm sucks"
33     #sed -e "/^QMAKE_CFLAGS_RELEASE/s!= .*!= ${CFLAGS}!"
34     #-i 'settings.pro' || die "Fixing Qmake's CFLAGS failed"
35     }
36    
37     mythtv-plugins_src_compile() {
38     cd ${S}
39    
40     if use debug; then
41     sed -e 's!CONFIG += release!CONFIG += debug!' \
42     -i 'settings.pro' || die "switching to debug build failed"
43     fi
44    
45     if ( use x86 && ! use mmx ) || ! use amd64; then
46     sed -e 's!DEFINES += HAVE_MMX!DEFINES -= HAVE_MMX!' \
47     -i 'settings.pro' || die "disabling MMX failed"
48     fi
49    
50     local myconf=""
51    
52     if hasq ${PN} ${MYTHPLUGINS} ; then
53     for x in ${MYTHPLUGINS} ; do
54     if [[ ${PN} == ${x} ]] ; then
55     myconf="${myconf} --enable-${x}"
56     else
57     myconf="${myconf} --disable-${x}"
58     fi
59     done
60     else
61     die "Package ${PN} is unsupported"
62     fi
63    
64     econf ${myconf} ${MTVCONF}
65    
66     qmake -o "Makefile" mythplugins.pro || die "qmake failed to run"
67     emake || die "make failed to compile"
68     }
69    
70     mythtv-plugins_src_install() {
71     if hasq ${PN} ${MYTHPLUGINS} ; then
72     cd ${S}/${PN}
73     else
74     die "Package ${PN} is unsupported"
75     fi
76    
77     einstall INSTALL_ROOT="${D}"
78     for doc in AUTHORS COPYING FAQ UPGRADING ChangeLog README; do
79     test -e "${doc}" && dodoc ${doc}
80     done
81     }

  ViewVC Help
Powered by ViewVC 1.1.20