/[gentoo-x86]/eclass/qt4.eclass
Gentoo

Contents of /eclass/qt4.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.20 - (show annotations) (download)
Tue Jul 31 13:39:50 2007 UTC (7 years, 2 months ago) by caleb
Branch: MAIN
Changes since 1.19: +67 -6 lines
Adding eqmake from bug #120116

1 # Copyright 2005 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/qt4.eclass,v 1.19 2007/07/17 11:59:18 swegener Exp $
4 #
5 # Author Caleb Tennis <caleb@gentoo.org>
6 #
7 # This eclass is simple. Inherit it, and in your depend, do something like this:
8 #
9 # DEPEND="$(qt4_min_version 4)"
10 #
11 # and it handles the rest for you
12 #
13 # 08.16.06 - Renamed qt_min_* to qt4_min_* to avoid conflicts with the qt3 eclass.
14 # - Caleb Tennis <caleb@gentoo.org>
15
16 inherit eutils multilib toolchain-funcs versionator
17
18 QTPKG="x11-libs/qt-"
19 QT4MAJORVERSIONS="4.3 4.2 4.1 4.0"
20 QT4VERSIONS="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
22 qt4_min_version() {
23 echo "|| ("
24 qt4_min_version_list "$@"
25 echo ")"
26 }
27
28 qt4_min_version_list() {
29 local MINVER="$1"
30 local VERSIONS=""
31
32 case "${MINVER}" in
33 4|4.0|4.0.0) VERSIONS="=${QTPKG}4*";;
34 4.1|4.1.0|4.2|4.2.0)
35 for x in ${QT4MAJORVERSIONS}; do
36 if $(version_is_at_least "${MINVER}" "${x}"); then
37 VERSIONS="${VERSIONS} =${QTPKG}${x}*"
38 fi
39 done
40 ;;
41 4*)
42 for x in ${QT4VERSIONS}; do
43 if $(version_is_at_least "${MINVER}" "${x}"); then
44 VERSIONS="${VERSIONS} =${QTPKG}${x}"
45 fi
46 done
47 ;;
48 *) VERSIONS="=${QTPKG}4*";;
49 esac
50
51 echo "${VERSIONS}"
52 }
53
54 qt4_pkg_setup() {
55 for x in ${QT4_BUILT_WITH_USE_CHECK}; do
56 if ! built_with_use =x11-libs/qt-4* $x; then
57 die "This package requires Qt4 to be built with the '${x}' use flag."
58 fi
59 done
60 }
61
62 eqmake4() {
63 local LOGFILE="${T}/qmake-$$.out"
64 local projprofile="${1}"
65 [ -z ${projprofile} ] && projprofile="${PN}.pro"
66 shift 1
67
68 ebegin "Processing qmake ${projprofile}"
69
70 # file exists?
71 if [ ! -f ${projprofile} ]; then
72 echo
73 eerror "Project .pro file \"${projprofile}\" does not exists"
74 eerror "qmake cannot handle non-existing .pro files"
75 echo
76 eerror "This shouldn't happen - please send a bug report to bugs.gentoo.org"
77 echo
78 die "Project file not found in ${PN} sources"
79 fi
80
81 echo >> ${LOGFILE}
82 echo "****** qmake ${projprofile} ******" >> ${LOGFILE}
83 echo >> ${LOGFILE}
84
85 # as a workaround for broken qmake, put everything into file
86 if use debug; then
87 echo -e "$CONFIG -= release\nCONFIG += no_fixpath debug" >> ${projprofile}
88 else
89 echo -e "$CONFIG -= debug\nCONFIG += no_fixpath release" >> ${projprofile}
90 fi
91
92 /usr/bin/qmake ${projprofile} \
93 QTDIR=/usr/$(get_libdir) \
94 QMAKE=/usr/bin/qmake \
95 QMAKE_CC=$(tc-getCC) \
96 QMAKE_CXX=$(tc-getCXX) \
97 QMAKE_LINK=$(tc-getCXX) \
98 QMAKE_CFLAGS_RELEASE="${CFLAGS}" \
99 QMAKE_CFLAGS_DEBUG="${CFLAGS}" \
100 QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS}" \
101 QMAKE_CXXFLAGS_DEBUG="${CXXFLAGS}" \
102 QMAKE_LFLAGS_RELEASE="${LDFLAGS}" \
103 QMAKE_LFLAGS_DEBUG="${LDFLAGS}" \
104 QMAKE_RPATH= \
105 ${@} >> ${LOGFILE} 2>&1
106
107 local result=$?
108 eend ${result}
109
110 # was qmake successful?
111 if [ ${result} -ne 0 ]; then
112 echo
113 eerror "Running qmake on \"${projprofile}\" has failed"
114 echo
115 eerror "This shouldn't happen - please send a bug report to bugs.gentoo.org"
116 echo
117 die "qmake failed on ${projprofile}"
118 fi
119
120 return ${result}
121 }
122
123 EXPORT_FUNCTIONS pkg_setup

  ViewVC Help
Powered by ViewVC 1.1.20