1 # Copyright 2005-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/qt3.eclass,v 1.41 2009/05/17 15:17:03 hwoarang Exp $
7 # kde-sunset overlay maintainers
8 # @BLURB: Eclass for Qt3 packages
10 # This eclass contains various functions that may be useful
11 # when dealing with packages using Qt3 libraries.
13 inherit toolchain-funcs versionator eutils
16 QT3MAJORVERSIONS
="3.3 3.2 3.1 3.0"
17 QT3VERSIONS
="3.3.8b-r1 3.3.8b 3.3.8-r4 3.3.8-r3 3.3.8-r2 3.3.8-r1 3.3.8 3.3.6-r5 3.3.6-r4 3.3.6-r3 3.3.6-r2 3.3.6-r1 3.3.6 3.3.5-r1 3.3.5 3.3.4-r9 3.3.4-r8 3.3.4-r7 3.3.4-r6 3.3.4-r5 3.3.4-r4 3.3.4-r3 3.3.4-r2 3.3.4-r1 3.3.4 3.3.3-r3 3.3.3-r2 3.3.3-r1 3.3.3 3.3.2 3.3.1-r2 3.3.1-r1 3.3.1 3.3.0-r1 3.3.0 3.2.3-r1 3.2.3 3.2.2-r1 3.2.2 3.2.1-r2 3.2.1-r1 3.2.1 3.2.0 3.1.2-r4 3.1.2-r3 3.1.2-r2 3.1.2-r1 3.1.2 3.1.1-r2 3.1.1-r1 3.1.1 3.1.0-r3 3.1.0-r2 3.1.0-r1 3.1.0"
19 if [[ -z "${QTDIR}" ]]; then
20 export QTDIR
="/usr/qt/3"
23 addwrite
"${QTDIR}/etc/settings"
24 addpredict
"${QTDIR}/etc/settings"
26 # @FUNCTION: qt_min_version
27 # @USAGE: [minimum version]
29 # This function is deprecated. Use slot dependencies instead.
31 local list
=$
(qt_min_version_list
"$@")
32 ewarn
"${CATEGORY}/${PF}: qt_min_version() is deprecated. Use slot dependencies instead."
33 if [[ ${list%% *} == "${list}" ]]; then
40 qt_min_version_list
() {
45 3|
3.0|
3.0.0) VERSIONS
="=${QTPKG}3*";;
46 3.1|
3.1.0|
3.2|
3.2.0|
3.3|
3.3.0)
47 for x
in ${QT3MAJORVERSIONS}; do
48 if $
(version_is_at_least
"${MINVER}" "${x}"); then
49 VERSIONS
="${VERSIONS} =${QTPKG}${x}*"
54 for x
in ${QT3VERSIONS}; do
55 if $
(version_is_at_least
"${MINVER}" "${x}"); then
56 VERSIONS
="${VERSIONS} =${QTPKG}${x}"
60 *) VERSIONS
="=${QTPKG}3*";;
67 # @USAGE: [.pro file] [additional parameters to qmake]
69 # Przemyslaw Maciag <troll@gentoo.org>
70 # Davide Pesavento <davidepesa@gmail.com>
72 # Runs qmake on the specified .pro file (defaults to
73 # ${PN}.pro if eqmake3 was called with no argument).
74 # Additional parameters are passed unmodified to qmake.
76 local LOGFILE
="${T}/qmake-$$.out"
77 local projprofile
="${1}"
78 [[ -z ${projprofile} ]] && projprofile
="${PN}.pro"
81 ebegin
"Processing qmake ${projprofile}"
84 if [[ ! -f ${projprofile} ]]; then
86 eerror
"Project .pro file \"${projprofile}\" does not exist"
87 eerror
"qmake cannot handle non-existing .pro files"
89 eerror
"This shouldn't happen - please send a bug report to bugs.gentoo.org"
91 die
"Project file not found in ${PN} sources"
95 echo "****** qmake ${projprofile} ******" >> ${LOGFILE}
98 # some standard config options
99 local configoptplus
="CONFIG += no_fixpath"
100 local configoptminus
="CONFIG -="
101 if has debug
${IUSE} && use debug
; then
102 configoptplus
="${configoptplus} debug"
103 configoptminus
="${configoptminus} release"
105 configoptplus
="${configoptplus} release"
106 configoptminus
="${configoptminus} debug"
109 ${QTDIR}/bin
/qmake
${projprofile} \
111 QMAKE
=${QTDIR}/bin
/qmake \
112 QMAKE_CC
=$
(tc-getCC
) \
113 QMAKE_CXX
=$
(tc-getCXX
) \
114 QMAKE_LINK
=$
(tc-getCXX
) \
115 QMAKE_CFLAGS_RELEASE
="${CFLAGS}" \
116 QMAKE_CFLAGS_DEBUG
="${CFLAGS}" \
117 QMAKE_CXXFLAGS_RELEASE
="${CXXFLAGS}" \
118 QMAKE_CXXFLAGS_DEBUG
="${CXXFLAGS}" \
119 QMAKE_LFLAGS_RELEASE
="${LDFLAGS}" \
120 QMAKE_LFLAGS_DEBUG
="${LDFLAGS}" \
121 "${configoptminus}" \
125 ${@} >> ${LOGFILE} 2>&1
130 # was qmake successful?
131 if [[ ${result} -ne 0 ]]; then
133 eerror
"Running qmake on \"${projprofile}\" has failed"
135 eerror
"This shouldn't happen - please send a bug report to bugs.gentoo.org"
137 die
"qmake failed on ${projprofile}"