/[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.25 Revision 1.26
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2013 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.25 2013/03/05 19:06:19 pesa Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-r2.eclass,v 1.26 2013/06/03 06:20:53 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.
125} 125}
126 126
127# @FUNCTION: qt4-r2_src_install 127# @FUNCTION: qt4-r2_src_install
128# @DESCRIPTION: 128# @DESCRIPTION:
129# Default src_install function for qt4-based packages. Installs compiled code, 129# Default src_install function for qt4-based packages. Installs compiled code,
130# documentation (via DOCS and HTML_DOCS variables). 130# and documentation (via DOCS and HTML_DOCS variables).
131
132qt4-r2_src_install() { 131qt4-r2_src_install() {
133 debug-print-function $FUNCNAME "$@" 132 debug-print-function $FUNCNAME "$@"
134 133
135 base_src_install INSTALL_ROOT="${D}" "$@" 134 base_src_install INSTALL_ROOT="${D}" "$@"
136 135
140 fi 139 fi
141 if [[ -n ${HTML_DOCS} ]] && [[ "$(declare -p HTML_DOCS 2>/dev/null 2>&1)" != "declare -a"* ]]; then 140 if [[ -n ${HTML_DOCS} ]] && [[ "$(declare -p HTML_DOCS 2>/dev/null 2>&1)" != "declare -a"* ]]; then
142 dohtml -r ${HTML_DOCS} || die "dohtml failed" 141 dohtml -r ${HTML_DOCS} || die "dohtml failed"
143 fi 142 fi
144} 143}
144
145# @VARIABLE: EQMAKE4_EXCLUDE
146# @DEFAULT_UNSET
147# @DESCRIPTION:
148# List of files to be excluded from eqmake4 processing.
149# Paths are relative to the current working directory (usually ${S}).
150#
151# Example: EQMAKE4_EXCLUDE="ignore/me.pro foo/*"
145 152
146# @FUNCTION: eqmake4 153# @FUNCTION: eqmake4
147# @USAGE: [project_file] [parameters to qmake] 154# @USAGE: [project_file] [parameters to qmake]
148# @DESCRIPTION: 155# @DESCRIPTION:
149# Wrapper for Qt4's qmake. If project_file isn't specified, eqmake4 will 156# Wrapper for Qt4's qmake. If project_file isn't specified, eqmake4 will
185 local config_remove="debug" 192 local config_remove="debug"
186 if has debug ${IUSE} && use debug; then 193 if has debug ${IUSE} && use debug; then
187 config_add="debug" 194 config_add="debug"
188 config_remove="release" 195 config_remove="release"
189 fi 196 fi
197
190 local awkscript='BEGIN { 198 local awkscript='BEGIN {
191 printf "### eqmake4 was here ###\n" > file; 199 printf "### eqmake4 was here ###\n" > file;
192 printf "CONFIG -= debug_and_release %s\n", remove >> file; 200 printf "CONFIG -= debug_and_release %s\n", remove >> file;
193 printf "CONFIG += %s\n\n", add >> file; 201 printf "CONFIG += %s\n\n", add >> file;
194 fixed=0; 202 fixed=0;
207 print >> file; 215 print >> file;
208 } 216 }
209 END { 217 END {
210 print fixed; 218 print fixed;
211 }' 219 }'
220
221 [[ -n ${EQMAKE4_EXCLUDE} ]] && eshopts_push -o noglob
222
212 local file= 223 local file
213 while read file; do 224 while read file; do
225 local excl
226 for excl in ${EQMAKE4_EXCLUDE}; do
227 [[ ${file} == ${excl} ]] && continue 2
228 done
214 grep -q '^### eqmake4 was here ###$' "${file}" && continue 229 grep -q '^### eqmake4 was here ###$' "${file}" && continue
230
215 local retval=$({ 231 local retval=$({
216 rm -f "${file}" || echo FAIL 232 rm -f "${file}" || echo FAIL
217 awk -v file="${file}" \ 233 awk -v file="${file}" \
218 -v add=${config_add} \ 234 -v add=${config_add} \
219 -v remove=${config_remove} \ 235 -v remove=${config_remove} \
220 -- "${awkscript}" || echo FAIL 236 -- "${awkscript}" || echo FAIL
221 } < "${file}") 237 } < "${file}")
238
222 if [[ ${retval} == 1 ]]; then 239 if [[ ${retval} == 1 ]]; then
223 einfo " - fixed CONFIG in ${file}" 240 einfo " - fixed CONFIG in ${file}"
224 elif [[ ${retval} != 0 ]]; then 241 elif [[ ${retval} != 0 ]]; then
225 eerror " - error while processing ${file}" 242 eerror " - error while processing ${file}"
226 die "eqmake4 failed to process ${file}" 243 die "eqmake4 failed to process ${file}"
227 fi 244 fi
228 done < <(find . -type f -name '*.pr[io]' -printf '%P\n' 2>/dev/null) 245 done < <(find . -type f -name '*.pr[io]' -printf '%P\n' 2>/dev/null)
246
247 [[ -n ${EQMAKE4_EXCLUDE} ]] && eshopts_pop
229 248
230 "${EPREFIX}"/usr/bin/qmake \ 249 "${EPREFIX}"/usr/bin/qmake \
231 -makefile \ 250 -makefile \
232 QTDIR="${EPREFIX}"/usr/$(get_libdir) \ 251 QTDIR="${EPREFIX}"/usr/$(get_libdir) \
233 QMAKE="${EPREFIX}"/usr/bin/qmake \ 252 QMAKE="${EPREFIX}"/usr/bin/qmake \
259 eerror "Running qmake has failed! (see above for details)" 278 eerror "Running qmake has failed! (see above for details)"
260 eerror "This shouldn't happen - please send a bug report to http://bugs.gentoo.org/" 279 eerror "This shouldn't happen - please send a bug report to http://bugs.gentoo.org/"
261 echo 280 echo
262 die "eqmake4 failed" 281 die "eqmake4 failed"
263 fi 282 fi
264
265 return 0
266} 283}
267 284
268# Internal function, used by eqmake4 and qt4-r2_src_configure. 285# Internal function, used by eqmake4 and qt4-r2_src_configure.
269# Outputs a project file name that can be passed to eqmake4. Sets nullglob 286# Outputs a project file name that can be passed to eqmake4. Sets nullglob
270# locally to avoid expanding *.pro as "*.pro" when there are no matching files. 287# locally to avoid expanding *.pro as "*.pro" when there are no matching files.

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26

  ViewVC Help
Powered by ViewVC 1.1.20