/[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.1 Revision 1.8
1# Copyright 2009 Gentoo Foundation 1# Copyright 1999-2010 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.1 2009/12/15 16:32:43 ayoy Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-r2.eclass,v 1.8 2010/08/14 18:00:38 hwoarang Exp $
4 4
5# @ECLASS: qt4-r2.eclass 5# @ECLASS: qt4-r2.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Ben de Groot <yngwin@gentoo.org>, 7# Ben de Groot <yngwin@gentoo.org>,
8# Markos Chandras <hwoarang@gentoo.org>, 8# Markos Chandras <hwoarang@gentoo.org>,
12# @DESCRIPTION: 12# @DESCRIPTION:
13# This eclass contains various functions that may be useful when 13# This eclass contains various functions that may be useful when
14# dealing with packages using Qt4 libraries. Requires EAPI=2. 14# dealing with packages using Qt4 libraries. Requires EAPI=2.
15 15
16case ${EAPI} in 16case ${EAPI} in
17 2) : ;; 17 2|3) : ;;
18 *) DEPEND="EAPI-INCOMPATIBLE" ;; 18 *) DEPEND="EAPI-INCOMPATIBLE" ;;
19esac 19esac
20 20
21inherit base eutils multilib toolchain-funcs 21inherit base eutils multilib toolchain-funcs
22 22
178# directory specified inside the top-level project file by the SUBDIRS 178# directory specified inside the top-level project file by the SUBDIRS
179# variable. 179# variable.
180eqmake4() { 180eqmake4() {
181 ebegin "Running qmake" 181 ebegin "Running qmake"
182 182
183 local qmake_args="$@" 183 local qmake_args=("$@")
184 184
185 # check if project file was passed as a first argument 185 # check if project file was passed as a first argument
186 # if not, then search for it 186 # if not, then search for it
187 local regexp='.*\.pro' 187 local regexp='.*\.pro'
188 if ! [[ "${1}" =~ ${regexp} ]]; then 188 if ! [[ "${1}" =~ ${regexp} ]]; then
192 eerror "No project file found in ${S}!" 192 eerror "No project file found in ${S}!"
193 eerror "This shouldn't happen - please send a bug report to http://bugs.gentoo.org/" 193 eerror "This shouldn't happen - please send a bug report to http://bugs.gentoo.org/"
194 echo 194 echo
195 die "eqmake4 failed" 195 die "eqmake4 failed"
196 fi 196 fi
197 qmake_args="${qmake_args} ${project_file}" 197 qmake_args+=("${project_file}")
198 fi 198 fi
199 199
200 # make sure CONFIG variable is correctly set for both release and debug builds 200 # make sure CONFIG variable is correctly set for both release and debug builds
201 local CONFIG_ADD="release" 201 local CONFIG_ADD="release"
202 local CONFIG_REMOVE="debug" 202 local CONFIG_REMOVE="debug"
240 eerror "An error occurred while processing ${file}" 240 eerror "An error occurred while processing ${file}"
241 die "eqmake4 failed to process '${file}'" 241 die "eqmake4 failed to process '${file}'"
242 fi 242 fi
243 done < <(find . -type f -name "*.pr[io]" -printf '%P\n' 2>/dev/null) 243 done < <(find . -type f -name "*.pr[io]" -printf '%P\n' 2>/dev/null)
244 244
245 /usr/bin/qmake -makefile -nocache \ 245 [[ ${EAPI} == 2 ]] && use !prefix && EPREFIX=
246
247 "${EPREFIX}"/usr/bin/qmake \
248 -makefile -nocache \
249 -config ${CONFIG_ADD} \
246 QTDIR=/usr/$(get_libdir) \ 250 QTDIR="${EPREFIX}"/usr/$(get_libdir) \
247 QMAKE=/usr/bin/qmake \ 251 QMAKE="${EPREFIX}"/usr/bin/qmake \
248 QMAKE_CC=$(tc-getCC) \ 252 QMAKE_CC="$(tc-getCC)" \
249 QMAKE_CXX=$(tc-getCXX) \ 253 QMAKE_CXX="$(tc-getCXX)" \
250 QMAKE_LINK=$(tc-getCXX) \ 254 QMAKE_LINK="$(tc-getCXX)" \
251 QMAKE_CFLAGS_RELEASE="${CFLAGS}" \ 255 QMAKE_CFLAGS_RELEASE="${CFLAGS}" \
252 QMAKE_CFLAGS_DEBUG="${CFLAGS}" \ 256 QMAKE_CFLAGS_DEBUG="${CFLAGS}" \
253 QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS}" \ 257 QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS}" \
254 QMAKE_CXXFLAGS_DEBUG="${CXXFLAGS}" \ 258 QMAKE_CXXFLAGS_DEBUG="${CXXFLAGS}" \
255 QMAKE_LFLAGS_RELEASE="${LDFLAGS}" \ 259 QMAKE_LFLAGS_RELEASE="${LDFLAGS}" \
256 QMAKE_LFLAGS_DEBUG="${LDFLAGS}" \ 260 QMAKE_LFLAGS_DEBUG="${LDFLAGS}" \
257 QMAKE_RPATH= \ 261 QMAKE_LIBDIR_QT="${EPREFIX}"/usr/$(get_libdir)/qt4 \
262 QMAKE_LIBDIR_X11="${EPREFIX}"/usr/$(get_libdir) \
263 QMAKE_LIBDIR_OPENGL="${EPREFIX}"/usr/$(get_libdir) \
258 QMAKE_STRIP= \ 264 QMAKE_STRIP= \
259 ${qmake_args} 265 "${qmake_args[@]}"
260 266
261 # was qmake successful? 267 # was qmake successful?
262 if ! eend $? ; then 268 if ! eend $? ; then
263 echo 269 echo
264 eerror "Running qmake has failed! (see above for details)" 270 eerror "Running qmake has failed! (see above for details)"

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.20