| 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.32 2008/01/05 18:44:38 caleb Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/Attic/qt4.eclass,v 1.59 2009/11/10 00:56:29 spatz 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>, |
| 8 | # @BLURB: |
10 | # Przemyslaw Maciag <troll@gentoo.org>, |
|
|
11 | # Davide Pesavento <davidepesa@gmail.com> |
| 9 | # Eclass for Qt4 packages |
12 | # @BLURB: Eclass for Qt4 packages |
| 10 | # @DESCRIPTION: |
13 | # @DESCRIPTION: |
| 11 | # This eclass contains various functions that may be useful |
14 | # This eclass contains various functions that may be useful |
| 12 | # when dealing with packages using Qt4 libraries. |
15 | # when dealing with packages using Qt4 libraries. |
| 13 | |
16 | |
| 14 | # 08.16.06 - Renamed qt_min_* to qt4_min_* to avoid conflicts with the qt3 eclass. |
|
|
| 15 | # - Caleb Tennis <caleb@gentoo.org> |
|
|
| 16 | |
|
|
| 17 | inherit eutils multilib toolchain-funcs versionator |
17 | inherit base eutils multilib toolchain-funcs versionator |
| 18 | |
18 | |
| 19 | QTPKG="x11-libs/qt-" |
19 | export XDG_CONFIG_HOME="${T}" |
| 20 | QT4MAJORVERSIONS="4.4 4.3 4.2 4.1 4.0" |
|
|
| 21 | QT4VERSIONS="4.4.0_rc1 4.3.3 4.3.2-r1 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" |
|
|
| 22 | |
20 | |
| 23 | # @FUNCTION: qt4_min_version |
21 | qt4_monolithic_to_split_flag() { |
| 24 | # @USAGE: [minimum version] |
22 | case ${1} in |
| 25 | # @DESCRIPTION: |
23 | zlib) |
| 26 | # This function should be called in package DEPENDs whenever it depends on qt4. |
24 | # Qt 4.4+ is always built with zlib enabled, so this flag isn't needed |
| 27 | # Simple example - in your depend, do something like this: |
25 | ;; |
| 28 | # DEPEND="$(qt4_min_version 4.2)" |
26 | gif|jpeg|png) |
| 29 | # if package can be build with qt-4.2 or higher. |
27 | # qt-gui always installs with these enabled |
| 30 | qt4_min_version() { |
28 | checkpkgs+=" x11-libs/qt-gui" |
| 31 | # This is much simpler for EAPI 1, we can use a slot dependency |
29 | ;; |
| 32 | if [[ "${EAPI}" -ge 1 ]]; then |
30 | dbus|opengl) |
| 33 | echo ">=${QTPKG}${1}:4" |
31 | # Make sure the qt-${1} package has been installed already |
| 34 | else |
32 | checkpkgs+=" x11-libs/qt-${1}" |
| 35 | echo "|| (" |
33 | ;; |
| 36 | qt4_min_version_list "$@" |
34 | qt3support) |
| 37 | echo ")" |
35 | checkpkgs+=" x11-libs/qt-${1}" |
| 38 | fi |
36 | checkflags+=" x11-libs/qt-core:${1} x11-libs/qt-gui:${1} x11-libs/qt-sql:${1}" |
|
|
37 | ;; |
|
|
38 | ssl) |
|
|
39 | # qt-core controls this flag |
|
|
40 | checkflags+=" x11-libs/qt-core:${1}" |
|
|
41 | ;; |
|
|
42 | cups|mng|nas|nis|tiff|xinerama|input_devices_wacom) |
|
|
43 | # qt-gui controls these flags |
|
|
44 | checkflags+=" x11-libs/qt-gui:${1}" |
|
|
45 | ;; |
|
|
46 | firebird|mysql|odbc|postgres|sqlite3) |
|
|
47 | # qt-sql controls these flags. sqlite2 is no longer supported so it uses sqlite instead of sqlite3. |
|
|
48 | checkflags+=" x11-libs/qt-sql:${1%3}" |
|
|
49 | ;; |
|
|
50 | accessibility) |
|
|
51 | eerror "(QA message): Use guiaccessibility and/or qt3accessibility to specify which of qt-gui and qt-qt3support are relevant for this package." |
|
|
52 | # deal with this gracefully by checking the flag for what is available |
|
|
53 | for y in gui qt3support; do |
|
|
54 | has_version x11-libs/qt-${y} && checkflags+=" x11-libs/qt-${y}:${1}" |
|
|
55 | done |
|
|
56 | ;; |
|
|
57 | guiaccessibility) |
|
|
58 | checkflags+=" x11-libs/qt-gui:accessibility" |
|
|
59 | ;; |
|
|
60 | qt3accessibility) |
|
|
61 | checkflags+=" x11-libs/qt-qt3support:accessibility" |
|
|
62 | ;; |
|
|
63 | debug|doc|examples|glib|pch|sqlite|*) |
|
|
64 | # packages probably shouldn't be checking these flags so we don't handle them currently |
|
|
65 | eerror "qt4.eclass currently doesn't handle the use flag ${1} in QT4_BUILT_WITH_USE_CHECK for qt-4.4. This is either an" |
|
|
66 | eerror "eclass bug or an ebuild bug. Please report it at http://bugs.gentoo.org/" |
|
|
67 | ((fatalerrors+=1)) |
|
|
68 | ;; |
|
|
69 | esac |
| 39 | } |
70 | } |
| 40 | |
71 | |
| 41 | qt4_min_version_list() { |
|
|
| 42 | local MINVER="$1" |
|
|
| 43 | local VERSIONS="" |
|
|
| 44 | |
|
|
| 45 | case "${MINVER}" in |
|
|
| 46 | 4|4.0|4.0.0) VERSIONS="=${QTPKG}4*";; |
|
|
| 47 | 4.1|4.1.0|4.2|4.2.0|4.3|4.3.0|4.4|4.4.0) |
|
|
| 48 | for x in ${QT4MAJORVERSIONS}; do |
|
|
| 49 | if $(version_is_at_least "${MINVER}" "${x}"); then |
|
|
| 50 | VERSIONS="${VERSIONS} =${QTPKG}${x}*" |
|
|
| 51 | fi |
|
|
| 52 | done |
|
|
| 53 | ;; |
|
|
| 54 | 4*) |
|
|
| 55 | for x in ${QT4VERSIONS}; do |
|
|
| 56 | if $(version_is_at_least "${MINVER}" "${x}"); then |
|
|
| 57 | VERSIONS="${VERSIONS} =${QTPKG}${x}" |
|
|
| 58 | fi |
|
|
| 59 | done |
|
|
| 60 | ;; |
|
|
| 61 | *) VERSIONS="=${QTPKG}4*";; |
|
|
| 62 | esac |
|
|
| 63 | |
|
|
| 64 | echo "${VERSIONS}" |
|
|
| 65 | } |
|
|
| 66 | |
|
|
| 67 | # @FUNCTION: qt4_pkg_setup |
72 | # @FUNCTION: qt4_pkg_setup |
| 68 | # @MAINTAINER: |
|
|
| 69 | # Caleb Tennis <caleb@gentoo.org> |
|
|
| 70 | # Przemyslaw Maciag <troll@gentoo.org> |
|
|
| 71 | # @DESCRIPTION: |
73 | # @DESCRIPTION: |
| 72 | # Default pkg_setup function for packages that depends on qt4. If you have to |
74 | # Default pkg_setup function for packages that depends on qt4. If you have to |
| 73 | # create ebuilds own pkg_setup in your ebuild, call qt4_pkg_setup in it. |
75 | # create ebuilds own pkg_setup in your ebuild, call qt4_pkg_setup in it. |
| 74 | # This function uses two global vars from ebuild: |
76 | # This function uses two global vars from ebuild: |
| 75 | # - QT4_BUILT_WITH_USE_CHECK - contains use flags that need to be turned on for |
77 | # - QT4_BUILT_WITH_USE_CHECK - contains use flags that need to be turned on for |
| 76 | # =x11-libs/qt-4* |
78 | # =x11-libs/qt-4* |
| 77 | # - QT4_OPTIONAL_BUILT_WITH_USE_CHECK - qt4 flags that provides some |
79 | # - QT4_OPTIONAL_BUILT_WITH_USE_CHECK - qt4 flags that provides some |
| 78 | # functionality, but can alternatively be disabled in ${CATEGORY}/${PN} |
80 | # functionality, but can alternatively be disabled in ${CATEGORY}/${PN} |
| 79 | # (so qt4 don't have to be recompiled) |
81 | # (so qt4 don't have to be recompiled) |
| 80 | # |
82 | # |
|
|
83 | # NOTE: Using the above vars is now deprecated in favor of eapi-2 use deps |
|
|
84 | # |
| 81 | # flags to watch for for Qt4.4: |
85 | # flags to watch for for Qt4.4: |
| 82 | # zlib png | opengl dbus qt3support | sqlite3 ssl |
86 | # zlib png | opengl dbus qt3support | sqlite3 ssl |
| 83 | qt4_pkg_setup() { |
87 | qt4_pkg_setup() { |
|
|
88 | local x y checkpkgs checkflags fatalerrors=0 requiredflags="" |
| 84 | |
89 | |
| 85 | QT4_BEST_VERSION="$(best_version =x11-libs/qt-4*)" |
90 | # lots of has_version calls can be very expensive |
| 86 | QT4_MINOR_VERSION="$(get_version_component_range 2 ${QT4_BEST_VERSION/*qt-/})" |
91 | if [[ -n ${QT4_BUILT_WITH_USE_CHECK}${QT4_OPTIONAL_BUILT_WITH_USE_CHECK} ]]; then |
|
|
92 | ewarn "QA notice: The QT4_BUILT_WITH_USE functionality is deprecated and" |
|
|
93 | ewarn "will be removed from future versions of qt4.eclass. Please update" |
|
|
94 | ewarn "the ebuild to use eapi-2 use dependencies instead." |
|
|
95 | has_version x11-libs/qt-core && local QT44=true |
|
|
96 | fi |
| 87 | |
97 | |
| 88 | local requiredflags="" |
|
|
| 89 | for x in ${QT4_BUILT_WITH_USE_CHECK}; do |
98 | for x in ${QT4_BUILT_WITH_USE_CHECK}; do |
| 90 | if [[ "${QT4_MINOR_VERSION}" -ge 4 ]]; then |
99 | if [[ -n ${QT44} ]]; then |
| 91 | # The use flags are different in 4.4 and above, and it's a split package, so this is used to catch |
100 | # The use flags are different in 4.4 and above, and it's split packages, so this is used to catch |
| 92 | # the various use flag combos specified in the ebuilds to make sure we don't error out. |
101 | # the various use flag combos specified in the ebuilds to make sure we don't error out for no reason. |
| 93 | |
102 | qt4_monolithic_to_split_flag ${x} |
| 94 | if [[ ${x} == zlib || ${x} == png ]]; then |
103 | else |
| 95 | # Qt 4.4+ is built with zlib and png by default, so the use flags aren't needed |
104 | [[ ${x} == *accessibility ]] && x=${x#gui} && x=${x#qt3} |
| 96 | continue; |
105 | if ! built_with_use =x11-libs/qt-4* ${x}; then |
| 97 | elif [[ ${x} == opengl || ${x} == dbus || ${x} == qt3support ]]; then |
106 | requiredflags="${requiredflags} ${x}" |
| 98 | # Make sure the qt-${x} package has been already installed |
|
|
| 99 | |
|
|
| 100 | if ! has_version x11-libs/qt-${x}; then |
|
|
| 101 | eerror "You must first install the x11-libs/qt-${x} package." |
|
|
| 102 | die "Install x11-libs/qt-${x}" |
|
|
| 103 | fi |
|
|
| 104 | elif [[ ${x} == ssl ]]; then |
|
|
| 105 | if ! has_version x11-libs/qt-core || ! built_with_use x11-libs/qt-core ssl; then |
|
|
| 106 | eerror "You must first install the x11-libs/qt-core package with the ssl flag enabled." |
|
|
| 107 | die "Install x1-libs/qt-core with USE=\"ssl\"" |
|
|
| 108 | fi |
|
|
| 109 | elif [[ ${x} == sqlite3 ]]; then |
|
|
| 110 | if ! has_version x11-libs/qt-sql || ! built_with_use x11-libs/qt-sql sqlite; then |
|
|
| 111 | eerror "You must first install the x11-libs/qt-sql package with the sqlite flag enabled." |
|
|
| 112 | die "Install x11-libs/qt-sql with USE="\sqlite\"" |
|
|
| 113 | fi |
|
|
| 114 | fi |
107 | fi |
| 115 | elif ! built_with_use =x11-libs/qt-4* ${x}; then |
|
|
| 116 | requiredflags="${requiredflags} ${x}" |
|
|
| 117 | fi |
108 | fi |
| 118 | done |
109 | done |
| 119 | |
110 | |
| 120 | local optionalflags="" |
111 | local optionalflags="" |
| 121 | for x in ${QT4_OPTIONAL_BUILT_WITH_USE_CHECK}; do |
112 | for x in ${QT4_OPTIONAL_BUILT_WITH_USE_CHECK}; do |
|
|
113 | if use ${x}; then |
|
|
114 | if [[ -n ${QT44} ]]; then |
|
|
115 | # The use flags are different in 4.4 and above, and it's split packages, so this is used to catch |
|
|
116 | # the various use flag combos specified in the ebuilds to make sure we don't error out for no reason. |
|
|
117 | qt4_monolithic_to_split_flag ${x} |
| 122 | if use ${x} && ! built_with_use =x11-libs/qt-4* ${x}; then |
118 | elif ! built_with_use =x11-libs/qt-4* ${x}; then |
| 123 | optionalflags="${optionalflags} ${x}" |
119 | optionalflags="${optionalflags} ${x}" |
|
|
120 | fi |
| 124 | fi |
121 | fi |
| 125 | done |
122 | done |
| 126 | |
123 | |
|
|
124 | # The use flags are different in 4.4 and above, and it's split packages, so this is used to catch |
|
|
125 | # the various use flag combos specified in the ebuilds to make sure we don't error out for no reason. |
|
|
126 | for y in ${checkpkgs}; do |
|
|
127 | if ! has_version ${y}; then |
|
|
128 | eerror "You must first install the ${y} package. It should be added to the dependencies for this package (${CATEGORY}/${PN}). See bug #217161." |
|
|
129 | ((fatalerrors+=1)) |
|
|
130 | fi |
|
|
131 | done |
|
|
132 | for y in ${checkflags}; do |
|
|
133 | if ! has_version ${y%:*}; then |
|
|
134 | eerror "You must first install the ${y%:*} package with the ${y##*:} flag enabled." |
|
|
135 | eerror "It should be added to the dependencies for this package (${CATEGORY}/${PN}). See bug #217161." |
|
|
136 | ((fatalerrors+=1)) |
|
|
137 | else |
|
|
138 | if ! built_with_use ${y%:*} ${y##*:}; then |
|
|
139 | eerror "You must first install the ${y%:*} package with the ${y##*:} flag enabled." |
|
|
140 | ((fatalerrors+=1)) |
|
|
141 | fi |
|
|
142 | fi |
|
|
143 | done |
|
|
144 | |
| 127 | local diemessage="" |
145 | local diemessage="" |
|
|
146 | if [[ ${fatalerrors} -ne 0 ]]; then |
|
|
147 | diemessage="${fatalerrors} fatal errors were detected. Please read the above error messages and act accordingly." |
|
|
148 | fi |
| 128 | if [[ ${requiredflags} != "" ]]; then |
149 | if [[ -n ${requiredflags} ]]; then |
| 129 | eerror |
150 | eerror |
| 130 | eerror "(1) In order to compile ${CATEGORY}/${PN} first you need to build" |
151 | eerror "(1) In order to compile ${CATEGORY}/${PN} first you need to build" |
| 131 | eerror "=x11-libs/qt-4* with USE=\"${requiredflags}\" flag(s)" |
152 | eerror "=x11-libs/qt-4* with USE=\"${requiredflags}\" flag(s)" |
| 132 | eerror |
153 | eerror |
| 133 | diemessage="(1) recompile qt4 with \"${requiredflags}\" USE flag(s) ; " |
154 | diemessage="(1) recompile qt4 with \"${requiredflags}\" USE flag(s) ; " |
| 134 | fi |
155 | fi |
| 135 | if [[ ${optionalflags} != "" ]]; then |
156 | if [[ -n ${optionalflags} ]]; then |
| 136 | eerror |
157 | eerror |
| 137 | eerror "(2) You are trying to compile ${CATEGORY}/${PN} package with" |
158 | eerror "(2) You are trying to compile ${CATEGORY}/${PN} package with" |
| 138 | eerror "USE=\"${optionalflags}\"" |
159 | eerror "USE=\"${optionalflags}\"" |
| 139 | eerror "while qt4 is built without this particular flag(s): it will" |
160 | eerror "while qt4 is built without this particular flag(s): it will" |
| 140 | eerror "not work." |
161 | eerror "not work." |
| … | |
… | |
| 144 | eerror "b) re-emerge qt4 with \"${optionalflags}\" USE flag(s)" |
165 | eerror "b) re-emerge qt4 with \"${optionalflags}\" USE flag(s)" |
| 145 | eerror |
166 | eerror |
| 146 | diemessage="${diemessage}(2) recompile qt4 with \"${optionalflags}\" USE flag(s) or disable them for ${PN} package\n" |
167 | diemessage="${diemessage}(2) recompile qt4 with \"${optionalflags}\" USE flag(s) or disable them for ${PN} package\n" |
| 147 | fi |
168 | fi |
| 148 | |
169 | |
| 149 | [[ ${diemessage} != "" ]] && die "can't emerge ${CATEGORY}/${PN}: ${diemessage}" |
170 | [[ -n ${diemessage} ]] && die "can't install ${CATEGORY}/${PN}: ${diemessage}" |
|
|
171 | } |
|
|
172 | |
|
|
173 | # @ECLASS-VARIABLE: PATCHES |
|
|
174 | # @DESCRIPTION: |
|
|
175 | # In case you have patches to apply, specify them in the PATCHES variable. |
|
|
176 | # Make sure to specify the full path. This variable is necessary for the |
|
|
177 | # src_prepare phase. |
|
|
178 | # example: |
|
|
179 | # PATCHES="${FILESDIR}/mypatch.patch |
|
|
180 | # ${FILESDIR}/mypatch2.patch" |
|
|
181 | # |
|
|
182 | # @FUNCTION: qt4_src_prepare |
|
|
183 | # @DESCRIPTION: |
|
|
184 | # Default src_prepare function for packages that depend on qt4. If you have to |
|
|
185 | # override src_prepare in your ebuild, you should call qt4_src_prepare in it, |
|
|
186 | # otherwise autopatcher will not work! |
|
|
187 | qt4_src_prepare() { |
|
|
188 | debug-print-function $FUNCNAME "$@" |
|
|
189 | base_src_prepare |
| 150 | } |
190 | } |
| 151 | |
191 | |
| 152 | # @FUNCTION: eqmake4 |
192 | # @FUNCTION: eqmake4 |
| 153 | # @USAGE: [.pro file] [additional parameters to qmake] |
193 | # @USAGE: [.pro file] [additional parameters to qmake] |
| 154 | # @MAINTAINER: |
|
|
| 155 | # Przemyslaw Maciag <troll@gentoo.org> |
|
|
| 156 | # Davide Pesavento <davidepesa@gmail.com> |
|
|
| 157 | # @DESCRIPTION: |
194 | # @DESCRIPTION: |
| 158 | # Runs qmake on the specified .pro file (defaults to |
195 | # Runs qmake on the specified .pro file (defaults to ${PN}.pro if called |
| 159 | # ${PN}.pro if eqmake4 was called with no argument). |
196 | # without arguments). Additional parameters are appended unmodified to |
| 160 | # Additional parameters are passed unmodified to qmake. |
197 | # qmake command line. For recursive build systems, i.e. those based on |
|
|
198 | # the subdirs template, you should run eqmake4 on the top-level project |
|
|
199 | # file only, unless you have strong reasons to do things differently. |
|
|
200 | # During the building, qmake will be automatically re-invoked with the |
|
|
201 | # right arguments on every directory specified inside the top-level |
|
|
202 | # project file by the SUBDIRS variable. |
| 161 | eqmake4() { |
203 | eqmake4() { |
| 162 | local LOGFILE="${T}/qmake-$$.out" |
204 | local projectfile="${1:-${PN}.pro}" |
| 163 | local projprofile="${1}" |
|
|
| 164 | [[ -z ${projprofile} ]] && projprofile="${PN}.pro" |
|
|
| 165 | shift 1 |
205 | shift |
| 166 | |
206 | |
| 167 | ebegin "Processing qmake ${projprofile}" |
|
|
| 168 | |
|
|
| 169 | # file exists? |
|
|
| 170 | if [[ ! -f ${projprofile} ]]; then |
207 | if [[ ! -f ${projectfile} ]]; then |
| 171 | echo |
208 | echo |
| 172 | eerror "Project .pro file \"${projprofile}\" does not exists" |
209 | eerror "Project file '${projectfile#${WORKDIR}/}' does not exists!" |
| 173 | eerror "qmake cannot handle non-existing .pro files" |
210 | eerror "eqmake4 cannot handle non-existing project files." |
|
|
211 | eerror |
|
|
212 | eerror "This shouldn't happen - please send a bug report to http://bugs.gentoo.org/" |
| 174 | echo |
213 | echo |
| 175 | eerror "This shouldn't happen - please send a bug report to bugs.gentoo.org" |
|
|
| 176 | echo |
|
|
| 177 | die "Project file not found in ${PN} sources" |
214 | die "Project file not found in ${CATEGORY}/${PN} sources." |
| 178 | fi |
215 | fi |
| 179 | |
216 | |
| 180 | echo >> ${LOGFILE} |
217 | ebegin "Running qmake on ${projectfile}" |
| 181 | echo "****** qmake ${projprofile} ******" >> ${LOGFILE} |
|
|
| 182 | echo >> ${LOGFILE} |
|
|
| 183 | |
218 | |
| 184 | # as a workaround for broken qmake, put everything into file |
219 | # make sure CONFIG variable is correctly set for both release and debug builds |
|
|
220 | local CONFIG_ADD="release" |
|
|
221 | local CONFIG_REMOVE="debug" |
| 185 | if has debug ${IUSE} && use debug; then |
222 | if has debug ${IUSE} && use debug; then |
| 186 | echo -e "\nCONFIG -= release\nCONFIG += no_fixpath debug" >> ${projprofile} |
223 | CONFIG_ADD="debug" |
| 187 | else |
224 | CONFIG_REMOVE="release" |
| 188 | echo -e "\nCONFIG -= debug\nCONFIG += no_fixpath release" >> ${projprofile} |
225 | fi |
|
|
226 | local awkscript='BEGIN { |
|
|
227 | printf "### eqmake4 was here ###\n" > file; |
|
|
228 | fixed=0; |
|
|
229 | } |
|
|
230 | /^[[:blank:]]*CONFIG[[:blank:]]*[\+\*]?=/ { |
|
|
231 | for (i=1; i <= NF; i++) { |
|
|
232 | if ($i ~ rem || $i ~ /debug_and_release/) |
|
|
233 | { $i=add; fixed=1; } |
|
|
234 | } |
|
|
235 | } |
|
|
236 | /^[[:blank:]]*CONFIG[[:blank:]]*-=/ { |
|
|
237 | for (i=1; i <= NF; i++) { |
|
|
238 | if ($i ~ add) { $i=rem; fixed=1; } |
|
|
239 | } |
|
|
240 | } |
|
|
241 | { |
|
|
242 | print >> file; |
|
|
243 | } |
|
|
244 | END { |
|
|
245 | printf "\nCONFIG -= debug_and_release %s\n", rem >> file; |
|
|
246 | printf "CONFIG += %s\n", add >> file; |
|
|
247 | print fixed; |
|
|
248 | }' |
|
|
249 | local filepath= |
|
|
250 | while read filepath; do |
|
|
251 | local file="${filepath#./}" |
|
|
252 | grep -q '^### eqmake4 was here ###$' "${file}" && continue |
|
|
253 | local retval=$({ |
|
|
254 | rm -f "${file}" || echo "FAILED" |
|
|
255 | awk -v file="${file}" -- "${awkscript}" add=${CONFIG_ADD} rem=${CONFIG_REMOVE} || echo "FAILED" |
|
|
256 | } < "${file}") |
|
|
257 | if [[ ${retval} == 1 ]]; then |
|
|
258 | einfo " Fixed CONFIG in ${file}" |
|
|
259 | elif [[ ${retval} != 0 ]]; then |
|
|
260 | eerror " An error occurred while processing ${file}" |
|
|
261 | die "eqmake4 failed to process '${file}'." |
| 189 | fi |
262 | fi |
|
|
263 | done < <(find "$(dirname "${projectfile}")" -type f -name "*.pr[io]" 2>/dev/null) |
| 190 | |
264 | |
| 191 | /usr/bin/qmake ${projprofile} \ |
265 | /usr/bin/qmake -makefile -nocache \ |
| 192 | QTDIR=/usr/$(get_libdir) \ |
266 | QTDIR=/usr/$(get_libdir) \ |
| 193 | QMAKE=/usr/bin/qmake \ |
267 | QMAKE=/usr/bin/qmake \ |
| 194 | QMAKE_CC=$(tc-getCC) \ |
268 | QMAKE_CC=$(tc-getCC) \ |
| 195 | QMAKE_CXX=$(tc-getCXX) \ |
269 | QMAKE_CXX=$(tc-getCXX) \ |
| 196 | QMAKE_LINK=$(tc-getCXX) \ |
270 | QMAKE_LINK=$(tc-getCXX) \ |
| … | |
… | |
| 198 | QMAKE_CFLAGS_DEBUG="${CFLAGS}" \ |
272 | QMAKE_CFLAGS_DEBUG="${CFLAGS}" \ |
| 199 | QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS}" \ |
273 | QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS}" \ |
| 200 | QMAKE_CXXFLAGS_DEBUG="${CXXFLAGS}" \ |
274 | QMAKE_CXXFLAGS_DEBUG="${CXXFLAGS}" \ |
| 201 | QMAKE_LFLAGS_RELEASE="${LDFLAGS}" \ |
275 | QMAKE_LFLAGS_RELEASE="${LDFLAGS}" \ |
| 202 | QMAKE_LFLAGS_DEBUG="${LDFLAGS}" \ |
276 | QMAKE_LFLAGS_DEBUG="${LDFLAGS}" \ |
| 203 | QMAKE_RPATH= \ |
277 | QMAKE_STRIP= \ |
| 204 | ${@} >> ${LOGFILE} 2>&1 |
278 | "${projectfile}" "${@}" |
| 205 | |
279 | |
| 206 | local result=$? |
280 | eend $? |
| 207 | eend ${result} |
|
|
| 208 | |
281 | |
| 209 | # was qmake successful? |
282 | # was qmake successful? |
| 210 | if [[ ${result} -ne 0 ]]; then |
283 | if [[ $? -ne 0 ]]; then |
| 211 | echo |
284 | echo |
| 212 | eerror "Running qmake on \"${projprofile}\" has failed" |
285 | eerror "Running qmake on '${projectfile#${WORKDIR}/}' has failed!" |
|
|
286 | eerror "This shouldn't happen - please send a bug report to http://bugs.gentoo.org/" |
| 213 | echo |
287 | echo |
| 214 | eerror "This shouldn't happen - please send a bug report to bugs.gentoo.org" |
|
|
| 215 | echo |
|
|
| 216 | die "qmake failed on ${projprofile}" |
288 | die "qmake failed on '${projectfile}'." |
| 217 | fi |
289 | fi |
| 218 | |
290 | |
| 219 | return ${result} |
291 | return 0 |
| 220 | } |
292 | } |
| 221 | |
293 | |
|
|
294 | case ${EAPI:-0} in |
|
|
295 | 2) |
|
|
296 | EXPORT_FUNCTIONS pkg_setup src_prepare |
|
|
297 | ;; |
|
|
298 | 0|1) |
| 222 | EXPORT_FUNCTIONS pkg_setup |
299 | EXPORT_FUNCTIONS pkg_setup |
|
|
300 | ;; |
|
|
301 | esac |