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

Diff of /eclass/qt4-r2.eclass

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

Revision 1.16 Revision 1.17
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2012 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-r2.eclass,v 1.16 2011/12/28 10:57:38 pesa Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-r2.eclass,v 1.17 2012/02/13 00:32:31 pesa Exp $
4 4
5# @ECLASS: qt4-r2.eclass 5# @ECLASS: qt4-r2.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Qt herd <qt@gentoo.org> 7# Qt herd <qt@gentoo.org>
8# @BLURB: Eclass for Qt4-based packages, second edition. 8# @BLURB: Eclass for Qt4-based packages, second edition.
216 CONFIG_ADD="debug" 216 CONFIG_ADD="debug"
217 CONFIG_REMOVE="release" 217 CONFIG_REMOVE="release"
218 fi 218 fi
219 local awkscript='BEGIN { 219 local awkscript='BEGIN {
220 printf "### eqmake4 was here ###\n" > file; 220 printf "### eqmake4 was here ###\n" > file;
221 printf "CONFIG -= debug_and_release %s\n", remove >> file;
222 printf "CONFIG += %s\n\n", add >> file;
221 fixed=0; 223 fixed=0;
222 } 224 }
223 /^[[:blank:]]*CONFIG[[:blank:]]*[\+\*]?=/ { 225 /^[[:blank:]]*CONFIG[[:blank:]]*[\+\*]?=/ {
224 for (i=1; i <= NF; i++) { 226 if (gsub("\\<((" remove ")|(debug_and_release))\\>", "") > 0) {
225 if ($i ~ rem || $i ~ /debug_and_release/) 227 fixed=1;
226 { $i=add; fixed=1; }
227 } 228 }
228 } 229 }
229 /^[[:blank:]]*CONFIG[[:blank:]]*-=/ { 230 /^[[:blank:]]*CONFIG[[:blank:]]*-=/ {
230 for (i=1; i <= NF; i++) { 231 if (gsub("\\<" add "\\>", "") > 0) {
231 if ($i ~ add) { $i=rem; fixed=1; } 232 fixed=1;
232 } 233 }
233 } 234 }
234 { 235 {
235 print >> file; 236 print >> file;
236 } 237 }
237 END { 238 END {
238 printf "\nCONFIG -= debug_and_release %s\n", rem >> file;
239 printf "CONFIG += %s\n", add >> file;
240 print fixed; 239 print fixed;
241 }' 240 }'
242 local file= 241 local file=
243 while read file; do 242 while read file; do
244 grep -q '^### eqmake4 was here ###$' "${file}" && continue 243 grep -q '^### eqmake4 was here ###$' "${file}" && continue
245 local retval=$({ 244 local retval=$({
246 rm -f "${file}" || echo "FAILED" 245 rm -f "${file}" || echo FAIL
247 awk -v file="${file}" -- "${awkscript}" add=${CONFIG_ADD} rem=${CONFIG_REMOVE} || echo "FAILED" 246 awk -v file="${file}" \
247 -v add=${CONFIG_ADD} \
248 -v remove=${CONFIG_REMOVE} \
249 -- "${awkscript}" || echo FAIL
248 } < "${file}") 250 } < "${file}")
249 if [[ ${retval} == 1 ]]; then 251 if [[ ${retval} == 1 ]]; then
250 einfo " - fixed CONFIG in ${file}" 252 einfo " - fixed CONFIG in ${file}"
251 elif [[ ${retval} != 0 ]]; then 253 elif [[ ${retval} != 0 ]]; then
252 eerror "An error occurred while processing ${file}" 254 eerror "An error occurred while processing ${file}"
256 258
257 [[ ${EAPI} == 2 ]] && use !prefix && EPREFIX= 259 [[ ${EAPI} == 2 ]] && use !prefix && EPREFIX=
258 260
259 "${EPREFIX}"/usr/bin/qmake \ 261 "${EPREFIX}"/usr/bin/qmake \
260 -makefile \ 262 -makefile \
261 -config ${CONFIG_ADD} \
262 QTDIR="${EPREFIX}"/usr/$(get_libdir) \ 263 QTDIR="${EPREFIX}"/usr/$(get_libdir) \
263 QMAKE="${EPREFIX}"/usr/bin/qmake \ 264 QMAKE="${EPREFIX}"/usr/bin/qmake \
264 QMAKE_CC="$(tc-getCC)" \ 265 QMAKE_CC="$(tc-getCC)" \
265 QMAKE_CXX="$(tc-getCXX)" \ 266 QMAKE_CXX="$(tc-getCXX)" \
266 QMAKE_LINK="$(tc-getCXX)" \ 267 QMAKE_LINK="$(tc-getCXX)" \

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.20