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

Diff of /eclass/qt4.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.10 Revision 1.20
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.10 2007/03/14 14:58:36 caleb Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/qt4.eclass,v 1.20 2007/07/31 13:39:50 caleb Exp $
4# 4#
5# Author Caleb Tennis <caleb@gentoo.org> 5# Author Caleb Tennis <caleb@gentoo.org>
6# 6#
7# This eclass is simple. Inherit it, and in your depend, do something like this: 7# This eclass is simple. Inherit it, and in your depend, do something like this:
8# 8#
11# and it handles the rest for you 11# and it handles the rest for you
12# 12#
13# 08.16.06 - Renamed qt_min_* to qt4_min_* to avoid conflicts with the qt3 eclass. 13# 08.16.06 - Renamed qt_min_* to qt4_min_* to avoid conflicts with the qt3 eclass.
14# - Caleb Tennis <caleb@gentoo.org> 14# - Caleb Tennis <caleb@gentoo.org>
15 15
16inherit versionator 16inherit eutils multilib toolchain-funcs versionator
17 17
18QTPKG="x11-libs/qt-" 18QTPKG="x11-libs/qt-"
19QT4MAJORVERSIONS="4.2 4.1 4.0" 19QT4MAJORVERSIONS="4.3 4.2 4.1 4.0"
20QT4VERSIONS="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" 20QT4VERSIONS="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 21
22qt4_min_version() { 22qt4_min_version() {
23 echo "|| (" 23 echo "|| ("
24 qt4_min_version_list "$@" 24 qt4_min_version_list "$@"
25 echo ")" 25 echo ")"
48 *) VERSIONS="=${QTPKG}4*";; 48 *) VERSIONS="=${QTPKG}4*";;
49 esac 49 esac
50 50
51 echo "${VERSIONS}" 51 echo "${VERSIONS}"
52} 52}
53
54qt4_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
62eqmake4() {
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
123EXPORT_FUNCTIONS pkg_setup

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.20

  ViewVC Help
Powered by ViewVC 1.1.20