/[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.11 Revision 1.14
1# Copyright 1999-2010 Gentoo Foundation 1# Copyright 1999-2011 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.11 2011/03/19 16:34:39 scarabeus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-r2.eclass,v 1.14 2011/11/12 20:46:39 pesa 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# Qt herd <qt@gentoo.org>
8# Markos Chandras <hwoarang@gentoo.org>,
9# Davide Pesavento <davidepesa@gmail.com>,
10# Dominik Kapusta <ayoy@gentoo.org>
11# @BLURB: Eclass for Qt4 packages, second edition 8# @BLURB: Eclass for Qt4-based packages, second edition.
12# @DESCRIPTION: 9# @DESCRIPTION:
13# This eclass contains various functions that may be useful when 10# This eclass contains various functions that may be useful when
14# dealing with packages using Qt4 libraries. Requires EAPI=2. 11# dealing with packages using Qt4 libraries. Requires EAPI=2 or later.
15 12
16case ${EAPI} in 13case ${EAPI} in
17 2|3|4) : ;; 14 2|3|4) : ;;
18 *) die "EAPI=${EAPI} is not supported" ;; 15 *) die "EAPI=${EAPI} is not supported by ${ECLASS} eclass." ;;
19esac 16esac
20 17
21inherit base eutils multilib toolchain-funcs 18inherit base eutils multilib toolchain-funcs
22 19
23export XDG_CONFIG_HOME="${T}" 20export XDG_CONFIG_HOME="${T}"
46# Default src_unpack function for packages that depend on qt4. If you have to 43# Default src_unpack function for packages that depend on qt4. If you have to
47# override src_unpack in your ebuild (probably you don't need to), call 44# override src_unpack in your ebuild (probably you don't need to), call
48# qt4-r2_src_unpack in it. 45# qt4-r2_src_unpack in it.
49qt4-r2_src_unpack() { 46qt4-r2_src_unpack() {
50 debug-print-function $FUNCNAME "$@" 47 debug-print-function $FUNCNAME "$@"
48
51 base_src_unpack "$@" 49 base_src_unpack "$@"
52 50
53 # Fallback to ${WORKDIR}/${MY_P} when ${WORKDIR}/${P} doesn't exist. 51 # Fallback to ${WORKDIR}/${MY_P} when ${WORKDIR}/${P} doesn't exist.
54 # Feel free to re-implement this 52 # This is a hack that was never meant to be used by ebuilds in tree.
55 if [[ "${S}" == "${WORKDIR}/${P}" && ! -d ${S} && -d ${WORKDIR}/${MY_P} ]]; then 53 if [[ ${S} == "${WORKDIR}/${P}" && ! -d ${S} && -d ${WORKDIR}/${MY_P} ]]; then
54 echo
55 eqawarn "*** DEPRECATION NOTICE ***"
56 eqawarn
57 eqawarn "\${S} fallback is deprecated and will be removed on 12/12/2011."
58 eqawarn "Please set the correct value for \${S} variable inside the ebuild."
59 echo
56 ewarn "Falling back to '${WORKDIR}/${MY_P}'" 60 einfo "Falling back to '${WORKDIR}/${MY_P}'"
57 S="${WORKDIR}/${MY_P}" 61 S="${WORKDIR}/${MY_P}"
58 fi 62 fi
59} 63}
60 64
61# @ECLASS-VARIABLE: PATCHES 65# @ECLASS-VARIABLE: PATCHES
63# In case you have patches to apply, specify them in PATCHES variable. Make sure 67# In case you have patches to apply, specify them in PATCHES variable. Make sure
64# to specify the full path. This variable is used in src_prepare phase. 68# to specify the full path. This variable is used in src_prepare phase.
65# example: 69# example:
66# PATCHES=( "${FILESDIR}"/mypatch.patch 70# PATCHES=( "${FILESDIR}"/mypatch.patch
67# "${FILESDIR}"/mypatch2.patch ) 71# "${FILESDIR}"/mypatch2.patch )
68# 72
69# @FUNCTION: qt4-r2_src_prepare 73# @FUNCTION: qt4-r2_src_prepare
70# @DESCRIPTION: 74# @DESCRIPTION:
71# Default src_prepare function for packages that depend on qt4. If you have to 75# Default src_prepare function for packages that depend on qt4. If you have to
72# override src_prepare in your ebuild, you should call qt4-r2_src_prepare in it, 76# override src_prepare in your ebuild, you should call qt4-r2_src_prepare in it,
73# otherwise autopatcher will not work! 77# otherwise autopatcher will not work!
106 110
107# @ECLASS-VARIABLE: DOCS 111# @ECLASS-VARIABLE: DOCS
108# @DESCRIPTION: 112# @DESCRIPTION:
109# Use this variable if you want to install any documentation. 113# Use this variable if you want to install any documentation.
110# example: DOCS="README AUTHORS" 114# example: DOCS="README AUTHORS"
111# 115
112# @ECLASS-VARIABLE: DOCSDIR 116# @ECLASS-VARIABLE: DOCSDIR
113# @DESCRIPTION: 117# @DESCRIPTION:
114# Directory containing documentation. If not specified, ${S} will be used 118# Directory containing documentation. If not specified, ${S} will be used
115# instead. 119# instead.
116# 120
117# @FUNCTION: qt4-r2_src_install 121# @FUNCTION: qt4-r2_src_install
118# @DESCRIPTION: 122# @DESCRIPTION:
119# Default src_install function for qt4-based packages. Installs compiled code, 123# Default src_install function for qt4-based packages. Installs compiled code,
120# documentation (via DOCS variable) and translations (via LANGS and 124# documentation (via DOCS variable) and translations (via LANGS and
121# LANGSLONG variables). 125# LANGSLONG variables).
123 debug-print-function $FUNCNAME "$@" 127 debug-print-function $FUNCNAME "$@"
124 128
125 emake INSTALL_ROOT="${D}" DESTDIR="${D}" install || die "emake install failed" 129 emake INSTALL_ROOT="${D}" DESTDIR="${D}" install || die "emake install failed"
126 130
127 # install documentation 131 # install documentation
128 if [[ -n "${DOCS}" ]]; then 132 if [[ -n ${DOCS} ]]; then
129 local dir=${DOCSDIR:-${S}} 133 local dir=${DOCSDIR:-${S}}
130 for doc in ${DOCS}; do 134 for doc in ${DOCS}; do
131 dodoc "${dir}/${doc}" || die "dodoc failed" 135 dodoc "${dir}/${doc}" || die "dodoc failed"
132 done 136 done
133 fi 137 fi
151 1) 155 1)
152 echo "${pro_files[0]}" 156 echo "${pro_files[0]}"
153 ;; 157 ;;
154 *) 158 *)
155 for pro_file in "${pro_files[@]}"; do 159 for pro_file in "${pro_files[@]}"; do
156 if [[ "${pro_file}" == "${dir_name}" || 160 if [[ ${pro_file} == "${dir_name}" || ${pro_file} == "${PN}.pro" ]]; then
157 "${pro_file}" == "${PN}.pro" ]]; then
158 echo "${pro_file}" 161 echo "${pro_file}"
159 break 162 break
160 fi 163 fi
161 done 164 done
162 ;; 165 ;;
183 local qmake_args=("$@") 186 local qmake_args=("$@")
184 187
185 # check if project file was passed as a first argument 188 # check if project file was passed as a first argument
186 # if not, then search for it 189 # if not, then search for it
187 local regexp='.*\.pro' 190 local regexp='.*\.pro'
188 if ! [[ "${1}" =~ ${regexp} ]]; then 191 if ! [[ ${1} =~ ${regexp} ]]; then
189 local project_file="$(_find_project_file)" 192 local project_file="$(_find_project_file)"
190 if [[ -z "${project_file}" ]]; then 193 if [[ -z ${project_file} ]]; then
191 echo 194 echo
192 eerror "No project file found in ${S}!" 195 eerror "No project file found in ${S}!"
193 eerror "This shouldn't happen - please send a bug report to http://bugs.gentoo.org/" 196 eerror "This shouldn't happen - please send a bug report to http://bugs.gentoo.org/"
194 echo 197 echo
195 die "eqmake4 failed" 198 die "eqmake4 failed"
196 fi 199 fi
197 qmake_args+=("${project_file}") 200 qmake_args+=("${project_file}")
198 fi 201 fi
199 202
200 # make sure CONFIG variable is correctly set for both release and debug builds 203 # make sure CONFIG variable is correctly set
204 # for both release and debug builds
201 local CONFIG_ADD="release" 205 local CONFIG_ADD="release"
202 local CONFIG_REMOVE="debug" 206 local CONFIG_REMOVE="debug"
203 if has debug ${IUSE} && use debug; then 207 if has debug ${IUSE} && use debug; then
204 CONFIG_ADD="debug" 208 CONFIG_ADD="debug"
205 CONFIG_REMOVE="release" 209 CONFIG_REMOVE="release"

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.14

  ViewVC Help
Powered by ViewVC 1.1.20