| 1 | # Copyright 1999-2011 Gentoo Foundation |
1 | # Copyright 1999-2012 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/qt4-r2.eclass,v 1.15 2011/12/26 11:47:47 pesa Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/qt4-r2.eclass,v 1.24 2012/11/08 09:42:51 pesa Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: qt4-r2.eclass |
5 | # @ECLASS: qt4-r2.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # Qt herd <qt@gentoo.org> |
7 | # Qt herd <qt@gentoo.org> |
| 8 | # @BLURB: Eclass for Qt4-based packages, second edition. |
8 | # @BLURB: Eclass for Qt4-based packages, second edition. |
| 9 | # @DESCRIPTION: |
9 | # @DESCRIPTION: |
| 10 | # This eclass contains various functions that may be useful when |
10 | # This eclass contains various functions that may be useful when |
| 11 | # dealing with packages using Qt4 libraries. Requires EAPI=2 or later. |
11 | # dealing with packages using Qt4 libraries. Requires EAPI=2 or later. |
| 12 | |
12 | |
| 13 | case ${EAPI} in |
13 | case ${EAPI} in |
| 14 | 2|3|4) : ;; |
14 | 2|3|4|5) : ;; |
| 15 | *) die "EAPI=${EAPI} is not supported by ${ECLASS} eclass." ;; |
15 | *) die "qt4-r2.eclass: unsupported EAPI=${EAPI:-0}" ;; |
| 16 | esac |
16 | esac |
| 17 | |
17 | |
| 18 | inherit base eutils multilib toolchain-funcs |
18 | inherit base eutils multilib toolchain-funcs |
| 19 | |
19 | |
| 20 | export XDG_CONFIG_HOME="${T}" |
20 | export XDG_CONFIG_HOME="${T}" |
|
|
21 | |
|
|
22 | # @ECLASS-VARIABLE: DOCS |
|
|
23 | # @DEFAULT_UNSET |
|
|
24 | # @DESCRIPTION: |
|
|
25 | # Array containing documents passed to dodoc command. |
|
|
26 | # Paths can be absolute or relative to ${S}. |
|
|
27 | # |
|
|
28 | # Example: DOCS=( ChangeLog README "${WORKDIR}/doc_folder/" ) |
|
|
29 | |
|
|
30 | # @ECLASS-VARIABLE: HTML_DOCS |
|
|
31 | # @DEFAULT_UNSET |
|
|
32 | # @DESCRIPTION: |
|
|
33 | # Array containing documents passed to dohtml command. |
|
|
34 | # Paths can be absolute or relative to ${S}. |
|
|
35 | # |
|
|
36 | # Example: HTML_DOCS=( "doc/document.html" "${WORKDIR}/html_folder/" ) |
| 21 | |
37 | |
| 22 | # @ECLASS-VARIABLE: LANGS |
38 | # @ECLASS-VARIABLE: LANGS |
| 23 | # @DEFAULT_UNSET |
39 | # @DEFAULT_UNSET |
| 24 | # @DESCRIPTION: |
40 | # @DESCRIPTION: |
| 25 | # In case your Qt4 application provides various translations, use this variable |
41 | # In case your Qt4 application provides various translations, use this variable |
| 26 | # to specify them in order to populate "linguas_*" IUSE automatically. Make sure |
42 | # to specify them in order to populate "linguas_*" IUSE automatically. Make sure |
| 27 | # that you set this variable before inheriting qt4-r2 eclass. |
43 | # that you set this variable before inheriting qt4-r2 eclass. |
|
|
44 | # |
|
|
45 | # Example: LANGS="de el it ja" |
|
|
46 | for x in ${LANGS}; do |
|
|
47 | IUSE+=" linguas_${x}" |
|
|
48 | done |
|
|
49 | |
|
|
50 | # @ECLASS-VARIABLE: LANGSLONG |
|
|
51 | # @DEFAULT_UNSET |
|
|
52 | # @DESCRIPTION: |
|
|
53 | # Same as LANGS, but this variable is for LINGUAS that must be in long format. |
|
|
54 | # Remember to set this variable before inheriting qt4-r2 eclass. |
|
|
55 | # Look at ${PORTDIR}/profiles/desc/linguas.desc for details. |
|
|
56 | # |
|
|
57 | # Example: LANGSLONG="en_GB ru_RU" |
|
|
58 | for x in ${LANGSLONG}; do |
|
|
59 | IUSE+=" linguas_${x%_*}" |
|
|
60 | done |
|
|
61 | unset x |
|
|
62 | |
|
|
63 | # @ECLASS-VARIABLE: PATCHES |
|
|
64 | # @DEFAULT_UNSET |
|
|
65 | # @DESCRIPTION: |
|
|
66 | # Array variable containing all the patches to be applied. This variable |
|
|
67 | # is expected to be defined in the global scope of ebuilds. Make sure to |
|
|
68 | # specify the full path. This variable is used in src_prepare phase. |
|
|
69 | # |
| 28 | # Example: |
70 | # Example: |
| 29 | # @CODE |
71 | # @CODE |
| 30 | # LANGS="en el de" |
72 | # PATCHES=( |
|
|
73 | # "${FILESDIR}/mypatch.patch" |
|
|
74 | # "${FILESDIR}/mypatch2.patch" |
|
|
75 | # ) |
| 31 | # @CODE |
76 | # @CODE |
| 32 | for x in ${LANGS}; do |
|
|
| 33 | IUSE="${IUSE} linguas_${x}" |
|
|
| 34 | done |
|
|
| 35 | |
|
|
| 36 | # @ECLASS-VARIABLE: LANGSLONG |
|
|
| 37 | # @DEFAULT_UNSET |
|
|
| 38 | # @DESCRIPTION: |
|
|
| 39 | # Same as above, but this variable is for LINGUAS that must be in long format. |
|
|
| 40 | # Remember to set this variable before inheriting qt4-r2 eclass. |
|
|
| 41 | # Look at ${PORTDIR}/profiles/desc/linguas.desc for details. |
|
|
| 42 | for x in ${LANGSLONG}; do |
|
|
| 43 | IUSE="${IUSE} linguas_${x%_*}" |
|
|
| 44 | done |
|
|
| 45 | |
77 | |
| 46 | # @FUNCTION: qt4-r2_src_unpack |
78 | # @FUNCTION: qt4-r2_src_unpack |
| 47 | # @DESCRIPTION: |
79 | # @DESCRIPTION: |
| 48 | # Default src_unpack function for packages that depend on qt4. If you have to |
80 | # Default src_unpack function for packages that depend on qt4. If you have to |
| 49 | # override src_unpack in your ebuild (probably you don't need to), call |
81 | # override src_unpack in your ebuild (probably you don't need to), call |
| 50 | # qt4-r2_src_unpack in it. |
82 | # qt4-r2_src_unpack in it. |
| 51 | qt4-r2_src_unpack() { |
83 | qt4-r2_src_unpack() { |
| 52 | debug-print-function $FUNCNAME "$@" |
84 | debug-print-function $FUNCNAME "$@" |
| 53 | |
85 | |
| 54 | base_src_unpack "$@" |
86 | base_src_unpack "$@" |
| 55 | |
|
|
| 56 | # Fallback to ${WORKDIR}/${MY_P} when ${WORKDIR}/${P} doesn't exist. |
|
|
| 57 | # This is a hack that was never meant to be used by ebuilds in tree. |
|
|
| 58 | if [[ ${S} == "${WORKDIR}/${P}" && ! -d ${S} && -d ${WORKDIR}/${MY_P} ]]; then |
|
|
| 59 | echo |
|
|
| 60 | eqawarn "*** DEPRECATION NOTICE ***" |
|
|
| 61 | eqawarn |
|
|
| 62 | eqawarn "\${S} fallback is deprecated and will be removed on 12/12/2011." |
|
|
| 63 | eqawarn "Please set the correct value for \${S} variable inside the ebuild." |
|
|
| 64 | echo |
|
|
| 65 | einfo "Falling back to '${WORKDIR}/${MY_P}'" |
|
|
| 66 | S="${WORKDIR}/${MY_P}" |
|
|
| 67 | fi |
|
|
| 68 | } |
87 | } |
| 69 | |
|
|
| 70 | # @ECLASS-VARIABLE: PATCHES |
|
|
| 71 | # @DEFAULT_UNSET |
|
|
| 72 | # @DESCRIPTION: |
|
|
| 73 | # In case you have patches to apply, specify them here. Make sure to |
|
|
| 74 | # specify the full path. This variable is used in src_prepare phase. |
|
|
| 75 | # Example: |
|
|
| 76 | # @CODE |
|
|
| 77 | # PATCHES=( "${FILESDIR}"/mypatch.patch |
|
|
| 78 | # "${FILESDIR}"/mypatch2.patch ) |
|
|
| 79 | # @CODE |
|
|
| 80 | |
88 | |
| 81 | # @FUNCTION: qt4-r2_src_prepare |
89 | # @FUNCTION: qt4-r2_src_prepare |
| 82 | # @DESCRIPTION: |
90 | # @DESCRIPTION: |
| 83 | # Default src_prepare function for packages that depend on qt4. If you have to |
91 | # Default src_prepare function for packages that depend on qt4. If you have to |
| 84 | # override src_prepare in your ebuild, you should call qt4-r2_src_prepare in it, |
92 | # override src_prepare in your ebuild, you should call qt4-r2_src_prepare in it, |
| … | |
… | |
| 94 | # Default src_configure function for packages that depend on qt4. If you have to |
102 | # Default src_configure function for packages that depend on qt4. If you have to |
| 95 | # override src_configure in your ebuild, call qt4-r2_src_configure in it. |
103 | # override src_configure in your ebuild, call qt4-r2_src_configure in it. |
| 96 | qt4-r2_src_configure() { |
104 | qt4-r2_src_configure() { |
| 97 | debug-print-function $FUNCNAME "$@" |
105 | debug-print-function $FUNCNAME "$@" |
| 98 | |
106 | |
| 99 | local project_file="$(_find_project_file)" |
107 | local project_file=$(_find_project_file) |
| 100 | |
108 | |
| 101 | if [[ -n ${project_file} ]]; then |
109 | if [[ -n ${project_file} ]]; then |
| 102 | eqmake4 ${project_file} |
110 | eqmake4 "${project_file}" |
| 103 | else |
111 | else |
| 104 | base_src_configure "$@" |
112 | base_src_configure "$@" |
| 105 | fi |
113 | fi |
| 106 | } |
114 | } |
| 107 | |
115 | |
| … | |
… | |
| 114 | debug-print-function $FUNCNAME "$@" |
122 | debug-print-function $FUNCNAME "$@" |
| 115 | |
123 | |
| 116 | base_src_compile "$@" |
124 | base_src_compile "$@" |
| 117 | } |
125 | } |
| 118 | |
126 | |
| 119 | # @ECLASS-VARIABLE: DOCS |
|
|
| 120 | # @DEFAULT_UNSET |
|
|
| 121 | # @DESCRIPTION: |
|
|
| 122 | # Use this variable if you want to install any documentation. |
|
|
| 123 | # Example: |
|
|
| 124 | # @CODE |
|
|
| 125 | # DOCS="README AUTHORS" |
|
|
| 126 | # @CODE |
|
|
| 127 | |
|
|
| 128 | # @ECLASS-VARIABLE: DOCSDIR |
|
|
| 129 | # @DESCRIPTION: |
|
|
| 130 | # Directory containing documentation, defaults to ${S}. |
|
|
| 131 | DOCSDIR="${DOCSDIR:-${S}}" |
|
|
| 132 | |
|
|
| 133 | # @FUNCTION: qt4-r2_src_install |
127 | # @FUNCTION: qt4-r2_src_install |
| 134 | # @DESCRIPTION: |
128 | # @DESCRIPTION: |
| 135 | # Default src_install function for qt4-based packages. Installs compiled code |
129 | # Default src_install function for qt4-based packages. Installs compiled code, |
| 136 | # and misc documentation (via DOCS variable). |
130 | # documentation (via DOCS and HTML_DOCS variables). |
|
|
131 | |
| 137 | qt4-r2_src_install() { |
132 | qt4-r2_src_install() { |
| 138 | debug-print-function $FUNCNAME "$@" |
133 | debug-print-function $FUNCNAME "$@" |
| 139 | |
134 | |
| 140 | emake INSTALL_ROOT="${D}" DESTDIR="${D}" install || die "emake install failed" |
135 | base_src_install INSTALL_ROOT="${D}" "$@" |
| 141 | |
136 | |
| 142 | # install documentation |
137 | # backward compatibility for non-array variables |
| 143 | local doc |
138 | if [[ -n ${DOCS} ]] && [[ "$(declare -p DOCS 2>/dev/null 2>&1)" != "declare -a"* ]]; then |
| 144 | for doc in ${DOCS}; do |
|
|
| 145 | dodoc "${DOCSDIR}/${doc}" || die "dodoc failed" |
139 | dodoc ${DOCS} || die "dodoc failed" |
| 146 | done |
|
|
| 147 | } |
|
|
| 148 | |
|
|
| 149 | # Internal function, used by eqmake4 and qt4-r2_src_configure |
|
|
| 150 | # Look for project files: |
|
|
| 151 | # 0 *.pro files found - output null string |
|
|
| 152 | # 1 *.pro file found - output its name |
|
|
| 153 | # 2 or more *.pro files found - if ${PN}.pro or $(basename ${S}).pro |
|
|
| 154 | # are there, output any of them |
|
|
| 155 | # Outputs a project file argument used by eqmake4. Sets nullglob locally |
|
|
| 156 | # to avoid expanding *.pro as "*.pro" when there are no matching files. |
|
|
| 157 | _find_project_file() { |
|
|
| 158 | shopt -s nullglob |
|
|
| 159 | local pro_files=(*.pro) |
|
|
| 160 | shopt -u nullglob |
|
|
| 161 | local dir_name="$(basename ${S})" |
|
|
| 162 | |
|
|
| 163 | case ${#pro_files[@]} in |
|
|
| 164 | 1) |
|
|
| 165 | echo "${pro_files[0]}" |
|
|
| 166 | ;; |
|
|
| 167 | *) |
|
|
| 168 | for pro_file in "${pro_files[@]}"; do |
|
|
| 169 | if [[ ${pro_file} == "${dir_name}" || ${pro_file} == "${PN}.pro" ]]; then |
|
|
| 170 | echo "${pro_file}" |
|
|
| 171 | break |
|
|
| 172 | fi |
140 | fi |
| 173 | done |
141 | if [[ -n ${HTML_DOCS} ]] && [[ "$(declare -p HTML_DOCS 2>/dev/null 2>&1)" != "declare -a"* ]]; then |
| 174 | ;; |
142 | dohtml -r ${HTML_DOCS} || die "dohtml failed" |
| 175 | esac |
143 | fi |
| 176 | } |
144 | } |
| 177 | |
145 | |
| 178 | # @FUNCTION: eqmake4 |
146 | # @FUNCTION: eqmake4 |
| 179 | # @USAGE: [project_file] [parameters to qmake] |
147 | # @USAGE: [project_file] [parameters to qmake] |
| 180 | # @DESCRIPTION: |
148 | # @DESCRIPTION: |
| … | |
… | |
| 188 | # should run eqmake4 on the top-level project file only, unless you have |
156 | # should run eqmake4 on the top-level project file only, unless you have |
| 189 | # strong reasons to do things differently. During the building, qmake |
157 | # strong reasons to do things differently. During the building, qmake |
| 190 | # will be automatically re-invoked with the right arguments on every |
158 | # will be automatically re-invoked with the right arguments on every |
| 191 | # directory specified inside the top-level project file. |
159 | # directory specified inside the top-level project file. |
| 192 | eqmake4() { |
160 | eqmake4() { |
|
|
161 | [[ ${EAPI} == 2 ]] && use !prefix && EPREFIX= |
|
|
162 | |
| 193 | ebegin "Running qmake" |
163 | ebegin "Running qmake" |
| 194 | |
164 | |
| 195 | local qmake_args=("$@") |
165 | local qmake_args=("$@") |
| 196 | |
166 | |
| 197 | # check if project file was passed as a first argument |
167 | # check if project file was passed as a first argument |
| 198 | # if not, then search for it |
168 | # if not, then search for it |
| 199 | local regexp='.*\.pro' |
169 | local regexp='.*\.pro' |
| 200 | if ! [[ ${1} =~ ${regexp} ]]; then |
170 | if ! [[ ${1} =~ ${regexp} ]]; then |
| 201 | local project_file="$(_find_project_file)" |
171 | local project_file=$(_find_project_file) |
| 202 | if [[ -z ${project_file} ]]; then |
172 | if [[ -z ${project_file} ]]; then |
| 203 | echo |
173 | echo |
| 204 | eerror "No project file found in ${S}!" |
174 | eerror "No project files found in '${PWD}'!" |
| 205 | eerror "This shouldn't happen - please send a bug report to http://bugs.gentoo.org/" |
175 | eerror "This shouldn't happen - please send a bug report to http://bugs.gentoo.org/" |
| 206 | echo |
176 | echo |
| 207 | die "eqmake4 failed" |
177 | die "eqmake4 failed" |
| 208 | fi |
178 | fi |
| 209 | qmake_args+=("${project_file}") |
179 | qmake_args+=("${project_file}") |
| 210 | fi |
180 | fi |
| 211 | |
181 | |
| 212 | # make sure CONFIG variable is correctly set |
182 | # make sure CONFIG variable is correctly set |
| 213 | # for both release and debug builds |
183 | # for both release and debug builds |
| 214 | local CONFIG_ADD="release" |
184 | local config_add="release" |
| 215 | local CONFIG_REMOVE="debug" |
185 | local config_remove="debug" |
| 216 | if has debug ${IUSE} && use debug; then |
186 | if has debug ${IUSE} && use debug; then |
| 217 | CONFIG_ADD="debug" |
187 | config_add="debug" |
| 218 | CONFIG_REMOVE="release" |
188 | config_remove="release" |
| 219 | fi |
189 | fi |
| 220 | local awkscript='BEGIN { |
190 | local awkscript='BEGIN { |
| 221 | printf "### eqmake4 was here ###\n" > file; |
191 | printf "### eqmake4 was here ###\n" > file; |
|
|
192 | printf "CONFIG -= debug_and_release %s\n", remove >> file; |
|
|
193 | printf "CONFIG += %s\n\n", add >> file; |
| 222 | fixed=0; |
194 | fixed=0; |
| 223 | } |
195 | } |
| 224 | /^[[:blank:]]*CONFIG[[:blank:]]*[\+\*]?=/ { |
196 | /^[[:blank:]]*CONFIG[[:blank:]]*[\+\*]?=/ { |
| 225 | for (i=1; i <= NF; i++) { |
197 | if (gsub("\\<((" remove ")|(debug_and_release))\\>", "") > 0) { |
| 226 | if ($i ~ rem || $i ~ /debug_and_release/) |
198 | fixed=1; |
| 227 | { $i=add; fixed=1; } |
|
|
| 228 | } |
199 | } |
| 229 | } |
200 | } |
| 230 | /^[[:blank:]]*CONFIG[[:blank:]]*-=/ { |
201 | /^[[:blank:]]*CONFIG[[:blank:]]*-=/ { |
| 231 | for (i=1; i <= NF; i++) { |
202 | if (gsub("\\<" add "\\>", "") > 0) { |
| 232 | if ($i ~ add) { $i=rem; fixed=1; } |
203 | fixed=1; |
| 233 | } |
204 | } |
| 234 | } |
205 | } |
| 235 | { |
206 | { |
| 236 | print >> file; |
207 | print >> file; |
| 237 | } |
208 | } |
| 238 | END { |
209 | END { |
| 239 | printf "\nCONFIG -= debug_and_release %s\n", rem >> file; |
|
|
| 240 | printf "CONFIG += %s\n", add >> file; |
|
|
| 241 | print fixed; |
210 | print fixed; |
| 242 | }' |
211 | }' |
| 243 | local file= |
212 | local file= |
| 244 | while read file; do |
213 | while read file; do |
| 245 | grep -q '^### eqmake4 was here ###$' "${file}" && continue |
214 | grep -q '^### eqmake4 was here ###$' "${file}" && continue |
| 246 | local retval=$({ |
215 | local retval=$({ |
| 247 | rm -f "${file}" || echo "FAILED" |
216 | rm -f "${file}" || echo FAIL |
| 248 | awk -v file="${file}" -- "${awkscript}" add=${CONFIG_ADD} rem=${CONFIG_REMOVE} || echo "FAILED" |
217 | awk -v file="${file}" \ |
|
|
218 | -v add=${config_add} \ |
|
|
219 | -v remove=${config_remove} \ |
|
|
220 | -- "${awkscript}" || echo FAIL |
| 249 | } < "${file}") |
221 | } < "${file}") |
| 250 | if [[ ${retval} == 1 ]]; then |
222 | if [[ ${retval} == 1 ]]; then |
| 251 | einfo " - fixed CONFIG in ${file}" |
223 | einfo " - fixed CONFIG in ${file}" |
| 252 | elif [[ ${retval} != 0 ]]; then |
224 | elif [[ ${retval} != 0 ]]; then |
| 253 | eerror "An error occurred while processing ${file}" |
225 | eerror " - error while processing ${file}" |
| 254 | die "eqmake4 failed to process '${file}'" |
226 | die "eqmake4 failed to process ${file}" |
| 255 | fi |
227 | fi |
| 256 | done < <(find . -type f -name "*.pr[io]" -printf '%P\n' 2>/dev/null) |
228 | done < <(find . -type f -name '*.pr[io]' -printf '%P\n' 2>/dev/null) |
| 257 | |
|
|
| 258 | [[ ${EAPI} == 2 ]] && use !prefix && EPREFIX= |
|
|
| 259 | |
229 | |
| 260 | "${EPREFIX}"/usr/bin/qmake \ |
230 | "${EPREFIX}"/usr/bin/qmake \ |
| 261 | -makefile \ |
231 | -makefile \ |
| 262 | -config ${CONFIG_ADD} \ |
|
|
| 263 | QTDIR="${EPREFIX}"/usr/$(get_libdir) \ |
232 | QTDIR="${EPREFIX}"/usr/$(get_libdir) \ |
| 264 | QMAKE="${EPREFIX}"/usr/bin/qmake \ |
233 | QMAKE="${EPREFIX}"/usr/bin/qmake \ |
|
|
234 | QMAKE_AR="$(tc-getAR) cqs" \ |
| 265 | QMAKE_CC="$(tc-getCC)" \ |
235 | QMAKE_CC="$(tc-getCC)" \ |
| 266 | QMAKE_CXX="$(tc-getCXX)" \ |
236 | QMAKE_CXX="$(tc-getCXX)" \ |
| 267 | QMAKE_LINK="$(tc-getCXX)" \ |
237 | QMAKE_LINK="$(tc-getCXX)" \ |
| 268 | QMAKE_CFLAGS_RELEASE="${CFLAGS}" \ |
238 | QMAKE_OBJCOPY="$(tc-getOBJCOPY)" \ |
|
|
239 | QMAKE_RANLIB= \ |
|
|
240 | QMAKE_STRIP= \ |
| 269 | QMAKE_CFLAGS_DEBUG="${CFLAGS}" \ |
241 | QMAKE_CFLAGS="${CFLAGS}" \ |
| 270 | QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS}" \ |
242 | QMAKE_CFLAGS_RELEASE= \ |
|
|
243 | QMAKE_CFLAGS_DEBUG= \ |
| 271 | QMAKE_CXXFLAGS_DEBUG="${CXXFLAGS}" \ |
244 | QMAKE_CXXFLAGS="${CXXFLAGS}" \ |
| 272 | QMAKE_LFLAGS_RELEASE="${LDFLAGS}" \ |
245 | QMAKE_CXXFLAGS_RELEASE= \ |
|
|
246 | QMAKE_CXXFLAGS_DEBUG= \ |
| 273 | QMAKE_LFLAGS_DEBUG="${LDFLAGS}" \ |
247 | QMAKE_LFLAGS="${LDFLAGS}" \ |
|
|
248 | QMAKE_LFLAGS_RELEASE= \ |
|
|
249 | QMAKE_LFLAGS_DEBUG= \ |
| 274 | QMAKE_LIBDIR_QT="${EPREFIX}"/usr/$(get_libdir)/qt4 \ |
250 | QMAKE_LIBDIR_QT="${EPREFIX}"/usr/$(get_libdir)/qt4 \ |
| 275 | QMAKE_LIBDIR_X11="${EPREFIX}"/usr/$(get_libdir) \ |
251 | QMAKE_LIBDIR_X11="${EPREFIX}"/usr/$(get_libdir) \ |
| 276 | QMAKE_LIBDIR_OPENGL="${EPREFIX}"/usr/$(get_libdir) \ |
252 | QMAKE_LIBDIR_OPENGL="${EPREFIX}"/usr/$(get_libdir) \ |
| 277 | QMAKE_STRIP= \ |
|
|
| 278 | "${qmake_args[@]}" |
253 | "${qmake_args[@]}" |
| 279 | |
254 | |
| 280 | # was qmake successful? |
255 | # was qmake successful? |
| 281 | if ! eend $? ; then |
256 | if ! eend $? ; then |
| 282 | echo |
257 | echo |
| … | |
… | |
| 287 | fi |
262 | fi |
| 288 | |
263 | |
| 289 | return 0 |
264 | return 0 |
| 290 | } |
265 | } |
| 291 | |
266 | |
|
|
267 | # Internal function, used by eqmake4 and qt4-r2_src_configure. |
|
|
268 | # Outputs a project file name that can be passed to eqmake4. Sets nullglob |
|
|
269 | # locally to avoid expanding *.pro as "*.pro" when there are no matching files. |
|
|
270 | # 0 *.pro files found --> outputs null string |
|
|
271 | # 1 *.pro file found --> outputs its name |
|
|
272 | # 2 or more *.pro files found --> if ${PN}.pro or $(basename ${S}).pro |
|
|
273 | # are there, outputs any of them |
|
|
274 | _find_project_file() { |
|
|
275 | local dir_name=$(basename "${S}") |
|
|
276 | |
|
|
277 | eshopts_push -s nullglob |
|
|
278 | local pro_files=(*.pro) |
|
|
279 | eshopts_pop |
|
|
280 | |
|
|
281 | case ${#pro_files[@]} in |
|
|
282 | 1) |
|
|
283 | echo "${pro_files[0]}" |
|
|
284 | ;; |
|
|
285 | *) |
|
|
286 | for pro_file in "${pro_files[@]}"; do |
|
|
287 | if [[ ${pro_file} == "${dir_name}.pro" || ${pro_file} == "${PN}.pro" ]]; then |
|
|
288 | echo "${pro_file}" |
|
|
289 | break |
|
|
290 | fi |
|
|
291 | done |
|
|
292 | ;; |
|
|
293 | esac |
|
|
294 | } |
|
|
295 | |
| 292 | EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install |
296 | EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install |