ecless/kde - move qt-meta
[anomen-overlay.git] / eclass / qt3.eclass
blobcd59f8e336effd41eb471ab397979540a967fb61
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 $
5 # @ECLASS: qt3.eclass
6 # @MAINTAINER:
7 # kde-sunset overlay maintainers
8 # @BLURB: Eclass for Qt3 packages
9 # @DESCRIPTION:
10 # This eclass contains various functions that may be useful
11 # when dealing with packages using Qt3 libraries.
13 inherit toolchain-funcs versionator eutils
15 QTPKG="dev-qt/qt-"
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]
28 # @DESCRIPTION:
29 # This function is deprecated. Use slot dependencies instead.
30 qt_min_version() {
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
34 echo "${list}"
35 else
36 echo "|| ( ${list} )"
40 qt_min_version_list() {
41 local MINVER="$1"
42 local VERSIONS=""
44 case "${MINVER}" in
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}*"
51 done
53 3*)
54 for x in ${QT3VERSIONS}; do
55 if $(version_is_at_least "${MINVER}" "${x}"); then
56 VERSIONS="${VERSIONS} =${QTPKG}${x}"
58 done
60 *) VERSIONS="=${QTPKG}3*";;
61 esac
63 echo ${VERSIONS}
66 # @FUNCTION: eqmake3
67 # @USAGE: [.pro file] [additional parameters to qmake]
68 # @MAINTAINER:
69 # Przemyslaw Maciag <troll@gentoo.org>
70 # Davide Pesavento <davidepesa@gmail.com>
71 # @DESCRIPTION:
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.
75 eqmake3() {
76 local LOGFILE="${T}/qmake-$$.out"
77 local projprofile="${1}"
78 [[ -z ${projprofile} ]] && projprofile="${PN}.pro"
79 shift 1
81 ebegin "Processing qmake ${projprofile}"
83 # file exists?
84 if [[ ! -f ${projprofile} ]]; then
85 echo
86 eerror "Project .pro file \"${projprofile}\" does not exist"
87 eerror "qmake cannot handle non-existing .pro files"
88 echo
89 eerror "This shouldn't happen - please send a bug report to bugs.gentoo.org"
90 echo
91 die "Project file not found in ${PN} sources"
94 echo >> ${LOGFILE}
95 echo "****** qmake ${projprofile} ******" >> ${LOGFILE}
96 echo >> ${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"
104 else
105 configoptplus="${configoptplus} release"
106 configoptminus="${configoptminus} debug"
109 ${QTDIR}/bin/qmake ${projprofile} \
110 QTDIR=${QTDIR} \
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}" \
122 "${configoptplus}" \
123 QMAKE_RPATH= \
124 QMAKE_STRIP= \
125 ${@} >> ${LOGFILE} 2>&1
127 local result=$?
128 eend ${result}
130 # was qmake successful?
131 if [[ ${result} -ne 0 ]]; then
132 echo
133 eerror "Running qmake on \"${projprofile}\" has failed"
134 echo
135 eerror "This shouldn't happen - please send a bug report to bugs.gentoo.org"
136 echo
137 die "qmake failed on ${projprofile}"
140 return ${result}