diff options
author | Davide Pesavento <davidepesa@gmail.com> | 2012-05-22 01:27:38 +0200 |
---|---|---|
committer | Davide Pesavento <davidepesa@gmail.com> | 2012-05-22 01:27:38 +0200 |
commit | ef2109df4cd719ce0d14760b5df18a825772d71f (patch) | |
tree | be325e993243f810fb0d2ae41e9689c7149fcebc | |
parent | Remove broken and unmaintained qxmledit live ebuild. (diff) | |
download | qt-ef2109df4cd719ce0d14760b5df18a825772d71f.tar.gz qt-ef2109df4cd719ce0d14760b5df18a825772d71f.tar.bz2 qt-ef2109df4cd719ce0d14760b5df18a825772d71f.zip |
[qt4-r2.eclass] Improvements to qt4-r2_src_install().
Allow DOCS to be an array variable, add support for HTML_DOCS. The
implementation is mostly copied from cmake-utils and base eclasses.
Remove support for DOCSDIR (used by only 2 ebuilds in the tree).
Improve variables documentation.
-rw-r--r-- | eclass/qt4-r2.eclass | 83 |
1 files changed, 46 insertions, 37 deletions
diff --git a/eclass/qt4-r2.eclass b/eclass/qt4-r2.eclass index c8b007d0..362ceaf1 100644 --- a/eclass/qt4-r2.eclass +++ b/eclass/qt4-r2.eclass @@ -19,16 +19,30 @@ 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: # In case your Qt4 application provides various translations, use this variable # to specify them in order to populate "linguas_*" IUSE automatically. Make sure # that you set this variable before inheriting qt4-r2 eclass. -# Example: -# @CODE -# LANGS="en el de" -# @CODE +# +# Example: LANGS="de el it ja" for x in ${LANGS}; do IUSE+=" linguas_${x}" done @@ -36,14 +50,31 @@ done # @ECLASS-VARIABLE: LANGSLONG # @DEFAULT_UNSET # @DESCRIPTION: -# Same as above, but this variable is for LINGUAS that must be in long format. +# Same as LANGS, but this variable is for LINGUAS that must be in long format. # Remember to set this variable before inheriting qt4-r2 eclass. # Look at ${PORTDIR}/profiles/desc/linguas.desc for details. +# +# Example: LANGSLONG="en_GB ru_RU" for x in ${LANGSLONG}; do IUSE+=" linguas_${x%_*}" 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}/patches_folder/" +# ) +# @CODE + # @FUNCTION: qt4-r2_src_unpack # @DESCRIPTION: # Default src_unpack function for packages that depend on qt4. If you have to @@ -64,17 +95,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 @@ -113,34 +133,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, -# documentation (via DOCS variable) and translations (via LANGS and -# LANGSLONG variables). +# documentation (via DOCS and HTML_DOCS variables) and translations (via LANGS +# and LANGSLONG 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 # install translations # need to have specified LANGS or LANGSLONG for this to work |