/[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.14 Revision 1.15
1# Copyright 1999-2011 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.14 2011/11/12 20:46:39 pesa Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-r2.eclass,v 1.15 2011/12/26 11:47:47 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.
9# @DESCRIPTION: 9# @DESCRIPTION:
10# This eclass contains various functions that may be useful when 10# This eclass contains various functions that may be useful when
11# dealing with packages using Qt4 libraries. Requires EAPI=2 or later. 11# dealing with packages using Qt4 libraries. Requires EAPI=2 or later.
12 12
13case ${EAPI} in 13case ${EAPI} in
14 2|3|4) : ;; 14 2|3|4) : ;;
15 *) die "EAPI=${EAPI} is not supported by ${ECLASS} eclass." ;; 15 *) die "EAPI=${EAPI} is not supported by ${ECLASS} eclass." ;;
16esac 16esac
17 17
18inherit base eutils multilib toolchain-funcs 18inherit base eutils multilib toolchain-funcs
19 19
20export XDG_CONFIG_HOME="${T}" 20export XDG_CONFIG_HOME="${T}"
21 21
22# @ECLASS-VARIABLE: LANGS 22# @ECLASS-VARIABLE: LANGS
23# @DEFAULT_UNSET
23# @DESCRIPTION: 24# @DESCRIPTION:
24# In case your Qt4 application provides various translations, use this variable 25# In case your Qt4 application provides various translations, use this variable
25# to specify them in order to populate "linguas_*" IUSE automatically. Make sure 26# to specify them in order to populate "linguas_*" IUSE automatically. Make sure
26# that you set this variable BEFORE inheriting qt4-r2 eclass. 27# that you set this variable before inheriting qt4-r2 eclass.
28# Example:
29# @CODE
27# example: LANGS="en el de" 30# LANGS="en el de"
31# @CODE
28for x in ${LANGS}; do 32for x in ${LANGS}; do
29 IUSE="${IUSE} linguas_${x}" 33 IUSE="${IUSE} linguas_${x}"
30done 34done
31 35
32# @ECLASS-VARIABLE: LANGSLONG 36# @ECLASS-VARIABLE: LANGSLONG
37# @DEFAULT_UNSET
33# @DESCRIPTION: 38# @DESCRIPTION:
34# Same as above, but this variable is for LINGUAS that must be in long format. 39# Same as above, but this variable is for LINGUAS that must be in long format.
35# Remember to set this variable BEFORE inheriting qt4-r2 eclass. 40# Remember to set this variable before inheriting qt4-r2 eclass.
36# Look at ${PORTDIR}/profiles/desc/linguas.desc for details. 41# Look at ${PORTDIR}/profiles/desc/linguas.desc for details.
37for x in ${LANGSLONG}; do 42for x in ${LANGSLONG}; do
38 IUSE="${IUSE} linguas_${x%_*}" 43 IUSE="${IUSE} linguas_${x%_*}"
39done 44done
40 45
61 S="${WORKDIR}/${MY_P}" 66 S="${WORKDIR}/${MY_P}"
62 fi 67 fi
63} 68}
64 69
65# @ECLASS-VARIABLE: PATCHES 70# @ECLASS-VARIABLE: PATCHES
71# @DEFAULT_UNSET
66# @DESCRIPTION: 72# @DESCRIPTION:
67# In case you have patches to apply, specify them in PATCHES variable. Make sure 73# In case you have patches to apply, specify them here. Make sure to
68# to specify the full path. This variable is used in src_prepare phase. 74# specify the full path. This variable is used in src_prepare phase.
69# example: 75# Example:
76# @CODE
70# PATCHES=( "${FILESDIR}"/mypatch.patch 77# PATCHES=( "${FILESDIR}"/mypatch.patch
71# "${FILESDIR}"/mypatch2.patch ) 78# "${FILESDIR}"/mypatch2.patch )
79# @CODE
72 80
73# @FUNCTION: qt4-r2_src_prepare 81# @FUNCTION: qt4-r2_src_prepare
74# @DESCRIPTION: 82# @DESCRIPTION:
75# Default src_prepare function for packages that depend on qt4. If you have to 83# Default src_prepare function for packages that depend on qt4. If you have to
76# override src_prepare in your ebuild, you should call qt4-r2_src_prepare in it, 84# override src_prepare in your ebuild, you should call qt4-r2_src_prepare in it,
107 115
108 base_src_compile "$@" 116 base_src_compile "$@"
109} 117}
110 118
111# @ECLASS-VARIABLE: DOCS 119# @ECLASS-VARIABLE: DOCS
120# @DEFAULT_UNSET
112# @DESCRIPTION: 121# @DESCRIPTION:
113# Use this variable if you want to install any documentation. 122# Use this variable if you want to install any documentation.
123# Example:
124# @CODE
114# example: DOCS="README AUTHORS" 125# DOCS="README AUTHORS"
126# @CODE
115 127
116# @ECLASS-VARIABLE: DOCSDIR 128# @ECLASS-VARIABLE: DOCSDIR
117# @DESCRIPTION: 129# @DESCRIPTION:
118# Directory containing documentation. If not specified, ${S} will be used 130# Directory containing documentation, defaults to ${S}.
119# instead. 131DOCSDIR="${DOCSDIR:-${S}}"
120 132
121# @FUNCTION: qt4-r2_src_install 133# @FUNCTION: qt4-r2_src_install
122# @DESCRIPTION: 134# @DESCRIPTION:
123# Default src_install function for qt4-based packages. Installs compiled code, 135# Default src_install function for qt4-based packages. Installs compiled code
124# documentation (via DOCS variable) and translations (via LANGS and 136# and misc documentation (via DOCS variable).
125# LANGSLONG variables).
126qt4-r2_src_install() { 137qt4-r2_src_install() {
127 debug-print-function $FUNCNAME "$@" 138 debug-print-function $FUNCNAME "$@"
128 139
129 emake INSTALL_ROOT="${D}" DESTDIR="${D}" install || die "emake install failed" 140 emake INSTALL_ROOT="${D}" DESTDIR="${D}" install || die "emake install failed"
130 141
131 # install documentation 142 # install documentation
132 if [[ -n ${DOCS} ]]; then 143 local doc
133 local dir=${DOCSDIR:-${S}}
134 for doc in ${DOCS}; do 144 for doc in ${DOCS}; do
135 dodoc "${dir}/${doc}" || die "dodoc failed" 145 dodoc "${DOCSDIR}/${doc}" || die "dodoc failed"
136 done 146 done
137 fi
138} 147}
139 148
140# Internal function, used by eqmake4 and qt4-r2_src_configure 149# Internal function, used by eqmake4 and qt4-r2_src_configure
141# Look for project files: 150# Look for project files:
142# 0 *.pro files found - output null string 151# 0 *.pro files found - output null string
165 ;; 174 ;;
166 esac 175 esac
167} 176}
168 177
169# @FUNCTION: eqmake4 178# @FUNCTION: eqmake4
170# @USAGE: [project file] [parameters to qmake] 179# @USAGE: [project_file] [parameters to qmake]
171# @DESCRIPTION: 180# @DESCRIPTION:
172# Wrapper for Qt4's qmake. If project file isn't specified eqmake4 will 181# Wrapper for Qt4's qmake. If project_file isn't specified, eqmake4 will
173# look for it in current directory (${S}, non-recursively). If more than 182# look for it in the current directory (${S}, non-recursively). If more
174# one project file is found, the ${PN}.pro is processed, provided that it 183# than one project file are found, then ${PN}.pro is processed, provided
175# exists. Otherwise eqmake4 fails. 184# that it exists. Otherwise eqmake4 fails.
185#
176# All the arguments are appended unmodified to qmake command line. For 186# All other arguments are appended unmodified to qmake command line. For
177# recursive build systems, i.e. those based on the subdirs template, you 187# recursive build systems, i.e. those based on the subdirs template, you
178# should run eqmake4 on the top-level project file only, unless you have 188# should run eqmake4 on the top-level project file only, unless you have
179# strong reasons to do things differently. During the building, qmake 189# strong reasons to do things differently. During the building, qmake
180# will be automatically re-invoked with the right arguments on every 190# will be automatically re-invoked with the right arguments on every
181# directory specified inside the top-level project file by the SUBDIRS 191# directory specified inside the top-level project file.
182# variable.
183eqmake4() { 192eqmake4() {
184 ebegin "Running qmake" 193 ebegin "Running qmake"
185 194
186 local qmake_args=("$@") 195 local qmake_args=("$@")
187 196

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

  ViewVC Help
Powered by ViewVC 1.1.20