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

Contents of /eclass/mythtv-plugins.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Wed Jun 8 23:17:05 2005 UTC (9 years, 1 month ago) by cardoe
Branch: MAIN
Changes since 1.2: +5 -8 lines
AMD64 mmx fix

1 cardoe 1.1 # Copyright 1999-2004 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 cardoe 1.3 # $Header: /var/cvsroot/gentoo-x86/eclass/mythtv-plugins.eclass,v 1.2 2005/05/27 23:24:09 eradicator 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 cardoe 1.3 -i 'settings.pro' || die "Fixing QMake's CXXFLAGS failed"
30 cardoe 1.1
31     sed -e "s!QMAKE_CFLAGS_RELEASE = \$\${QMAKE_CXXFLAGS_RELEASE}!QMAKE_CFLAGS_RELEASE = ${CFLAGS}!" \
32 cardoe 1.3 -i 'settings.pro' || die "Fixing Qmake's CFLAGS failed"
33 eradicator 1.2
34     find ${S} -name '*.pro' -exec sed -i \
35     -e "s:\$\${PREFIX}/lib/:\$\${PREFIX}/$(get_libdir)/:g" \
36     -e "s:\$\${PREFIX}/lib$:\$\${PREFIX}/$(get_libdir):g" \
37     {} \;
38 cardoe 1.1 }
39    
40     mythtv-plugins_src_compile() {
41     cd ${S}
42    
43     if use debug; then
44     sed -e 's!CONFIG += release!CONFIG += debug!' \
45     -i 'settings.pro' || die "switching to debug build failed"
46     fi
47    
48 cardoe 1.3 # if ( use x86 && ! use mmx ) || ! use amd64 ; then
49     if ( ! use mmx ); then
50 cardoe 1.1 sed -e 's!DEFINES += HAVE_MMX!DEFINES -= HAVE_MMX!' \
51     -i 'settings.pro' || die "disabling MMX failed"
52     fi
53    
54     local myconf=""
55    
56     if hasq ${PN} ${MYTHPLUGINS} ; then
57     for x in ${MYTHPLUGINS} ; do
58     if [[ ${PN} == ${x} ]] ; then
59     myconf="${myconf} --enable-${x}"
60     else
61     myconf="${myconf} --disable-${x}"
62     fi
63     done
64     else
65     die "Package ${PN} is unsupported"
66     fi
67    
68     econf ${myconf} ${MTVCONF}
69    
70     qmake -o "Makefile" mythplugins.pro || die "qmake failed to run"
71     emake || die "make failed to compile"
72     }
73    
74     mythtv-plugins_src_install() {
75     if hasq ${PN} ${MYTHPLUGINS} ; then
76     cd ${S}/${PN}
77     else
78     die "Package ${PN} is unsupported"
79     fi
80    
81     einstall INSTALL_ROOT="${D}"
82     for doc in AUTHORS COPYING FAQ UPGRADING ChangeLog README; do
83     test -e "${doc}" && dodoc ${doc}
84     done
85     }

  ViewVC Help
Powered by ViewVC 1.1.20