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

Diff of /eclass/qt4.eclass

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

Revision 1.48 Revision 1.51
1# Copyright 2005 Gentoo Foundation 1# Copyright 2005-2009 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.48 2008/08/03 20:47:27 carlo Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/qt4.eclass,v 1.51 2009/03/14 15:31:28 yngwin Exp $
4 4
5# @ECLASS: qt4.eclass 5# @ECLASS: qt4.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Ben de Groot <yngwin@gentoo.org>,
8# Markos Chandras <hwoarang@gentoo.org>,
7# Caleb Tennis <caleb@gentoo.org> 9# Caleb Tennis <caleb@gentoo.org>,
10# Przemyslaw Maciag <troll@gentoo.org>,
11# Davide Pesavento <davidepesa@gmail.com>
8# @BLURB: Eclass for Qt4 packages 12# @BLURB: Eclass for Qt4 packages
9# @DESCRIPTION: 13# @DESCRIPTION:
10# This eclass contains various functions that may be useful 14# This eclass contains various functions that may be useful
11# when dealing with packages using Qt4 libraries. 15# when dealing with packages using Qt4 libraries.
12 16
13# 08.16.06 - Renamed qt_min_* to qt4_min_* to avoid conflicts with the qt3 eclass.
14# - Caleb Tennis <caleb@gentoo.org>
15
16inherit eutils multilib toolchain-funcs versionator 17inherit base eutils multilib toolchain-funcs versionator
17
18QTPKG="x11-libs/qt-"
19QT4MAJORVERSIONS="4.4 4.3 4.2 4.1 4.0"
20QT4VERSIONS="4.4.1 4.4.0 4.4.0_beta1 4.4.0_rc1
21 4.3.4-r1 4.3.5 4.3.4 4.3.3 4.3.2-r1 4.3.2 4.3.1-r1 4.3.1
22 4.3.0-r2 4.3.0-r1 4.3.0 4.3.0_rc1 4.3.0_beta1
23 4.2.3-r1 4.2.3 4.2.2 4.2.1 4.2.0-r2 4.2.0-r1 4.2.0
24 4.1.4-r2 4.1.4-r1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0
25 4.0.1 4.0.0"
26
27# @FUNCTION: qt4_min_version
28# @USAGE: [minimum version]
29# @DESCRIPTION:
30# This function is deprecated. Use slot dependencies instead.
31qt4_min_version() {
32 local deps="$@"
33 ewarn "${CATEGORY}/${PF}: qt4_min_version() is deprecated. Use slot dependencies instead."
34 case ${EAPI:-0} in
35 # EAPIs without SLOT dependencies
36 0) echo "|| ("
37 qt4_min_version_list "${deps}"
38 echo ")"
39 ;;
40 # EAPIS with SLOT dependencies.
41 *) echo ">=${QTPKG}${1}:4"
42 ;;
43 esac
44}
45
46qt4_min_version_list() {
47 local MINVER="$1"
48 local VERSIONS=""
49
50 case "${MINVER}" in
51 4|4.0|4.0.0) VERSIONS="=${QTPKG}4*";;
52 4.1|4.1.0|4.2|4.2.0|4.3|4.3.0|4.4|4.4.0)
53 for x in ${QT4MAJORVERSIONS}; do
54 if version_is_at_least "${MINVER}" "${x}"; then
55 VERSIONS="${VERSIONS} =${QTPKG}${x}*"
56 fi
57 done
58 ;;
59 4*)
60 for x in ${QT4VERSIONS}; do
61 if version_is_at_least "${MINVER}" "${x}"; then
62 VERSIONS="${VERSIONS} =${QTPKG}${x}"
63 fi
64 done
65 ;;
66 *) VERSIONS="=${QTPKG}4*";;
67 esac
68
69 echo "${VERSIONS}"
70}
71 18
72qt4_monolithic_to_split_flag() { 19qt4_monolithic_to_split_flag() {
73 case ${1} in 20 case ${1} in
74 zlib) 21 zlib)
75 # Qt 4.4+ is always built with zlib enabled, so this flag isn't needed 22 # Qt 4.4+ is always built with zlib enabled, so this flag isn't needed
119 ;; 66 ;;
120 esac 67 esac
121} 68}
122 69
123# @FUNCTION: qt4_pkg_setup 70# @FUNCTION: qt4_pkg_setup
124# @MAINTAINER:
125# Caleb Tennis <caleb@gentoo.org>
126# Przemyslaw Maciag <troll@gentoo.org>
127# @DESCRIPTION: 71# @DESCRIPTION:
128# Default pkg_setup function for packages that depends on qt4. If you have to 72# Default pkg_setup function for packages that depends on qt4. If you have to
129# create ebuilds own pkg_setup in your ebuild, call qt4_pkg_setup in it. 73# create ebuilds own pkg_setup in your ebuild, call qt4_pkg_setup in it.
130# This function uses two global vars from ebuild: 74# This function uses two global vars from ebuild:
131# - QT4_BUILT_WITH_USE_CHECK - contains use flags that need to be turned on for 75# - QT4_BUILT_WITH_USE_CHECK - contains use flags that need to be turned on for
132# =x11-libs/qt-4* 76# =x11-libs/qt-4*
133# - QT4_OPTIONAL_BUILT_WITH_USE_CHECK - qt4 flags that provides some 77# - QT4_OPTIONAL_BUILT_WITH_USE_CHECK - qt4 flags that provides some
134# functionality, but can alternatively be disabled in ${CATEGORY}/${PN} 78# functionality, but can alternatively be disabled in ${CATEGORY}/${PN}
135# (so qt4 don't have to be recompiled) 79# (so qt4 don't have to be recompiled)
136# 80#
81# NOTE: Using the above vars is now deprecated in favor of eapi-2 use deps
82#
137# flags to watch for for Qt4.4: 83# flags to watch for for Qt4.4:
138# zlib png | opengl dbus qt3support | sqlite3 ssl 84# zlib png | opengl dbus qt3support | sqlite3 ssl
139qt4_pkg_setup() { 85qt4_pkg_setup() {
140 local x y checkpkgs checkflags fatalerrors=0 requiredflags="" 86 local x y checkpkgs checkflags fatalerrors=0 requiredflags=""
141 87
142 # lots of has_version calls can be very expensive 88 # lots of has_version calls can be very expensive
143 if [[ -n ${QT4_BUILT_WITH_USE_CHECK}${QT4_OPTIONAL_BUILT_WITH_USE_CHECK} ]]; then 89 if [[ -n ${QT4_BUILT_WITH_USE_CHECK}${QT4_OPTIONAL_BUILT_WITH_USE_CHECK} ]]; then
90 ewarn "QA notice: The QT4_BUILT_WITH_USE functionality is deprecated and"
91 ewarn "will be removed from future versions of qt4.eclass. Please update"
92 ewarn "the ebuild to use eapi-2 use dependencies instead."
144 has_version x11-libs/qt-core && local QT44=true 93 has_version x11-libs/qt-core && local QT44=true
145 fi 94 fi
146 95
147 for x in ${QT4_BUILT_WITH_USE_CHECK}; do 96 for x in ${QT4_BUILT_WITH_USE_CHECK}; do
148 if [[ -n ${QT44} ]]; then 97 if [[ -n ${QT44} ]]; then
217 fi 166 fi
218 167
219 [[ -n ${diemessage} ]] && die "can't install ${CATEGORY}/${PN}: ${diemessage}" 168 [[ -n ${diemessage} ]] && die "can't install ${CATEGORY}/${PN}: ${diemessage}"
220} 169}
221 170
171# @ECLASS-VARIABLE: PATCHES
172# @DESCRIPTION:
173# In case you have patches to apply, specify them in the PATCHES variable.
174# Make sure to specify the full path. This variable is necessary for the
175# src_prepare phase.
176# example:
177# PATCHES="${FILESDIR}/mypatch.patch
178# ${FILESDIR}/mypatch2.patch"
179#
180# @FUNCTION: qt4_src_prepare
181# @DESCRIPTION:
182# Default src_prepare function for packages that depend on qt4. If you have to
183# override src_prepare in your ebuild, you should call qt4_src_prepare in it,
184# otherwise autopatcher will not work!
185qt4_src_prepare() {
186 debug-print-function $FUNCNAME "$@"
187 base_src_prepare
188}
189
190# @FUNCTION: qt4_src_configure
191# @DESCRIPTION:
192# Default src_configure function for packages that depend on qt4. If you have to
193# override src_configure in your ebuild, call qt4_src_configure in it.
194qt4_src_configure() {
195 debug-print-function $FUNCNAME "$@"
196 eqmake4
197}
198
199# @FUNCTION: qt4_src_compile
200# @DESCRIPTION:
201# Default src_compile function for packages that depend on qt4. If you have to
202# override src_compile in your ebuild (probably you don't need to), call
203# qt4_src_compile in it.
204qt4_src_compile() {
205 debug-print-function $FUNCNAME "$@"
206 case "${EAPI:-0}" in
207 2)
208 emake || die "emake failed"
209 ;;
210 0|1)
211 qt4_src_prepare
212 qt4_src_configure
213 emake || die "emake failed"
214 ;;
215 esac
216}
217
222# @FUNCTION: eqmake4 218# @FUNCTION: eqmake4
223# @USAGE: [.pro file] [additional parameters to qmake] 219# @USAGE: [.pro file] [additional parameters to qmake]
224# @MAINTAINER:
225# Przemyslaw Maciag <troll@gentoo.org>
226# Davide Pesavento <davidepesa@gmail.com>
227# @DESCRIPTION: 220# @DESCRIPTION:
228# Runs qmake on the specified .pro file (defaults to 221# Runs qmake on the specified .pro file (defaults to
229# ${PN}.pro if eqmake4 was called with no argument). 222# ${PN}.pro if eqmake4 was called with no argument).
230# Additional parameters are passed unmodified to qmake. 223# Additional parameters are passed unmodified to qmake.
231eqmake4() { 224eqmake4() {
269 QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS}" \ 262 QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS}" \
270 QMAKE_CXXFLAGS_DEBUG="${CXXFLAGS}" \ 263 QMAKE_CXXFLAGS_DEBUG="${CXXFLAGS}" \
271 QMAKE_LFLAGS_RELEASE="${LDFLAGS}" \ 264 QMAKE_LFLAGS_RELEASE="${LDFLAGS}" \
272 QMAKE_LFLAGS_DEBUG="${LDFLAGS}" \ 265 QMAKE_LFLAGS_DEBUG="${LDFLAGS}" \
273 QMAKE_RPATH= \ 266 QMAKE_RPATH= \
267 QMAKE_STRIP= \
274 "${@}" >> ${LOGFILE} 2>&1 268 "${@}" >> ${LOGFILE} 2>&1
275 269
276 local result=$? 270 local result=$?
277 eend ${result} 271 eend ${result}
278 272
287 fi 281 fi
288 282
289 return ${result} 283 return ${result}
290} 284}
291 285
286case ${EAPI:-0} in
287 2)
288 EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_compile
289 ;;
290 0|1)
292EXPORT_FUNCTIONS pkg_setup 291 EXPORT_FUNCTIONS pkg_setup src_compile
292 ;;
293esac

Legend:
Removed from v.1.48  
changed lines
  Added in v.1.51

  ViewVC Help
Powered by ViewVC 1.1.20