public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] RFC: using array variables in qt4-r2.eclass
@ 2012-07-13 12:02 Ben de Groot
  2012-07-13 12:34 ` Alexis Ballier
  0 siblings, 1 reply; 11+ messages in thread
From: Ben de Groot @ 2012-07-13 12:02 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 325 bytes --]

Hi,

We'd like to start using array variables for DOCS and HTML_DOCS in
qt4-r2.eclass, as they are already more widely used in other eclasses.
Please check the attached diff and let us know what you think.

Thanks on behalf of the Qt team!
-- 
Cheers,

Ben | yngwin
Gentoo developer
Gentoo Qt project lead, Gentoo Wiki admin

[-- Attachment #2: qt4-r2.eclass.diff --]
[-- Type: application/octet-stream, Size: 3114 bytes --]

--- /usr/portage/eclass/qt4-r2.eclass	2012-04-20 07:01:13.000000000 +0800
+++ qt4-r2.eclass.new	2012-07-13 19:45:59.259773917 +0800
@@ -19,6 +19,22 @@
 
 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 @@
 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 @@
 	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 @@
 	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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-07-15 16:16 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-13 12:02 [gentoo-dev] RFC: using array variables in qt4-r2.eclass Ben de Groot
2012-07-13 12:34 ` Alexis Ballier
2012-07-13 13:26   ` Davide Pesavento
2012-07-13 13:50     ` Alexis Ballier
2012-07-14 10:29       ` Davide Pesavento
2012-07-14 14:00         ` Michał Górny
2012-07-15 11:00           ` Davide Pesavento
2012-07-15 13:42             ` Michał Górny
2012-07-15 15:36               ` Davide Pesavento
2012-07-15 15:53                 ` Michał Górny
2012-07-15 16:15                   ` Davide Pesavento

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox