summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eclass/ChangeLog5
-rw-r--r--eclass/qt4-r2.eclass74
2 files changed, 46 insertions, 33 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 969233408ed2..d764f5d77bf6 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for eclass directory
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.349 2012/07/23 12:44:06 yngwin Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.350 2012/07/23 12:53:13 yngwin Exp $
+
+ 23 Jul 2012; Ben de Groot <yngwin@gentoo.org> qt4-r2.eclass:
+ Add array variables for DOCS and HTML_DOCS in qt4-r2.eclass
23 Jul 2012; Ben de Groot <yngwin@gentoo.org> +l10n.eclass:
Initial commit of l10n.eclass
diff --git a/eclass/qt4-r2.eclass b/eclass/qt4-r2.eclass
index e992f7b3d7c4..50dc6934a138 100644
--- a/eclass/qt4-r2.eclass
+++ b/eclass/qt4-r2.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-r2.eclass,v 1.20 2012/04/19 22:43:40 pesa Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-r2.eclass,v 1.21 2012/07/23 12:53:13 yngwin Exp $
# @ECLASS: qt4-r2.eclass
# @MAINTAINER:
@@ -19,6 +19,22 @@ inherit base eutils multilib toolchain-funcs
export XDG_CONFIG_HOME="${T}"
+# @ECLASS-VARIABLE: DOCS
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Array containing documents passed to dodoc command.
+# Paths can be absolute or relative to ${S}.
+#
+# Example: DOCS=( ChangeLog README "${WORKDIR}/doc_folder/" )
+
+# @ECLASS-VARIABLE: HTML_DOCS
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Array containing documents passed to dohtml command.
+# Paths can be absolute or relative to ${S}.
+#
+# Example: HTML_DOCS=( "doc/document.html" "${WORKDIR}/html_folder/" )
+
# @ECLASS-VARIABLE: LANGS
# @DEFAULT_UNSET
# @DESCRIPTION:
@@ -44,6 +60,21 @@ for x in ${LANGSLONG}; do
done
unset x
+# @ECLASS-VARIABLE: PATCHES
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Array variable containing all the patches to be applied. This variable
+# is expected to be defined in the global scope of ebuilds. Make sure to
+# specify the full path. This variable is used in src_prepare phase.
+#
+# Example:
+# @CODE
+# PATCHES=(
+# "${FILESDIR}/mypatch.patch"
+# "${FILESDIR}/mypatch2.patch"
+# )
+# @CODE
+
# @FUNCTION: qt4-r2_src_unpack
# @DESCRIPTION:
# Default src_unpack function for packages that depend on qt4. If you have to
@@ -55,17 +86,6 @@ qt4-r2_src_unpack() {
base_src_unpack "$@"
}
-# @ECLASS-VARIABLE: PATCHES
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# In case you have patches to apply, specify them here. Make sure to
-# specify the full path. This variable is used in src_prepare phase.
-# Example:
-# @CODE
-# PATCHES=( "${FILESDIR}"/mypatch.patch
-# "${FILESDIR}"/mypatch2.patch )
-# @CODE
-
# @FUNCTION: qt4-r2_src_prepare
# @DESCRIPTION:
# Default src_prepare function for packages that depend on qt4. If you have to
@@ -104,33 +124,23 @@ qt4-r2_src_compile() {
base_src_compile "$@"
}
-# @ECLASS-VARIABLE: DOCS
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# Use this variable if you want to install any documentation.
-# Example:
-# @CODE
-# DOCS="README AUTHORS"
-# @CODE
-
-# @ECLASS-VARIABLE: DOCSDIR
-# @DESCRIPTION:
-# Directory containing documentation, defaults to ${S}.
-
# @FUNCTION: qt4-r2_src_install
# @DESCRIPTION:
# Default src_install function for qt4-based packages. Installs compiled code
-# and misc documentation (via DOCS variable).
+# documentation (via DOCS and HTML_DOCS variables).
+
qt4-r2_src_install() {
debug-print-function $FUNCNAME "$@"
- emake INSTALL_ROOT="${D}" DESTDIR="${D}" install || die "emake install failed"
+ base_src_install INSTALL_ROOT="${D}" "$@"
- # install documentation
- local doc= dir=${DOCSDIR:-${S}}
- for doc in ${DOCS}; do
- dodoc "${dir}/${doc}" || die "dodoc failed"
- done
+ # backward compatibility for non-array variables
+ if [[ -n ${DOCS} ]] && [[ "$(declare -p DOCS 2>/dev/null 2>&1)" != "declare -a"* ]]; then
+ dodoc ${DOCS} || die "dodoc failed"
+ fi
+ if [[ -n ${HTML_DOCS} ]] && [[ "$(declare -p HTML_DOCS 2>/dev/null 2>&1)" != "declare -a"* ]]; then
+ dohtml -r ${HTML_DOCS} || die "dohtml failed"
+ fi
}
# Internal function, used by eqmake4 and qt4-r2_src_configure