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

Contents of /eclass/mythtv-plugins.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Fri May 27 23:24:09 2005 UTC (9 years, 3 months ago) by eradicator
Branch: MAIN
Changes since 1.1: +8 -1 lines
Multilib fixes.

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

  ViewVC Help
Powered by ViewVC 1.1.20