Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 201772 | Differences between
and this patch

Collapse All | Expand All

(-)qt4.eclass.orig (-18 / +76 lines)
Lines 1-26 Link Here
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/qt4.eclass,v 1.27 2007/10/03 14:59:04 caleb Exp $
3
# $Header: /var/cvsroot/gentoo-x86/eclass/qt4.eclass,v 1.27 2007/10/03 14:59:04 caleb Exp $
4
#
4
5
# Author Caleb Tennis <caleb@gentoo.org>
5
# @ECLASS: qt4.eclass
6
#
6
# @MAINTAINER:
7
# This eclass is simple.  Inherit it, and in your depend, do something like this:
7
# Caleb Tennis <caleb@gentoo.org>
8
#
8
# @BLURB:
9
# DEPEND="$(qt4_min_version 4)"
9
# Eclass for Qt4 packages
10
#
10
# @DESCRIPTION:
11
# and it handles the rest for you
11
# This eclass contains various functions that may be useful
12
#
12
# when dealing with packages using Qt4 libraries.
13
13
# 08.16.06 - Renamed qt_min_* to qt4_min_* to avoid conflicts with the qt3 eclass.
14
# 08.16.06 - Renamed qt_min_* to qt4_min_* to avoid conflicts with the qt3 eclass.
14
#    - Caleb Tennis <caleb@gentoo.org>
15
#    - Caleb Tennis <caleb@gentoo.org>
15
16
16
inherit eutils multilib toolchain-funcs versionator
17
inherit eutils multilib toolchain-funcs versionator
17
18
18
IUSE="${IUSE}"
19
20
QTPKG="x11-libs/qt-"
19
QTPKG="x11-libs/qt-"
21
QT4MAJORVERSIONS="4.3 4.2 4.1 4.0"
20
QT4MAJORVERSIONS="4.3 4.2 4.1 4.0"
22
QT4VERSIONS="4.3.2 4.3.1-r1 4.3.1 4.3.0-r2 4.3.0-r1 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
QT4VERSIONS="4.3.2 4.3.1-r1 4.3.1 4.3.0-r2 4.3.0-r1 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"
23
22
23
# @FUNCTION: qt4_min_version
24
# @USAGE: [minimum version]
25
# @DESCRIPTION:
26
# This function should be called in package DEPENDs whenever it depends on qt4.
27
# Simple example - in your depend, do something like this:
28
# DEPEND="$(qt4_min_version 4.2)"
29
# if package can be build with qt-4.2 or higher.
24
qt4_min_version() {
30
qt4_min_version() {
25
	echo "|| ("
31
	echo "|| ("
26
	qt4_min_version_list "$@"
32
	qt4_min_version_list "$@"
Lines 53-76 Link Here
53
	echo "${VERSIONS}"
59
	echo "${VERSIONS}"
54
}
60
}
55
61
62
# @FUNCTION: qt4_pkg_setup
63
# @MAINTAINER:
64
# Caleb Tennis <caleb@gentoo.org>
65
# Przemyslaw Maciag <troll@gentoo.org>
66
# @DESCRIPTION:
67
# Default pkg_setup function for packages that depends on qt4. If you have to
68
# create ebuilds own pkg_setup in your ebuild, call qt4_pkg_setup in it.
69
# This function uses two global vars from ebuild:
70
# - QT4_BUILT_WITH_USE_CHECK - contains use flag that need to turned on in qt4
71
# - QT4_OPTIONAL_BUILT_WITH_USE_CHECK - qt4 flags that gives some functionality,
72
#   but can be safetly disabled in package (so qt4 don't have to be recompiled)
56
qt4_pkg_setup() {
73
qt4_pkg_setup() {
74
	local requiredflags=""
57
	for x in ${QT4_BUILT_WITH_USE_CHECK}; do
75
	for x in ${QT4_BUILT_WITH_USE_CHECK}; do
58
		if ! built_with_use =x11-libs/qt-4* $x; then
76
		if ! built_with_use =x11-libs/qt-4* ${x}; then
59
			die "This package requires Qt4 to be built with the '${x}' use flag."
77
			requiredflags="${requiredflags} ${x}"
78
		fi
79
	done
80
81
	local optionalflags=""
82
	for x in ${QT4_OPTIONAL_BUILT_WITH_USE_CHECK}; do
83
		if use ${x} && ! built_with_use =x11-libs/qt-4* ${x}; then
84
			optionalflags="${optionalflags} ${x}"
60
		fi
85
		fi
61
	done
86
	done
87
88
	local diemessage=""
89
	if [[ ${requiredflags} != "" ]]; then
90
		eerror
91
		eerror "(1) In order to compile ${PN} package first you need to build qt4"
92
		eerror "with USE=\"${requiredflags}\" flag(s)"
93
		eerror
94
		diemessage="(1) recompile qt4 with \"${requiredflags}\" USE flag(s) ; "
95
	fi
96
	if [[ ${optionalflags} != "" ]]; then
97
		eerror
98
		eerror "(2) You are trying to compile ${PN} package with"
99
		eerror "USE=\"${optionalflags}\""
100
		eerror "while qt4 is built without this particular flag(s): it will"
101
		eerror "not work."
102
		eerror
103
		eerror "Possible solutions to this problem are:"
104
		eerror "a) install package ${PN} without \"${optionalflags}\" USE flag(s)"
105
		eerror "b) re-emerge qt4 with \"${optionalflags}\" USE flag(s)"
106
		eerror
107
		diemessage="${diemessage}(2) recompile qt4 with \"${optionalflags}\" USE flag(s) or disable them for ${PN} package\n"
108
	fi
109
110
	[[ ${diemessage} != "" ]] && die "can't emerge ${PN}: ${diemessage}"
62
}
111
}
63
112
113
# @FUNCTION: eqmake4
114
# @USAGE: [.pro file] [additional parameters to qmake]
115
# @MAINTAINER:
116
# Przemyslaw Maciag <troll@gentoo.org>
117
# Davide Pesavento <davidepesa@gmail.com>
118
# @DESCRIPTION:
119
# Runs qmake on the specified .pro file (defaults to
120
# ${PN}.pro if eqmake4 was called with no argument).
121
# Additional parameters are passed unmodified to qmake.
64
eqmake4() {
122
eqmake4() {
65
	local LOGFILE="${T}/qmake-$$.out"
123
	local LOGFILE="${T}/qmake-$$.out"
66
	local projprofile="${1}"
124
	local projprofile="${1}"
67
	[ -z ${projprofile} ] && projprofile="${PN}.pro"
125
	[[ -z ${projprofile} ]] && projprofile="${PN}.pro"
68
	shift 1
126
	shift 1
69
127
70
	ebegin "Processing qmake ${projprofile}"
128
	ebegin "Processing qmake ${projprofile}"
71
129
72
	# file exists?
130
	# file exists?
73
	if [ ! -f ${projprofile} ]; then
131
	if [[ ! -f ${projprofile} ]]; then
74
		echo
132
		echo
75
		eerror "Project .pro file \"${projprofile}\" does not exists"
133
		eerror "Project .pro file \"${projprofile}\" does not exists"
76
		eerror "qmake cannot handle non-existing .pro files"
134
		eerror "qmake cannot handle non-existing .pro files"
Lines 86-94 Link Here
86
144
87
	# as a workaround for broken qmake, put everything into file
145
	# as a workaround for broken qmake, put everything into file
88
	if has debug ${IUSE} && use debug; then
146
	if has debug ${IUSE} && use debug; then
89
		echo -e "$CONFIG -= release\nCONFIG += no_fixpath debug" >> ${projprofile}
147
		echo -e "\nCONFIG -= release\nCONFIG += no_fixpath debug" >> ${projprofile}
90
	else
148
	else
91
		echo -e "$CONFIG -= debug\nCONFIG += no_fixpath release" >> ${projprofile}
149
		echo -e "\nCONFIG -= debug\nCONFIG += no_fixpath release" >> ${projprofile}
92
	fi
150
	fi
93
151
94
	/usr/bin/qmake ${projprofile} \
152
	/usr/bin/qmake ${projprofile} \
Lines 110-116 Link Here
110
	eend ${result}
168
	eend ${result}
111
169
112
	# was qmake successful?
170
	# was qmake successful?
113
	if [ ${result} -ne 0 ]; then
171
	if [[ ${result} -ne 0 ]]; then
114
		echo
172
		echo
115
		eerror "Running qmake on \"${projprofile}\" has failed"
173
		eerror "Running qmake on \"${projprofile}\" has failed"
116
		echo
174
		echo

Return to bug 201772