1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
4 # @ECLASS: qt4-r2.eclass
7 # @BLURB: Eclass for Qt4-based packages, second edition.
9 # This eclass contains various functions that may be useful when
10 # dealing with packages using Qt4 libraries. Supports only EAPIs
11 # 2, 3, 4, and 5. Use qmake-utils.eclass in EAPI 6 and later.
15 6) die "qt4-r2.eclass is banned in EAPI 6 and later" ;;
16 *) die "qt4-r2.eclass: unsupported EAPI=${EAPI:-0}" ;;
19 inherit base eutils qmake-utils
21 export XDG_CONFIG_HOME="${T}"
23 # @ECLASS-VARIABLE: DOCS
26 # Array containing documents passed to dodoc command.
27 # Paths can be absolute or relative to ${S}.
29 # Example: DOCS=( ChangeLog README "${WORKDIR}/doc_folder/" )
31 # @ECLASS-VARIABLE: HTML_DOCS
34 # Array containing documents passed to dohtml command.
35 # Paths can be absolute or relative to ${S}.
37 # Example: HTML_DOCS=( "doc/document.html" "${WORKDIR}/html_folder/" )
39 # @ECLASS-VARIABLE: LANGS
42 # In case your Qt4 application provides various translations, use this variable
43 # to specify them in order to populate "linguas_*" IUSE automatically. Make sure
44 # that you set this variable before inheriting qt4-r2 eclass.
46 # Example: LANGS="de el it ja"
51 # @ECLASS-VARIABLE: LANGSLONG
54 # Same as LANGS, but this variable is for LINGUAS that must be in long format.
55 # Remember to set this variable before inheriting qt4-r2 eclass.
56 # Look at ${PORTDIR}/profiles/desc/linguas.desc for details.
58 # Example: LANGSLONG="en_GB ru_RU"
59 for x in ${LANGSLONG}; do
60 IUSE+=" linguas_${x%_*}"
64 # @ECLASS-VARIABLE: PATCHES
67 # Array variable containing all the patches to be applied. This variable
68 # is expected to be defined in the global scope of ebuilds. Make sure to
69 # specify the full path. This variable is used in src_prepare phase.
74 # "${FILESDIR}/mypatch.patch"
75 # "${FILESDIR}/mypatch2.patch"
79 # @FUNCTION: qt4-r2_src_unpack
81 # Default src_unpack function for packages that depend on qt4. If you have to
82 # override src_unpack in your ebuild (probably you don't need to), call
83 # qt4-r2_src_unpack in it.
85 debug-print-function $FUNCNAME "$@"
90 # @FUNCTION: qt4-r2_src_prepare
92 # Default src_prepare function for packages that depend on qt4. If you have to
93 # override src_prepare in your ebuild, you should call qt4-r2_src_prepare in it,
94 # otherwise autopatcher will not work!
95 qt4-r2_src_prepare() {
96 debug-print-function $FUNCNAME "$@"
101 # @FUNCTION: qt4-r2_src_configure
103 # Default src_configure function for packages that depend on qt4. If you have to
104 # override src_configure in your ebuild, call qt4-r2_src_configure in it.
105 qt4-r2_src_configure() {
106 debug-print-function $FUNCNAME "$@"
108 local project_file=$(qmake-utils_find_pro_file)
110 if [[ -n ${project_file} ]]; then
111 eqmake4 "${project_file}"
113 base_src_configure "$@"
117 # @FUNCTION: qt4-r2_src_compile
119 # Default src_compile function for packages that depend on qt4. If you have to
120 # override src_compile in your ebuild (probably you don't need to), call
121 # qt4-r2_src_compile in it.
122 qt4-r2_src_compile() {
123 debug-print-function $FUNCNAME "$@"
125 base_src_compile "$@"
128 # @FUNCTION: qt4-r2_src_install
130 # Default src_install function for qt4-based packages. Installs compiled code,
131 # and documentation (via DOCS and HTML_DOCS variables).
132 qt4-r2_src_install() {
133 debug-print-function $FUNCNAME "$@"
135 base_src_install INSTALL_ROOT="${D}" "$@"
139 EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install