Gentoo Archives: gentoo-commits

From: Samuel Bernardo <samuelbernardo.mail@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/user/ssnb:master commit in: eclass/
Date: Mon, 10 Sep 2018 17:28:13
Message-Id: 1536600460.d011395592d36de996703a172430ff737fc5d1aa.samuelbernardo@gentoo
1 commit: d011395592d36de996703a172430ff737fc5d1aa
2 Author: Samuel Bernardo <samuelbernardo.mail <AT> gmail <DOT> com>
3 AuthorDate: Mon Sep 10 17:27:40 2018 +0000
4 Commit: Samuel Bernardo <samuelbernardo.mail <AT> gmail <DOT> com>
5 CommitDate: Mon Sep 10 17:27:40 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/user/ssnb.git/commit/?id=d0113955
7
8 add qt4-r2 eclass
9
10 eclass/qt4-r2.eclass | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++
11 1 file changed, 139 insertions(+)
12
13 diff --git a/eclass/qt4-r2.eclass b/eclass/qt4-r2.eclass
14 new file mode 100644
15 index 0000000..d8a7252
16 --- /dev/null
17 +++ b/eclass/qt4-r2.eclass
18 @@ -0,0 +1,139 @@
19 +# Copyright 1999-2015 Gentoo Foundation
20 +# Distributed under the terms of the GNU General Public License v2
21 +
22 +# @ECLASS: qt4-r2.eclass
23 +# @MAINTAINER:
24 +# qt@g.o
25 +# @BLURB: Eclass for Qt4-based packages, second edition.
26 +# @DESCRIPTION:
27 +# This eclass contains various functions that may be useful when
28 +# dealing with packages using Qt4 libraries. Supports only EAPIs
29 +# 2, 3, 4, and 5. Use qmake-utils.eclass in EAPI 6 and later.
30 +
31 +case ${EAPI} in
32 + 2|3|4|5) : ;;
33 + 6) die "qt4-r2.eclass is banned in EAPI 6 and later" ;;
34 + *) die "qt4-r2.eclass: unsupported EAPI=${EAPI:-0}" ;;
35 +esac
36 +
37 +inherit base eutils qmake-utils
38 +
39 +export XDG_CONFIG_HOME="${T}"
40 +
41 +# @ECLASS-VARIABLE: DOCS
42 +# @DEFAULT_UNSET
43 +# @DESCRIPTION:
44 +# Array containing documents passed to dodoc command.
45 +# Paths can be absolute or relative to ${S}.
46 +#
47 +# Example: DOCS=( ChangeLog README "${WORKDIR}/doc_folder/" )
48 +
49 +# @ECLASS-VARIABLE: HTML_DOCS
50 +# @DEFAULT_UNSET
51 +# @DESCRIPTION:
52 +# Array containing documents passed to dohtml command.
53 +# Paths can be absolute or relative to ${S}.
54 +#
55 +# Example: HTML_DOCS=( "doc/document.html" "${WORKDIR}/html_folder/" )
56 +
57 +# @ECLASS-VARIABLE: LANGS
58 +# @DEFAULT_UNSET
59 +# @DESCRIPTION:
60 +# In case your Qt4 application provides various translations, use this variable
61 +# to specify them in order to populate "linguas_*" IUSE automatically. Make sure
62 +# that you set this variable before inheriting qt4-r2 eclass.
63 +#
64 +# Example: LANGS="de el it ja"
65 +for x in ${LANGS}; do
66 + IUSE+=" linguas_${x}"
67 +done
68 +
69 +# @ECLASS-VARIABLE: LANGSLONG
70 +# @DEFAULT_UNSET
71 +# @DESCRIPTION:
72 +# Same as LANGS, but this variable is for LINGUAS that must be in long format.
73 +# Remember to set this variable before inheriting qt4-r2 eclass.
74 +# Look at ${PORTDIR}/profiles/desc/linguas.desc for details.
75 +#
76 +# Example: LANGSLONG="en_GB ru_RU"
77 +for x in ${LANGSLONG}; do
78 + IUSE+=" linguas_${x%_*}"
79 +done
80 +unset x
81 +
82 +# @ECLASS-VARIABLE: PATCHES
83 +# @DEFAULT_UNSET
84 +# @DESCRIPTION:
85 +# Array variable containing all the patches to be applied. This variable
86 +# is expected to be defined in the global scope of ebuilds. Make sure to
87 +# specify the full path. This variable is used in src_prepare phase.
88 +#
89 +# Example:
90 +# @CODE
91 +# PATCHES=(
92 +# "${FILESDIR}/mypatch.patch"
93 +# "${FILESDIR}/mypatch2.patch"
94 +# )
95 +# @CODE
96 +
97 +# @FUNCTION: qt4-r2_src_unpack
98 +# @DESCRIPTION:
99 +# Default src_unpack function for packages that depend on qt4. If you have to
100 +# override src_unpack in your ebuild (probably you don't need to), call
101 +# qt4-r2_src_unpack in it.
102 +qt4-r2_src_unpack() {
103 + debug-print-function $FUNCNAME "$@"
104 +
105 + base_src_unpack "$@"
106 +}
107 +
108 +# @FUNCTION: qt4-r2_src_prepare
109 +# @DESCRIPTION:
110 +# Default src_prepare function for packages that depend on qt4. If you have to
111 +# override src_prepare in your ebuild, you should call qt4-r2_src_prepare in it,
112 +# otherwise autopatcher will not work!
113 +qt4-r2_src_prepare() {
114 + debug-print-function $FUNCNAME "$@"
115 +
116 + base_src_prepare "$@"
117 +}
118 +
119 +# @FUNCTION: qt4-r2_src_configure
120 +# @DESCRIPTION:
121 +# Default src_configure function for packages that depend on qt4. If you have to
122 +# override src_configure in your ebuild, call qt4-r2_src_configure in it.
123 +qt4-r2_src_configure() {
124 + debug-print-function $FUNCNAME "$@"
125 +
126 + local project_file=$(qmake-utils_find_pro_file)
127 +
128 + if [[ -n ${project_file} ]]; then
129 + eqmake4 "${project_file}"
130 + else
131 + base_src_configure "$@"
132 + fi
133 +}
134 +
135 +# @FUNCTION: qt4-r2_src_compile
136 +# @DESCRIPTION:
137 +# Default src_compile function for packages that depend on qt4. If you have to
138 +# override src_compile in your ebuild (probably you don't need to), call
139 +# qt4-r2_src_compile in it.
140 +qt4-r2_src_compile() {
141 + debug-print-function $FUNCNAME "$@"
142 +
143 + base_src_compile "$@"
144 +}
145 +
146 +# @FUNCTION: qt4-r2_src_install
147 +# @DESCRIPTION:
148 +# Default src_install function for qt4-based packages. Installs compiled code,
149 +# and documentation (via DOCS and HTML_DOCS variables).
150 +qt4-r2_src_install() {
151 + debug-print-function $FUNCNAME "$@"
152 +
153 + base_src_install INSTALL_ROOT="${D}" "$@"
154 + einstalldocs
155 +}
156 +
157 +EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install