| 1 | # Copyright 2005 Gentoo Foundation |
1 | # Copyright 2005 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/Attic/qt4.eclass,v 1.32 2008/01/05 18:44:38 caleb Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/Attic/qt4.eclass,v 1.37 2008/03/05 23:03:24 ingmar Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: qt4.eclass |
5 | # @ECLASS: qt4.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # Caleb Tennis <caleb@gentoo.org> |
7 | # Caleb Tennis <caleb@gentoo.org> |
| 8 | # @BLURB: |
8 | # @BLURB: |
| … | |
… | |
| 16 | |
16 | |
| 17 | inherit eutils multilib toolchain-funcs versionator |
17 | inherit eutils multilib toolchain-funcs versionator |
| 18 | |
18 | |
| 19 | QTPKG="x11-libs/qt-" |
19 | QTPKG="x11-libs/qt-" |
| 20 | QT4MAJORVERSIONS="4.4 4.3 4.2 4.1 4.0" |
20 | QT4MAJORVERSIONS="4.4 4.3 4.2 4.1 4.0" |
| 21 | QT4VERSIONS="4.4.0_rc1 4.3.3 4.3.2-r1 4.3.2 4.3.1-r1 4.3.1 4.3.0-r2 4.3.0-r1 4.3.0 4.3.0_rc1 4.3.0_beta1 4.2.3-r1 4.2.3 4.2.2 4.2.1 4.2.0-r2 4.2.0-r1 4.2.0 4.1.4-r2 4.1.4-r1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.0.1 4.0.0" |
21 | QT4VERSIONS="4.4.0_beta1 4.4.0_rc1 4.3.4 4.3.3 4.3.2-r1 4.3.2 4.3.1-r1 4.3.1 4.3.0-r2 4.3.0-r1 4.3.0 4.3.0_rc1 4.3.0_beta1 4.2.3-r1 4.2.3 4.2.2 4.2.1 4.2.0-r2 4.2.0-r1 4.2.0 4.1.4-r2 4.1.4-r1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.0.1 4.0.0" |
| 22 | |
22 | |
| 23 | # @FUNCTION: qt4_min_version |
23 | # @FUNCTION: qt4_min_version |
| 24 | # @USAGE: [minimum version] |
24 | # @USAGE: [minimum version] |
| 25 | # @DESCRIPTION: |
25 | # @DESCRIPTION: |
| 26 | # This function should be called in package DEPENDs whenever it depends on qt4. |
26 | # This function should be called in package DEPENDs whenever it depends on qt4. |
| 27 | # Simple example - in your depend, do something like this: |
27 | # Simple example - in your depend, do something like this: |
| 28 | # DEPEND="$(qt4_min_version 4.2)" |
28 | # DEPEND="$(qt4_min_version 4.2)" |
| 29 | # if package can be build with qt-4.2 or higher. |
29 | # if the package can be build with qt-4.2 or higher. |
|
|
30 | # |
|
|
31 | # For builds that use an EAPI with support for SLOT dependencies, this will |
|
|
32 | # return a SLOT dependency, rather than a list of versions. |
| 30 | qt4_min_version() { |
33 | qt4_min_version() { |
| 31 | # This is much simpler for EAPI 1, we can use a slot dependency |
34 | case ${EAPI:-0} in |
| 32 | if [[ "${EAPI}" -ge 1 ]]; then |
35 | # EAPIs without SLOT dependencies |
| 33 | echo ">=${QTPKG}${1}:4" |
|
|
| 34 | else |
|
|
| 35 | echo "|| (" |
36 | 0) echo "|| (" |
| 36 | qt4_min_version_list "$@" |
37 | qt4_min_version_list "$@" |
| 37 | echo ")" |
38 | echo ")" |
| 38 | fi |
39 | ;; |
|
|
40 | # EAPIS with SLOT dependencies. |
|
|
41 | *) echo ">=${QTPKG}${1}:4" |
|
|
42 | ;; |
|
|
43 | esac |
| 39 | } |
44 | } |
| 40 | |
45 | |
| 41 | qt4_min_version_list() { |
46 | qt4_min_version_list() { |
| 42 | local MINVER="$1" |
47 | local MINVER="$1" |
| 43 | local VERSIONS="" |
48 | local VERSIONS="" |
| … | |
… | |
| 102 | die "Install x11-libs/qt-${x}" |
107 | die "Install x11-libs/qt-${x}" |
| 103 | fi |
108 | fi |
| 104 | elif [[ ${x} == ssl ]]; then |
109 | elif [[ ${x} == ssl ]]; then |
| 105 | if ! has_version x11-libs/qt-core || ! built_with_use x11-libs/qt-core ssl; then |
110 | if ! has_version x11-libs/qt-core || ! built_with_use x11-libs/qt-core ssl; then |
| 106 | eerror "You must first install the x11-libs/qt-core package with the ssl flag enabled." |
111 | eerror "You must first install the x11-libs/qt-core package with the ssl flag enabled." |
| 107 | die "Install x1-libs/qt-core with USE=\"ssl\"" |
112 | die "Install x11-libs/qt-core with USE=\"ssl\"" |
| 108 | fi |
113 | fi |
| 109 | elif [[ ${x} == sqlite3 ]]; then |
114 | elif [[ ${x} == sqlite3 ]]; then |
| 110 | if ! has_version x11-libs/qt-sql || ! built_with_use x11-libs/qt-sql sqlite; then |
115 | if ! has_version x11-libs/qt-sql || ! built_with_use x11-libs/qt-sql sqlite; then |
| 111 | eerror "You must first install the x11-libs/qt-sql package with the sqlite flag enabled." |
116 | eerror "You must first install the x11-libs/qt-sql package with the sqlite flag enabled." |
| 112 | die "Install x11-libs/qt-sql with USE="\sqlite\"" |
117 | die "Install x11-libs/qt-sql with USE=\"sqlite\"" |
| 113 | fi |
118 | fi |
| 114 | fi |
119 | fi |
| 115 | elif ! built_with_use =x11-libs/qt-4* ${x}; then |
120 | elif ! built_with_use =x11-libs/qt-4* ${x}; then |
| 116 | requiredflags="${requiredflags} ${x}" |
121 | requiredflags="${requiredflags} ${x}" |
| 117 | fi |
122 | fi |
| … | |
… | |
| 199 | QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS}" \ |
204 | QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS}" \ |
| 200 | QMAKE_CXXFLAGS_DEBUG="${CXXFLAGS}" \ |
205 | QMAKE_CXXFLAGS_DEBUG="${CXXFLAGS}" \ |
| 201 | QMAKE_LFLAGS_RELEASE="${LDFLAGS}" \ |
206 | QMAKE_LFLAGS_RELEASE="${LDFLAGS}" \ |
| 202 | QMAKE_LFLAGS_DEBUG="${LDFLAGS}" \ |
207 | QMAKE_LFLAGS_DEBUG="${LDFLAGS}" \ |
| 203 | QMAKE_RPATH= \ |
208 | QMAKE_RPATH= \ |
| 204 | ${@} >> ${LOGFILE} 2>&1 |
209 | "${@}" >> ${LOGFILE} 2>&1 |
| 205 | |
210 | |
| 206 | local result=$? |
211 | local result=$? |
| 207 | eend ${result} |
212 | eend ${result} |
| 208 | |
213 | |
| 209 | # was qmake successful? |
214 | # was qmake successful? |