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

Contents of /eclass/mythtv-plugins.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations) (download)
Sat Feb 11 16:31:53 2006 UTC (8 years, 8 months ago) by caleb
Branch: MAIN
Changes since 1.9: +2 -2 lines
Ensure mythtv plugins all call the correct qmake

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/mythtv-plugins.eclass,v 1.9 2005/08/23 14:55:11 swegener Exp $
4 #
5 # Author: Doug Goldstein <cardoe@gentoo.org
6 #
7
8 inherit multilib
9
10 IUSE="debug 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 "Fixing QMake's CXXFLAGS failed"
28
29 sed -e "s!QMAKE_CFLAGS_RELEASE = \$\${QMAKE_CXXFLAGS_RELEASE}!QMAKE_CFLAGS_RELEASE = ${CFLAGS}!" \
30 -i 'settings.pro' || die "Fixing Qmake's CFLAGS failed"
31
32 find ${S} -name '*.pro' -exec sed -i \
33 -e "s:\$\${PREFIX}/lib/:\$\${PREFIX}/$(get_libdir)/:g" \
34 -e "s:\$\${PREFIX}/lib$:\$\${PREFIX}/$(get_libdir):g" \
35 {} \;
36 }
37
38 mythtv-plugins_src_compile() {
39 cd ${S}
40
41 if use debug; then
42 sed -e 's!CONFIG += release!CONFIG += debug!' \
43 -i 'settings.pro' || die "switching to debug build failed"
44 fi
45
46 # if ( use x86 && ! use mmx ) || ! use amd64 ; then
47 if ( ! use mmx ); then
48 sed -e 's!DEFINES += HAVE_MMX!DEFINES -= HAVE_MMX!' \
49 -i 'settings.pro' || die "disabling MMX failed"
50 fi
51
52 local myconf=""
53
54 if hasq ${PN} ${MYTHPLUGINS} ; then
55 for x in ${MYTHPLUGINS} ; do
56 if [[ ${PN} == ${x} ]] ; then
57 myconf="${myconf} --enable-${x}"
58 else
59 myconf="${myconf} --disable-${x}"
60 fi
61 done
62 else
63 die "Package ${PN} is unsupported"
64 fi
65
66 econf ${myconf} ${MTVCONF}
67
68 ${QTDIR}/bin/qmake QMAKE=${QTDIR}/bin/qmake -o "Makefile" mythplugins.pro || die "qmake failed to run"
69 emake || die "make failed to compile"
70 }
71
72 mythtv-plugins_src_install() {
73 if hasq ${PN} ${MYTHPLUGINS} ; then
74 cd ${S}/${PN}
75 else
76 die "Package ${PN} is unsupported"
77 fi
78
79 einstall INSTALL_ROOT="${D}"
80 for doc in AUTHORS COPYING FAQ UPGRADING ChangeLog README; do
81 test -e "${doc}" && dodoc ${doc}
82 done
83 }

  ViewVC Help
Powered by ViewVC 1.1.20