| 1 | # Copyright 1999-2006 Gentoo Foundation |
1 | # Copyright 1999-2011 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/mythtv-plugins.eclass,v 1.15 2006/09/14 07:10:35 cardoe Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/mythtv-plugins.eclass,v 1.40 2011/08/22 04:46:32 vapier Exp $ |
| 4 | # |
4 | |
|
|
5 | # @ECLASS: mythtv-plugins.eclass |
|
|
6 | # @MAINTAINER: |
| 5 | # Author: Doug Goldstein <cardoe@gentoo.org> |
7 | # Doug Goldstein <cardoe@gentoo.org> |
| 6 | # |
8 | # @AUTHOR: |
|
|
9 | # Doug Goldstein <cardoe@gentoo.org> |
| 7 | # Installs MythTV plugins along with patches from the release-${PV}-fixes branch |
10 | # @BLURB: Installs MythTV plugins along with patches from the release-${PV}-fixes branch |
| 8 | # |
11 | |
|
|
12 | # NOTE: YOU MUST INHERIT EITHER qt3 or qt4 IN YOUR PLUGIN! |
|
|
13 | |
| 9 | inherit eutils multilib qt3 versionator |
14 | inherit mythtv multilib versionator |
| 10 | |
15 | |
| 11 | # Extra configure options to pass to econf |
16 | # Extra configure options to pass to econf |
| 12 | MTVCONF=${MTVCONF:=""} |
17 | MTVCONF=${MTVCONF:=""} |
| 13 | |
18 | |
| 14 | # Release version |
|
|
| 15 | MY_PV="${PV%_*}" |
|
|
| 16 | |
|
|
| 17 | # SVN revision number to increment from the released version |
|
|
| 18 | if [ "x${MY_PV}" != "x${PV}" ]; then |
|
|
| 19 | PATCHREV="${PV##*_p}" |
|
|
| 20 | fi |
|
|
| 21 | |
|
|
| 22 | DESCRIPTION=${DESCRIPTION:="MythTV plugin"} |
|
|
| 23 | HOMEPAGE="http://www.mythtv.org" |
|
|
| 24 | SRC_URI="http://ftp.osuosl.org/pub/mythtv/mythplugins-${MY_PV}.tar.bz2" |
|
|
| 25 | if [ -n "${PATCHREV}" ] ; then |
|
|
| 26 | SRC_URI="${SRC_URI} http://dev.gentoo.org/~cardoe/files/mythtv/mythplugins-${MY_PV}_svn${PATCHREV}.patch.bz2" |
|
|
| 27 | fi |
|
|
| 28 | |
|
|
| 29 | |
|
|
| 30 | LICENSE="GPL-2" |
|
|
| 31 | SLOT="0" |
19 | SLOT="0" |
| 32 | IUSE="${IUSE} debug mmx" |
20 | IUSE="${IUSE} debug mmx" |
| 33 | |
21 | |
|
|
22 | if [[ -z $MYTHTV_NODEPS ]] ; then |
| 34 | RDEPEND="${RDEPEND} |
23 | RDEPEND="${RDEPEND} |
| 35 | =media-tv/mythtv-${MY_PV}*" |
24 | =media-tv/mythtv-${MY_PV}*" |
| 36 | DEPEND="${DEPEND} |
25 | DEPEND="${DEPEND} |
| 37 | =media-tv/mythtv-${MY_PV}* |
26 | =media-tv/mythtv-${MY_PV}* |
| 38 | >=sys-apps/sed-4" |
27 | >=sys-apps/sed-4" |
|
|
28 | fi |
| 39 | |
29 | |
| 40 | S="${WORKDIR}/mythplugins-${MY_PV}" |
30 | # bug 240325 |
|
|
31 | RESTRICT="strip" |
| 41 | |
32 | |
| 42 | mythtv-plugins_pkg_setup() { |
33 | mythtv-plugins_pkg_setup() { |
| 43 | # List of available plugins (needs to include ALL of them in the tarball) |
34 | # List of available plugins (needs to include ALL of them in the tarball) |
| 44 | MYTHPLUGINS="mythbrowser mythcontrols mythdvd mythflix mythgallery" |
35 | MYTHPLUGINS="mythbrowser mythcontrols mythdvd mythflix mythgallery" |
| 45 | MYTHPLUGINS="${MYTHPLUGINS} mythgame mythmusic mythnews mythphone" |
36 | MYTHPLUGINS="${MYTHPLUGINS} mythgame mythmusic mythnews mythphone" |
| 46 | MYTHPLUGINS="${MYTHPLUGINS} mythvideo mythweather mythweb" |
37 | MYTHPLUGINS="${MYTHPLUGINS} mythvideo mythweather mythweb" |
| 47 | |
38 | |
| 48 | if version_is_at_least "0.20" ; then |
39 | if version_is_at_least "0.20" ; then |
| 49 | MYTHPLUGINS="${MYTHPLUGINS} mytharchive" |
40 | MYTHPLUGINS="${MYTHPLUGINS} mytharchive" |
| 50 | fi |
41 | fi |
|
|
42 | |
|
|
43 | if version_is_at_least "0.21_beta" ; then |
|
|
44 | MYTHPLUGINS="${MYTHPLUGINS} mythzoneminder mythmovies" |
|
|
45 | MYTHPLUGINS="${MYTHPLUGINS/mythdvd/}" |
|
|
46 | fi |
|
|
47 | |
|
|
48 | if version_is_at_least "0.22_beta" ; then |
|
|
49 | MYTHPLUGINS="${MYTHPLUGINS/mythcontrols/}" |
|
|
50 | MYTHPLUGINS="${MYTHPLUGINS/mythphone/}" |
|
|
51 | fi |
|
|
52 | |
|
|
53 | if version_is_at_least "0.23_beta" ; then |
|
|
54 | MYTHPLUGINS="${MYTHPLUGINS/mythflix/}" |
|
|
55 | MYTHPLUGINS="${MYTHPLUGINS} mythnetvision" |
|
|
56 | fi |
| 51 | } |
57 | } |
| 52 | |
58 | |
| 53 | mythtv-plugins_src_unpack() { |
59 | mythtv-plugins_src_prepare() { |
| 54 | unpack ${A} |
|
|
| 55 | cd "${S}" |
|
|
| 56 | |
|
|
| 57 | sed -e 's!PREFIX = /usr/local!PREFIX = /usr!' \ |
60 | sed -e 's!PREFIX = /usr/local!PREFIX = /usr!' \ |
| 58 | -i 'settings.pro' || die "fixing PREFIX to /usr failed" |
61 | -i 'settings.pro' || die "fixing PREFIX to /usr failed" |
| 59 | |
62 | |
| 60 | sed -e "s!QMAKE_CXXFLAGS_RELEASE = -O3 -march=pentiumpro -fomit-frame-pointer!QMAKE_CXXFLAGS_RELEASE = ${CXXFLAGS}!" \ |
63 | sed -e "s!QMAKE_CXXFLAGS_RELEASE = -O3 -march=pentiumpro -fomit-frame-pointer!QMAKE_CXXFLAGS_RELEASE = ${CXXFLAGS}!" \ |
| 61 | -i 'settings.pro' || die "Fixing QMake's CXXFLAGS failed" |
64 | -i 'settings.pro' || die "Fixing QMake's CXXFLAGS failed" |
| … | |
… | |
| 65 | |
68 | |
| 66 | find "${S}" -name '*.pro' -exec sed -i \ |
69 | find "${S}" -name '*.pro' -exec sed -i \ |
| 67 | -e "s:\$\${PREFIX}/lib/:\$\${PREFIX}/$(get_libdir)/:g" \ |
70 | -e "s:\$\${PREFIX}/lib/:\$\${PREFIX}/$(get_libdir)/:g" \ |
| 68 | -e "s:\$\${PREFIX}/lib$:\$\${PREFIX}/$(get_libdir):g" \ |
71 | -e "s:\$\${PREFIX}/lib$:\$\${PREFIX}/$(get_libdir):g" \ |
| 69 | {} \; |
72 | {} \; |
| 70 | |
|
|
| 71 | if [ -n "$PATCHREV" ]; then |
|
|
| 72 | patch -p0 < ${WORKDIR}/mythplugins-${MY_PV}_svn${PATCHREV}.patch |
|
|
| 73 | fi |
|
|
| 74 | } |
73 | } |
| 75 | |
74 | |
| 76 | mythtv-plugins_src_compile() { |
75 | mythtv-plugins_src_configure() { |
| 77 | cd "${S}" |
76 | cd "${S}" |
| 78 | |
77 | |
| 79 | if use debug; then |
78 | if use debug; then |
| 80 | sed -e 's!CONFIG += release!CONFIG += debug!' \ |
79 | sed -e 's!CONFIG += release!CONFIG += debug!' \ |
| 81 | -i 'settings.pro' || die "switching to debug build failed" |
80 | -i 'settings.pro' || die "switching to debug build failed" |
| … | |
… | |
| 87 | -i 'settings.pro' || die "disabling MMX failed" |
86 | -i 'settings.pro' || die "disabling MMX failed" |
| 88 | fi |
87 | fi |
| 89 | |
88 | |
| 90 | local myconf="" |
89 | local myconf="" |
| 91 | |
90 | |
| 92 | if hasq ${PN} ${MYTHPLUGINS} ; then |
91 | if has ${PN} ${MYTHPLUGINS} ; then |
| 93 | for x in ${MYTHPLUGINS} ; do |
92 | for x in ${MYTHPLUGINS} ; do |
| 94 | if [[ ${PN} == ${x} ]] ; then |
93 | if [[ ${PN} == ${x} ]] ; then |
| 95 | myconf="${myconf} --enable-${x}" |
94 | myconf="${myconf} --enable-${x}" |
| 96 | else |
95 | else |
| 97 | myconf="${myconf} --disable-${x}" |
96 | myconf="${myconf} --disable-${x}" |
| … | |
… | |
| 99 | done |
98 | done |
| 100 | else |
99 | else |
| 101 | die "Package ${PN} is unsupported" |
100 | die "Package ${PN} is unsupported" |
| 102 | fi |
101 | fi |
| 103 | |
102 | |
|
|
103 | chmod +x configure |
| 104 | econf ${myconf} ${MTVCONF} |
104 | econf ${myconf} ${MTVCONF} |
|
|
105 | } |
| 105 | |
106 | |
| 106 | ${QTDIR}/bin/qmake QMAKE="${QTDIR}/bin/qmake" -o "Makefile" mythplugins.pro || die "qmake failed to run" |
107 | 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 |
| 107 | emake || die "make failed to compile" |
113 | emake || die "make failed to compile" |
| 108 | } |
114 | } |
| 109 | |
115 | |
| 110 | mythtv-plugins_src_install() { |
116 | mythtv-plugins_src_install() { |
| 111 | debug-print ${MYTHPLUGINS} |
|
|
| 112 | if hasq ${PN} ${MYTHPLUGINS} ; then |
117 | if has ${PN} ${MYTHPLUGINS} ; then |
| 113 | cd "${S}"/${PN} |
118 | cd "${S}"/${PN} |
| 114 | else |
119 | else |
| 115 | die "Package ${PN} is unsupported" |
120 | die "Package ${PN} is unsupported" |
| 116 | fi |
121 | fi |
| 117 | |
122 | |
| … | |
… | |
| 119 | for doc in AUTHORS COPYING FAQ UPGRADING ChangeLog README; do |
124 | for doc in AUTHORS COPYING FAQ UPGRADING ChangeLog README; do |
| 120 | test -e "${doc}" && dodoc ${doc} |
125 | test -e "${doc}" && dodoc ${doc} |
| 121 | done |
126 | done |
| 122 | } |
127 | } |
| 123 | |
128 | |
| 124 | EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install |
129 | EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_compile src_install |