/[gentoo-x86]/eclass/qt4-build.eclass
Gentoo

Diff of /eclass/qt4-build.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.119 Revision 1.141
1# Copyright 1999-2012 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-build.eclass,v 1.119 2012/02/28 18:19:29 pesa Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v 1.141 2012/12/31 06:29:42 pesa Exp $
4 4
5# @ECLASS: qt4-build.eclass 5# @ECLASS: qt4-build.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Qt herd <qt@gentoo.org> 7# Qt herd <qt@gentoo.org>
8# @BLURB: Eclass for Qt4 split ebuilds. 8# @BLURB: Eclass for Qt4 split ebuilds.
9# @DESCRIPTION: 9# @DESCRIPTION:
10# This eclass contains various functions that are used when building Qt4. 10# This eclass contains various functions that are used when building Qt4.
11 11
12case ${EAPI} in
13 3|4|5) : ;;
14 *) die "qt4-build.eclass: unsupported EAPI=${EAPI:-0}" ;;
15esac
16
12inherit base eutils multilib toolchain-funcs flag-o-matic versionator 17inherit eutils flag-o-matic multilib toolchain-funcs versionator
18
19if [[ ${PV} == *9999* ]]; then
20 QT4_BUILD_TYPE="live"
21 inherit git-2
22else
23 QT4_BUILD_TYPE="release"
24fi
25
26HOMEPAGE="http://qt-project.org/ http://qt.digia.com/"
27LICENSE="|| ( LGPL-2.1 GPL-3 )"
13 28
14MY_PV=${PV/_/-} 29MY_PV=${PV/_/-}
15MY_P=qt-everywhere-opensource-src-${MY_PV} 30MY_P=qt-everywhere-opensource-src-${MY_PV}
16 31
17HOMEPAGE="http://qt.nokia.com/ http://qt-project.org/" 32case ${QT4_BUILD_TYPE} in
33 live)
34 EGIT_REPO_URI="git://gitorious.org/qt/qt.git
35 https://git.gitorious.org/qt/qt.git"
36 EGIT_BRANCH=${PV%.9999}
37 ;;
38 release)
18SRC_URI="http://get.qt.nokia.com/qt/source/${MY_P}.tar.gz" 39 SRC_URI="http://releases.qt-project.org/qt4/source/${MY_P}.tar.gz"
19LICENSE="|| ( LGPL-2.1 GPL-3 )" 40 ;;
41esac
20 42
21IUSE="aqua debug pch" 43IUSE="aqua debug pch"
22
23[[ ${CATEGORY}/${PN} != x11-libs/qt-xmlpatterns ]] && 44[[ ${CATEGORY}/${PN} != x11-libs/qt-xmlpatterns ]] && IUSE+=" +exceptions"
24[[ ${CATEGORY}/${PN} != x11-themes/qgtkstyle ]] && 45[[ ${CATEGORY}/${PN} != x11-libs/qt-webkit ]] && IUSE+=" c++0x"
25 IUSE+=" +exceptions"
26 46
27if version_is_at_least 4.7.99999999; then 47DEPEND="virtual/pkgconfig"
28 IUSE+=" c++0x qpa" 48if [[ ${QT4_BUILD_TYPE} == live ]]; then
49 DEPEND+=" dev-lang/perl"
29fi 50fi
30 51
31DEPEND="dev-util/pkgconfig"
32RDEPEND=" 52RDEPEND="
33 !<x11-libs/qt-assistant-${PV} 53 !<x11-libs/qt-assistant-${PV}:4
34 !>x11-libs/qt-assistant-${PV}-r9999 54 !>x11-libs/qt-assistant-${PV}-r9999:4
55 !<x11-libs/qt-bearer-${PV}:4
56 !>x11-libs/qt-bearer-${PV}-r9999:4
35 !<x11-libs/qt-core-${PV} 57 !<x11-libs/qt-core-${PV}:4
36 !>x11-libs/qt-core-${PV}-r9999 58 !>x11-libs/qt-core-${PV}-r9999:4
37 !<x11-libs/qt-dbus-${PV} 59 !<x11-libs/qt-dbus-${PV}:4
38 !>x11-libs/qt-dbus-${PV}-r9999 60 !>x11-libs/qt-dbus-${PV}-r9999:4
39 !<x11-libs/qt-declarative-${PV} 61 !<x11-libs/qt-declarative-${PV}:4
40 !>x11-libs/qt-declarative-${PV}-r9999 62 !>x11-libs/qt-declarative-${PV}-r9999:4
41 !<x11-libs/qt-demo-${PV} 63 !<x11-libs/qt-demo-${PV}:4
42 !>x11-libs/qt-demo-${PV}-r9999 64 !>x11-libs/qt-demo-${PV}-r9999:4
43 !<x11-libs/qt-gui-${PV} 65 !<x11-libs/qt-gui-${PV}:4
44 !>x11-libs/qt-gui-${PV}-r9999 66 !>x11-libs/qt-gui-${PV}-r9999:4
45 !<x11-libs/qt-multimedia-${PV} 67 !<x11-libs/qt-multimedia-${PV}:4
46 !>x11-libs/qt-multimedia-${PV}-r9999 68 !>x11-libs/qt-multimedia-${PV}-r9999:4
47 !<x11-libs/qt-opengl-${PV} 69 !<x11-libs/qt-opengl-${PV}:4
48 !>x11-libs/qt-opengl-${PV}-r9999 70 !>x11-libs/qt-opengl-${PV}-r9999:4
49 !<x11-libs/qt-openvg-${PV} 71 !<x11-libs/qt-openvg-${PV}:4
50 !>x11-libs/qt-openvg-${PV}-r9999 72 !>x11-libs/qt-openvg-${PV}-r9999:4
51 !<x11-libs/qt-phonon-${PV} 73 !<x11-libs/qt-phonon-${PV}:4
52 !>x11-libs/qt-phonon-${PV}-r9999 74 !>x11-libs/qt-phonon-${PV}-r9999:4
53 !<x11-libs/qt-qt3support-${PV} 75 !<x11-libs/qt-qt3support-${PV}:4
54 !>x11-libs/qt-qt3support-${PV}-r9999 76 !>x11-libs/qt-qt3support-${PV}-r9999:4
55 !<x11-libs/qt-script-${PV} 77 !<x11-libs/qt-script-${PV}:4
56 !>x11-libs/qt-script-${PV}-r9999 78 !>x11-libs/qt-script-${PV}-r9999:4
57 !<x11-libs/qt-sql-${PV} 79 !<x11-libs/qt-sql-${PV}:4
58 !>x11-libs/qt-sql-${PV}-r9999 80 !>x11-libs/qt-sql-${PV}-r9999:4
59 !<x11-libs/qt-svg-${PV} 81 !<x11-libs/qt-svg-${PV}:4
60 !>x11-libs/qt-svg-${PV}-r9999 82 !>x11-libs/qt-svg-${PV}-r9999:4
61 !<x11-libs/qt-test-${PV} 83 !<x11-libs/qt-test-${PV}:4
62 !>x11-libs/qt-test-${PV}-r9999 84 !>x11-libs/qt-test-${PV}-r9999:4
63 !<x11-libs/qt-webkit-${PV} 85 !<x11-libs/qt-webkit-${PV}:4
64 !>x11-libs/qt-webkit-${PV}-r9999 86 !>x11-libs/qt-webkit-${PV}-r9999:4
65 !<x11-libs/qt-xmlpatterns-${PV} 87 !<x11-libs/qt-xmlpatterns-${PV}:4
66 !>x11-libs/qt-xmlpatterns-${PV}-r9999 88 !>x11-libs/qt-xmlpatterns-${PV}-r9999:4
67" 89"
68 90
69S=${WORKDIR}/${MY_P} 91S=${WORKDIR}/${MY_P}
70 92
71# @FUNCTION: qt4-build_pkg_setup 93# @FUNCTION: qt4-build_pkg_setup
72# @DESCRIPTION: 94# @DESCRIPTION:
73# Sets up PATH and LD_LIBRARY_PATH. 95# Sets up PATH and LD_LIBRARY_PATH.
74qt4-build_pkg_setup() { 96qt4-build_pkg_setup() {
75 [[ ${EAPI} == 2 ]] && use !prefix && EPREFIX=
76
77 # Protect users by not allowing downgrades between releases 97 # Protect users by not allowing downgrades between releases.
78 # Downgrading revisions within the same release should be allowed 98 # Downgrading revisions within the same release should be allowed.
79 if has_version '>'${CATEGORY}/${P}-r9999; then 99 if has_version ">${CATEGORY}/${P}-r9999:4"; then
80 if [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then 100 if [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then
81 eerror "Sanity check to keep you from breaking your system:" 101 eerror " *** Sanity check to keep you from breaking your system ***"
82 eerror " Downgrading Qt is completely unsupported and will break your system!" 102 eerror "Downgrading Qt is completely unsupported and will break your system!"
83 die "aborting to save your system" 103 die "aborting to save your system"
84 else 104 else
85 ewarn "Downgrading Qt is completely unsupported and will break your system!" 105 ewarn "Downgrading Qt is completely unsupported and will break your system!"
86 fi 106 fi
87 fi
88
89 if [[ ${PN} == "qt-webkit" ]]; then
90 eshopts_push -s extglob
91 if is-flagq '-g?(gdb)?([1-9])'; then
92 echo
93 ewarn "You have enabled debug info (probably have -g or -ggdb in your \$C{,XX}FLAGS)."
94 ewarn "You may experience really long compilation times and/or increased memory usage."
95 ewarn "If compilation fails, please try removing -g{,gdb} before reporting a bug."
96 ewarn "For more info check out bug #307861"
97 echo
98 fi
99 eshopts_pop
100 fi 107 fi
101 108
102 PATH="${S}/bin${PATH:+:}${PATH}" 109 PATH="${S}/bin${PATH:+:}${PATH}"
103 if [[ ${CHOST} != *-darwin* ]]; then 110 if [[ ${CHOST} != *-darwin* ]]; then
104 LD_LIBRARY_PATH="${S}/lib${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}" 111 LD_LIBRARY_PATH="${S}/lib${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}"
109 # avoid extract failure. 116 # avoid extract failure.
110 [[ ${CHOST} == *-apple-darwin* ]] && \ 117 [[ ${CHOST} == *-apple-darwin* ]] && \
111 QT4_EXTRACT_DIRECTORIES="src/gui/kernel/qapplication_mac.mm 118 QT4_EXTRACT_DIRECTORIES="src/gui/kernel/qapplication_mac.mm
112 ${QT4_EXTRACT_DIRECTORIES}" 119 ${QT4_EXTRACT_DIRECTORIES}"
113 fi 120 fi
114
115 # Make sure ebuilds use the required EAPI
116 if [[ ${EAPI} != [234] ]]; then
117 eerror "The qt4-build eclass requires EAPI 2,3 or 4 but this ebuild is using"
118 eerror "EAPI=${EAPI:-0}. The ebuild author or editor failed. This ebuild needs to be"
119 eerror "fixed. Using qt4-build eclass without EAPI 2,3 or 4 will fail."
120 die "qt4-build eclass requires EAPI 2,3 or 4"
121 fi
122
123 if ! version_is_at_least 4.1 $(gcc-version); then
124 ewarn "Using a GCC version lower than 4.1 is not supported!"
125 fi
126} 121}
122
123# @ECLASS-VARIABLE: QT4_EXTRACT_DIRECTORIES
124# @DEFAULT_UNSET
125# @DESCRIPTION:
126# Space-separated list including the directories that will be extracted from
127# Qt tarball.
127 128
128# @ECLASS-VARIABLE: QT4_TARGET_DIRECTORIES 129# @ECLASS-VARIABLE: QT4_TARGET_DIRECTORIES
130# @DEFAULT_UNSET
129# @DESCRIPTION: 131# @DESCRIPTION:
130# Arguments for build_target_directories. Takes the directories in which the 132# Arguments for build_target_directories. Takes the directories in which the
131# code should be compiled. This is a space-separated list. 133# code should be compiled. This is a space-separated list.
132
133# @ECLASS-VARIABLE: QT4_EXTRACT_DIRECTORIES
134# @DESCRIPTION:
135# Space-separated list including the directories that will be extracted from
136# Qt tarball.
137 134
138# @FUNCTION: qt4-build_src_unpack 135# @FUNCTION: qt4-build_src_unpack
139# @DESCRIPTION: 136# @DESCRIPTION:
140# Unpacks the sources. 137# Unpacks the sources.
141qt4-build_src_unpack() { 138qt4-build_src_unpack() {
142 setqtenv 139 setqtenv
143 140
141 if ! version_is_at_least 4.1 $(gcc-version); then
142 ewarn "Using a GCC version lower than 4.1 is not supported."
143 fi
144
145 if [[ ${PN} == qt-webkit ]]; then
146 eshopts_push -s extglob
147 if is-flagq '-g?(gdb)?([1-9])'; then
148 echo
149 ewarn "You have enabled debug info (probably have -g or -ggdb in your CFLAGS/CXXFLAGS)."
150 ewarn "You may experience really long compilation times and/or increased memory usage."
151 ewarn "If compilation fails, please try removing -g/-ggdb before reporting a bug."
152 ewarn "For more info check out https://bugs.gentoo.org/307861"
153 echo
154 fi
155 eshopts_pop
156 fi
157
158 case ${QT4_BUILD_TYPE} in
159 live)
160 git-2_src_unpack
161 ;;
162 release)
144 local tarball="${MY_P}.tar.gz" target= targets= 163 local tarball="${MY_P}.tar.gz" target= targets=
145 for target in configure LICENSE.GPL3 LICENSE.LGPL projects.pro \ 164 for target in configure LICENSE.GPL3 LICENSE.LGPL projects.pro \
146 src/{qbase,qt_targets,qt_install}.pri bin config.tests \ 165 src/{qbase,qt_targets,qt_install}.pri bin config.tests \
147 mkspecs qmake ${QT4_EXTRACT_DIRECTORIES} 166 mkspecs qmake ${QT4_EXTRACT_DIRECTORIES}
148 do 167 do
149 targets+="${MY_P}/${target} " 168 targets+="${MY_P}/${target} "
150 done 169 done
151 170
152 ebegin "Unpacking parts of ${tarball}:" ${targets//${MY_P}\/} 171 ebegin "Unpacking parts of ${tarball}:" ${targets//${MY_P}\/}
153 tar -xzf "${DISTDIR}/${tarball}" ${targets} 172 tar -xzf "${DISTDIR}/${tarball}" ${targets}
154 eend $? || die "failed to unpack" 173 eend $? || die "failed to unpack"
174 ;;
175 esac
155} 176}
156 177
157# @ECLASS-VARIABLE: PATCHES 178# @ECLASS-VARIABLE: PATCHES
158# @DEFAULT_UNSET 179# @DEFAULT_UNSET
159# @DESCRIPTION: 180# @DESCRIPTION:
160# PATCHES array variable containing all various patches to be applied. 181# PATCHES array variable containing all various patches to be applied.
161# This variable is expected to be defined in global scope of ebuild. 182# This variable is expected to be defined in global scope of ebuild.
162# Make sure to specify the full path. This variable is utilised in 183# Make sure to specify the full path. This variable is utilised in
163# src_unpack/src_prepare phase, based on EAPI. 184# src_prepare() phase.
164# 185#
165# @CODE 186# @CODE
166# PATCHES=( "${FILESDIR}/mypatch.patch" 187# PATCHES=( "${FILESDIR}/mypatch.patch"
167# "${FILESDIR}/patches_folder/" ) 188# "${FILESDIR}/patches_folder/" )
168# @CODE 189# @CODE
171# @DESCRIPTION: 192# @DESCRIPTION:
172# Prepare the sources before the configure phase. Strip CFLAGS if necessary, and fix 193# Prepare the sources before the configure phase. Strip CFLAGS if necessary, and fix
173# the build system in order to respect CFLAGS/CXXFLAGS/LDFLAGS specified in /etc/make.conf. 194# the build system in order to respect CFLAGS/CXXFLAGS/LDFLAGS specified in /etc/make.conf.
174qt4-build_src_prepare() { 195qt4-build_src_prepare() {
175 setqtenv 196 setqtenv
176 cd "${S}"
177 197
178 if version_is_at_least "4.7"; then 198 if [[ ${QT4_BUILD_TYPE} == live ]]; then
199 QTDIR="." ./bin/syncqt || die "syncqt failed"
200 fi
201
179 # fix libX11 dependency on non X packages 202 # avoid X11 dependency in non-gui packages
180 local nolibx11_pkgs="qt-core qt-dbus qt-script qt-sql qt-test qt-xmlpatterns" 203 local nolibx11_pkgs="qt-core qt-dbus qt-script qt-sql qt-test qt-xmlpatterns"
181 has ${PN} ${nolibx11_pkgs} && qt_nolibx11 204 has ${PN} ${nolibx11_pkgs} && qt_nolibx11
182
183 qt_assistant_cleanup
184 fi
185 205
186 if use aqua; then 206 if use aqua; then
187 # provide a proper macx-g++-64 207 # provide a proper macx-g++-64
188 use x64-macos && ln -s macx-g++ mkspecs/$(qt_mkspecs_dir) 208 use x64-macos && ln -s macx-g++ mkspecs/$(qt_mkspecs_dir)
189 209
196 skip_qmake_build 216 skip_qmake_build
197 skip_project_generation 217 skip_project_generation
198 symlink_binaries_to_buildtree 218 symlink_binaries_to_buildtree
199 fi 219 fi
200 220
201 if [[ ${CHOST} == *86*-apple-darwin* ]] ; then 221 if [[ ${CHOST} == *86*-apple-darwin* ]]; then
202 # qmake bus errors with -O2 but -O3 works 222 # qmake bus errors with -O2 or -O3 but -O1 works
223 # Bug 373061
203 replace-flags -O2 -O3 224 replace-flags -O[23] -O1
204 fi 225 fi
205 226
206 # Bug 178652 227 # Bug 178652
207 if [[ $(gcc-major-version) == 3 ]] && use amd64; then 228 if [[ $(gcc-major-version) == 3 ]] && use amd64; then
208 ewarn "Appending -fno-gcse to CFLAGS/CXXFLAGS" 229 ewarn "Appending -fno-gcse to CFLAGS/CXXFLAGS"
209 append-flags -fno-gcse 230 append-flags -fno-gcse
210 fi 231 fi
211 232
212 if use_if_iuse c++0x; then 233 if use_if_iuse c++0x; then
213 ewarn "You are about to build Qt4 using the C++11 standard. Even though"
214 ewarn "this is an official standard, some of the reverse dependencies"
215 ewarn "may fail to compile or link againt the Qt4 libraries. Before"
216 ewarn "reporting a bug, make sure your bug is reproducible with c++0x"
217 ewarn "disabled."
218 append-flags -std=c++0x 234 append-cxxflags -std=c++0x
219 fi 235 fi
220 236
221 # Unsupported old gcc versions - hardened needs this :( 237 # Unsupported old gcc versions - hardened needs this :(
222 if [[ $(gcc-major-version) -lt 4 ]] ; then 238 if [[ $(gcc-major-version) -lt 4 ]]; then
223 ewarn "Appending -fno-stack-protector to CXXFLAGS" 239 ewarn "Appending -fno-stack-protector to CXXFLAGS"
224 append-cxxflags -fno-stack-protector 240 append-cxxflags -fno-stack-protector
225 # Bug 253127 241 # Bug 253127
226 sed -e "/^QMAKE_CFLAGS\t/ s:$: -fno-stack-protector-all:" \ 242 sed -e "/^QMAKE_CFLAGS\t/ s:$: -fno-stack-protector-all:" \
227 -i mkspecs/common/g++.conf || die 243 -i mkspecs/common/g++.conf || die
237 sed -e "/^SYSTEM_VARIABLES=/i \ 253 sed -e "/^SYSTEM_VARIABLES=/i \
238 CC='$(tc-getCC)'\n\ 254 CC='$(tc-getCC)'\n\
239 CXX='$(tc-getCXX)'\n\ 255 CXX='$(tc-getCXX)'\n\
240 CFLAGS='${CFLAGS}'\n\ 256 CFLAGS='${CFLAGS}'\n\
241 CXXFLAGS='${CXXFLAGS}'\n\ 257 CXXFLAGS='${CXXFLAGS}'\n\
242 LDFLAGS='${LDFLAGS}'\n" \ 258 LDFLAGS='${LDFLAGS}'\n\
259 QMakeVar set QMAKE_CFLAGS_RELEASE\n\
260 QMakeVar set QMAKE_CFLAGS_DEBUG\n\
261 QMakeVar set QMAKE_CXXFLAGS_RELEASE\n\
262 QMakeVar set QMAKE_CXXFLAGS_DEBUG\n\
263 QMakeVar set QMAKE_LFLAGS_RELEASE\n\
264 QMakeVar set QMAKE_LFLAGS_DEBUG\n"\
243 -i configure \ 265 -i configure \
244 || die "sed SYSTEM_VARIABLES failed" 266 || die "sed SYSTEM_VARIABLES failed"
245 267
246 # Respect CC, CXX, LINK and *FLAGS in config.tests 268 # Respect CC, CXX, LINK and *FLAGS in config.tests
247 find config.tests/unix -name '*.test' -type f -print0 | xargs -0 \ 269 find config.tests/unix -name '*.test' -type f -print0 | xargs -0 \
248 sed -i -e "/bin\/qmake/ s: \"QT_BUILD_TREE=: \ 270 sed -i -e "/bin\/qmake/ s: \"\$SRCDIR/: \
249 'QMAKE_CC=$(tc-getCC)' 'QMAKE_CXX=$(tc-getCXX)' 'QMAKE_LINK=$(tc-getCXX)' \ 271 'QMAKE_CC=$(tc-getCC)' 'QMAKE_CXX=$(tc-getCXX)' 'QMAKE_LINK=$(tc-getCXX)' \
250 'QMAKE_CFLAGS+=${CFLAGS}' 'QMAKE_CXXFLAGS+=${CXXFLAGS}' 'QMAKE_LFLAGS+=${LDFLAGS}'&:" \ 272 'QMAKE_CFLAGS+=${CFLAGS}' 'QMAKE_CXXFLAGS+=${CXXFLAGS}' 'QMAKE_LFLAGS+=${LDFLAGS}'&:" \
251 || die "sed config.tests failed" 273 || die "sed config.tests failed"
252 274
253 # Strip predefined CFLAGS from mkspecs (bug 312689)
254 sed -i -e '/^QMAKE_CFLAGS_RELEASE/s:+=.*:+=:' mkspecs/common/g++.conf || die
255
256 # Bug 172219 275 # Bug 172219
257 sed -e 's:/X11R6/:/:' -i mkspecs/$(qt_mkspecs_dir)/qmake.conf || die 276 sed -e 's:/X11R6/:/:' -i mkspecs/$(qt_mkspecs_dir)/qmake.conf || die
258 277
259 if [[ ${CHOST} == *-darwin* ]]; then 278 if [[ ${CHOST} == *-darwin* ]]; then
260 # Set FLAGS *and* remove -arch, since our gcc-apple is multilib 279 # Set FLAGS *and* remove -arch, since our gcc-apple is multilib
261 # crippled (by design) :/ 280 # crippled (by design) :/
281 local mac_gpp_conf=
282 if [[ -f mkspecs/common/mac-g++.conf ]]; then
283 # qt < 4.8 has mac-g++.conf
284 mac_gpp_conf="mkspecs/common/mac-g++.conf"
285 elif [[ -f mkspecs/common/g++-macx.conf ]]; then
286 # qt >= 4.8 has g++-macx.conf
287 mac_gpp_conf="mkspecs/common/g++-macx.conf"
288 else
289 die "no known conf file for mac found"
290 fi
262 sed \ 291 sed \
263 -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \ 292 -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \
264 -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \ 293 -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \
265 -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=-headerpad_max_install_names ${LDFLAGS}:" \ 294 -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=-headerpad_max_install_names ${LDFLAGS}:" \
266 -e "s:-arch\s\w*::g" \ 295 -e "s:-arch\s\w*::g" \
267 -i mkspecs/common/mac-g++.conf \ 296 -i ${mac_gpp_conf} \
268 || die "sed mkspecs/common/mac-g++.conf failed" 297 || die "sed ${mac_gpp_conf} failed"
269 298
270 # Fix configure's -arch settings that appear in qmake/Makefile and also 299 # Fix configure's -arch settings that appear in qmake/Makefile and also
271 # fix arch handling (automagically duplicates our -arch arg and breaks 300 # fix arch handling (automagically duplicates our -arch arg and breaks
272 # pch). Additionally disable Xarch support. 301 # pch). Additionally disable Xarch support.
302 local mac_gcc_confs="${mac_gpp_conf}"
303 if [[ -f mkspecs/common/gcc-base-macx.conf ]]; then
304 mac_gcc_confs+=" mkspecs/common/gcc-base-macx.conf"
305 fi
273 sed \ 306 sed \
274 -e "s:-arch i386::" \ 307 -e "s:-arch i386::" \
275 -e "s:-arch ppc::" \ 308 -e "s:-arch ppc::" \
276 -e "s:-arch x86_64::" \ 309 -e "s:-arch x86_64::" \
277 -e "s:-arch ppc64::" \ 310 -e "s:-arch ppc64::" \
278 -e "s:-arch \$i::" \ 311 -e "s:-arch \$i::" \
279 -e "/if \[ ! -z \"\$NATIVE_64_ARCH\" \]; then/,/fi/ d" \ 312 -e "/if \[ ! -z \"\$NATIVE_64_ARCH\" \]; then/,/fi/ d" \
280 -e "s:CFG_MAC_XARCH=yes:CFG_MAC_XARCH=no:g" \ 313 -e "s:CFG_MAC_XARCH=yes:CFG_MAC_XARCH=no:g" \
281 -e "s:-Xarch_x86_64::g" \ 314 -e "s:-Xarch_x86_64::g" \
282 -e "s:-Xarch_ppc64::g" \ 315 -e "s:-Xarch_ppc64::g" \
283 -i configure mkspecs/common/mac-g++.conf \ 316 -i configure ${mac_gcc_confs} \
284 || die "sed -arch/-Xarch failed" 317 || die "sed -arch/-Xarch failed"
285 318
286 # On Snow Leopard don't fall back to 10.5 deployment target. 319 # On Snow Leopard don't fall back to 10.5 deployment target.
287 if [[ ${CHOST} == *-apple-darwin10 ]] ; then 320 if [[ ${CHOST} == *-apple-darwin10 ]]; then
288 sed -e "s:QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET.*:QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET 10.6:g" \ 321 sed -e "s:QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET.*:QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET 10.6:g" \
289 -e "s:-mmacosx-version-min=10.[0-9]:-mmacosx-version-min=10.6:g" \ 322 -e "s:-mmacosx-version-min=10.[0-9]:-mmacosx-version-min=10.6:g" \
290 -i configure mkspecs/common/mac-g++.conf \ 323 -i configure ${mac_gpp_conf} \
291 || die "sed deployment target failed" 324 || die "sed deployment target failed"
292 fi 325 fi
293 fi 326 fi
294 327
295 # this one is needed for all systems with a separate -liconv, apart from 328 # this one is needed for all systems with a separate -liconv, apart from
296 # Darwin, for which the sources already cater for -liconv 329 # Darwin, for which the sources already cater for -liconv
297 if use !elibc_glibc && [[ ${CHOST} != *-darwin* ]] ; then 330 if use !elibc_glibc && [[ ${CHOST} != *-darwin* ]]; then
298 sed -e 's|mac:\(LIBS += -liconv\)|\1|g' \ 331 sed -e 's|mac:\(LIBS += -liconv\)|\1|g' \
299 -i config.tests/unix/iconv/iconv.pro \ 332 -i config.tests/unix/iconv/iconv.pro \
300 || die "sed iconv.pro failed" 333 || die "sed iconv.pro failed"
301 fi 334 fi
302 335
307 sed -i -e '/PLATFORM=solaris-cc/s/cc/g++/' configure || die 340 sed -i -e '/PLATFORM=solaris-cc/s/cc/g++/' configure || die
308 # do not flirt with non-Prefix stuff, we're quite possessive 341 # do not flirt with non-Prefix stuff, we're quite possessive
309 sed -i -e '/^QMAKE_\(LIB\|INC\)DIR\(_X11\|_OPENGL\|\)\t/s/=.*$/=/' \ 342 sed -i -e '/^QMAKE_\(LIB\|INC\)DIR\(_X11\|_OPENGL\|\)\t/s/=.*$/=/' \
310 mkspecs/$(qt_mkspecs_dir)/qmake.conf || die 343 mkspecs/$(qt_mkspecs_dir)/qmake.conf || die
311 344
312 base_src_prepare 345 # apply patches
346 [[ -n ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
347 epatch_user
313} 348}
314 349
315# @FUNCTION: qt4-build_src_configure 350# @FUNCTION: qt4-build_src_configure
316# @DESCRIPTION: 351# @DESCRIPTION:
317# Default configure phase 352# Default configure phase
318qt4-build_src_configure() { 353qt4-build_src_configure() {
319 setqtenv 354 setqtenv
320 myconf="$(standard_configure_options) ${myconf}" 355
356 local conf="
357 -prefix ${QTPREFIXDIR}
358 -bindir ${QTBINDIR}
359 -libdir ${QTLIBDIR}
360 -docdir ${QTDOCDIR}
361 -headerdir ${QTHEADERDIR}
362 -plugindir ${QTPLUGINDIR}
363 -importdir ${QTIMPORTDIR}
364 -datadir ${QTDATADIR}
365 -translationdir ${QTTRANSDIR}
366 -sysconfdir ${QTSYSCONFDIR}
367 -examplesdir ${QTEXAMPLESDIR}
368 -demosdir ${QTDEMOSDIR}
369 -opensource -confirm-license
370 -shared -fast -largefile -stl -verbose
371 -nomake examples -nomake demos"
372
373 # ARCH is set on Gentoo. Qt now falls back to generic on an unsupported
374 # $(tc-arch). Therefore we convert it to supported values.
375 case "$(tc-arch)" in
376 amd64|x64-*) conf+=" -arch x86_64" ;;
377 ppc-macos) conf+=" -arch ppc" ;;
378 ppc|ppc64|ppc-*) conf+=" -arch powerpc" ;;
379 sparc|sparc-*|sparc64-*) conf+=" -arch sparc" ;;
380 x86-macos) conf+=" -arch x86" ;;
381 x86|x86-*) conf+=" -arch i386" ;;
382 alpha|arm|ia64|mips|s390) conf+=" -arch $(tc-arch)" ;;
383 hppa|sh) conf+=" -arch generic" ;;
384 *) die "$(tc-arch) is unsupported by this eclass. Please file a bug." ;;
385 esac
386
387 conf+=" -platform $(qt_mkspecs_dir)"
388
389 [[ $(get_libdir) != lib ]] && conf+=" -L${EPREFIX}/usr/$(get_libdir)"
390
391 # debug/release
392 if use debug; then
393 conf+=" -debug"
394 else
395 conf+=" -release"
396 fi
397 conf+=" -no-separate-debug-info"
398
399 # exceptions USE flag
400 conf+=" $(in_iuse exceptions && qt_use exceptions || echo -exceptions)"
401
402 # disable rpath (bug 380415), except on prefix (bug 417169)
403 use prefix || conf+=" -no-rpath"
404
405 # precompiled headers don't work on hardened, where the flag is masked
406 conf+=" $(qt_use pch)"
407
408 # -reduce-relocations
409 # This flag seems to introduce major breakage to applications,
410 # mostly to be seen as a core dump with the message "QPixmap: Must
411 # construct a QApplication before a QPaintDevice" on Solaris.
412 # -- Daniel Vergien
413 [[ ${CHOST} != *-solaris* ]] && conf+=" -reduce-relocations"
321 414
322 # this one is needed for all systems with a separate -liconv, apart from 415 # this one is needed for all systems with a separate -liconv, apart from
323 # Darwin, for which the sources already cater for -liconv 416 # Darwin, for which the sources already cater for -liconv
324 use !elibc_glibc && [[ ${CHOST} != *-darwin* ]] && \ 417 if use !elibc_glibc && [[ ${CHOST} != *-darwin* ]]; then
325 myconf+=" -liconv" 418 conf+=" -liconv"
419 fi
326 420
327 if use_if_iuse glib; then 421 if use_if_iuse glib; then
328 # use -I, -L and -l from configure
329 local glibflags="$(pkg-config --cflags --libs glib-2.0 gthread-2.0)" 422 local glibflags="$(pkg-config --cflags --libs glib-2.0 gthread-2.0)"
330 # avoid the -pthread argument 423 # avoid the -pthread argument
331 myconf+=" ${glibflags//-pthread}" 424 conf+=" ${glibflags//-pthread}"
332 unset glibflags 425 unset glibflags
333 fi 426 fi
334 427
335 if use_if_iuse qpa; then 428 if use_if_iuse qpa; then
336 ewarn 429 echo
337 ewarn "The qpa useflag enables the Qt Platform Abstraction, formely" 430 ewarn "The qpa useflag enables the Qt Platform Abstraction, formely"
338 ewarn "known as Qt Lighthouse. If you are not sure what that is, then" 431 ewarn "known as Qt Lighthouse. If you are not sure what that is, then"
339 ewarn "disable it before reporting any bugs related to this useflag." 432 ewarn "disable it before reporting any bugs related to this useflag."
340 ewarn 433 echo
341 myconf+=" -qpa" 434 conf+=" -qpa"
342 fi 435 fi
343 436
344 if use aqua ; then 437 if use aqua; then
345 # On (snow) leopard use the new (frameworked) cocoa code. 438 # On (snow) leopard use the new (frameworked) cocoa code.
346 if [[ ${CHOST##*-darwin} -ge 9 ]] ; then 439 if [[ ${CHOST##*-darwin} -ge 9 ]]; then
347 myconf+=" -cocoa -framework" 440 conf+=" -cocoa -framework"
441 # We need the source's headers, not the installed ones.
442 conf+=" -I${S}/include"
443 # Add hint for the framework location.
444 conf+=" -F${QTLIBDIR}"
348 445
349 # We are crazy and build cocoa + qt3support :-) 446 # We are crazy and build cocoa + qt3support :-)
350 if use qt3support; then 447 if use qt3support; then
351 sed -e "/case \"\$PLATFORM,\$CFG_MAC_COCOA\" in/,/;;/ s|CFG_QT3SUPPORT=\"no\"|CFG_QT3SUPPORT=\"yes\"|" \ 448 sed -e "/case \"\$PLATFORM,\$CFG_MAC_COCOA\" in/,/;;/ s|CFG_QT3SUPPORT=\"no\"|CFG_QT3SUPPORT=\"yes\"|" \
352 -i configure || die 449 -i configure || die
353 fi 450 fi
354 451 else
355 # We need the source's headers, not the installed ones. 452 conf+=" -no-framework"
356 myconf+=" -I${S}/include"
357
358 # Add hint for the framework location.
359 myconf+=" -F${QTLIBDIR}"
360 fi 453 fi
361 else 454 else
362 # freetype2 include dir is non-standard, thus include it on configure 455 # freetype2 include dir is non-standard, thus pass it to configure
363 # use -I from configure
364 myconf+=" $(pkg-config --cflags freetype2)" 456 conf+=" $(pkg-config --cflags-only-I freetype2)"
365 fi 457 fi
366 458
459 conf+=" ${myconf}"
460 myconf=
461
367 echo ./configure ${myconf} 462 echo ./configure ${conf}
368 ./configure ${myconf} || die "./configure failed" 463 ./configure ${conf} || die "./configure failed"
369 myconf=""
370 464
371 prepare_directories ${QT4_TARGET_DIRECTORIES} 465 prepare_directories ${QT4_TARGET_DIRECTORIES}
372} 466}
373 467
374# @FUNCTION: qt4-build_src_compile 468# @FUNCTION: qt4-build_src_compile
383# @FUNCTION: qt4-build_src_test 477# @FUNCTION: qt4-build_src_test
384# @DESCRIPTION: 478# @DESCRIPTION:
385# Runs tests only in target directories. 479# Runs tests only in target directories.
386qt4-build_src_test() { 480qt4-build_src_test() {
387 # QtMultimedia does not have any test suite (bug #332299) 481 # QtMultimedia does not have any test suite (bug #332299)
388 [[ ${PN} == "qt-multimedia" ]] && return 482 [[ ${PN} == qt-multimedia ]] && return
389 483
390 for dir in ${QT4_TARGET_DIRECTORIES}; do 484 for dir in ${QT4_TARGET_DIRECTORIES}; do
391 emake -j1 check -C ${dir} 485 emake -j1 check -C ${dir}
392 done 486 done
393} 487}
395# @FUNCTION: fix_includes 489# @FUNCTION: fix_includes
396# @DESCRIPTION: 490# @DESCRIPTION:
397# For MacOS X we need to add some symlinks when frameworks are 491# For MacOS X we need to add some symlinks when frameworks are
398# being used, to avoid complications with some more or less stupid packages. 492# being used, to avoid complications with some more or less stupid packages.
399fix_includes() { 493fix_includes() {
400 if use aqua && [[ ${CHOST##*-darwin} -ge 9 ]] ; then 494 if use aqua && [[ ${CHOST##*-darwin} -ge 9 ]]; then
495 local frw dest f h rdir
401 # Some packages tend to include <Qt/...> 496 # Some packages tend to include <Qt/...>
402 dodir "${QTHEADERDIR#${EPREFIX}}"/Qt 497 dodir "${QTHEADERDIR#${EPREFIX}}"/Qt
403 498
404 # Fake normal headers when frameworks are installed... eases life later on 499 # Fake normal headers when frameworks are installed... eases life later
405 local dest f h 500 # on, make sure we use relative links though, as some ebuilds assume
501 # these dirs exist in src_install to add additional files
502 f=${QTHEADERDIR}
503 h=${QTLIBDIR}
504 while [[ -n ${f} && ${f%%/*} == ${h%%/*} ]] ; do
505 f=${f#*/}
506 h=${h#*/}
507 done
508 rdir=${h}
509 f="../"
510 while [[ ${h} == */* ]] ; do
511 f="${f}../"
512 h=${h#*/}
513 done
514 rdir="${f}${rdir}"
515
406 for frw in "${D}${QTLIBDIR}"/*.framework; do 516 for frw in "${D}${QTLIBDIR}"/*.framework; do
407 [[ -e "${frw}"/Headers ]] || continue 517 [[ -e "${frw}"/Headers ]] || continue
408 f=$(basename ${frw}) 518 f=$(basename ${frw})
409 dest="${QTHEADERDIR#${EPREFIX}}"/${f%.framework} 519 dest="${QTHEADERDIR#${EPREFIX}}"/${f%.framework}
410 dosym "${QTLIBDIR#${EPREFIX}}"/${f}/Headers "${dest}" 520 dosym "${rdir}"/${f}/Headers "${dest}"
411 521
412 # Link normal headers as well. 522 # Link normal headers as well.
413 for hdr in "${D}/${QTLIBDIR}/${f}"/Headers/*; do 523 for hdr in "${D}/${QTLIBDIR}/${f}"/Headers/*; do
414 h=$(basename ${hdr}) 524 h=$(basename ${hdr})
415 dosym "${QTLIBDIR#${EPREFIX}}"/${f}/Headers/${h} "${QTHEADERDIR#${EPREFIX}}"/Qt/${h} 525 dosym "../${rdir}"/${f}/Headers/${h} \
526 "${QTHEADERDIR#${EPREFIX}}"/Qt/${h}
416 done 527 done
417 done 528 done
418 fi 529 fi
419} 530}
420 531
421# @FUNCTION: qt4-build_src_install 532# @FUNCTION: qt4-build_src_install
422# @DESCRIPTION: 533# @DESCRIPTION:
423# Perform the actual installation including some library fixes. 534# Perform the actual installation including some library fixes.
424qt4-build_src_install() { 535qt4-build_src_install() {
425 [[ ${EAPI} == 2 ]] && use !prefix && ED=${D}
426 setqtenv 536 setqtenv
427 537
428 install_directories ${QT4_TARGET_DIRECTORIES} 538 install_directories ${QT4_TARGET_DIRECTORIES}
429 install_qconfigs 539 install_qconfigs
430 fix_library_files 540 fix_library_files
431 fix_includes 541 fix_includes
432 542
433 # remove .la files since we are building only shared Qt libraries 543 # remove .la files since we are building only shared libraries
434 find "${D}"${QTLIBDIR} -type f -name '*.la' -print0 | xargs -0 rm -f 544 prune_libtool_files
435} 545}
436 546
437# @FUNCTION: setqtenv 547# @FUNCTION: setqtenv
438# @INTERNAL 548# @INTERNAL
439setqtenv() { 549setqtenv() {
440 # Set up installation directories 550 # Set up installation directories
441 QTPREFIXDIR=${EPREFIX}/usr 551 QTPREFIXDIR=${EPREFIX}/usr
442 QTBINDIR=${EPREFIX}/usr/bin 552 QTBINDIR=${QTPREFIXDIR}/bin
443 QTLIBDIR=${EPREFIX}/usr/$(get_libdir)/qt4 553 QTLIBDIR=${QTPREFIXDIR}/$(get_libdir)/qt4
444 QTPCDIR=${EPREFIX}/usr/$(get_libdir)/pkgconfig 554 QTPCDIR=${QTPREFIXDIR}/$(get_libdir)/pkgconfig
445 QTDOCDIR=${EPREFIX}/usr/share/doc/qt-${PV} 555 QTDOCDIR=${QTPREFIXDIR}/share/doc/qt-${PV}
446 QTHEADERDIR=${EPREFIX}/usr/include/qt4 556 QTHEADERDIR=${QTPREFIXDIR}/include/qt4
447 QTPLUGINDIR=${QTLIBDIR}/plugins 557 QTPLUGINDIR=${QTLIBDIR}/plugins
448 QTIMPORTDIR=${QTLIBDIR}/imports 558 QTIMPORTDIR=${QTLIBDIR}/imports
449 QTDATADIR=${EPREFIX}/usr/share/qt4 559 QTDATADIR=${QTPREFIXDIR}/share/qt4
450 QTTRANSDIR=${QTDATADIR}/translations 560 QTTRANSDIR=${QTDATADIR}/translations
451 QTSYSCONFDIR=${EPREFIX}/etc/qt4 561 QTSYSCONFDIR=${EPREFIX}/etc/qt4
452 QTEXAMPLESDIR=${QTDATADIR}/examples 562 QTEXAMPLESDIR=${QTDATADIR}/examples
453 QTDEMOSDIR=${QTDATADIR}/demos 563 QTDEMOSDIR=${QTDATADIR}/demos
454 QMAKE_LIBDIR_QT=${QTLIBDIR} 564 QMAKE_LIBDIR_QT=${QTLIBDIR}
455 QT_INSTALL_PREFIX=${EPREFIX}/usr/$(get_libdir)/qt4
456 565
457 PLATFORM=$(qt_mkspecs_dir) 566 PLATFORM=$(qt_mkspecs_dir)
458
459 unset QMAKESPEC 567 unset QMAKESPEC
460}
461 568
462# @FUNCTION: standard_configure_options 569 export XDG_CONFIG_HOME="${T}"
463# @INTERNAL
464# @DESCRIPTION:
465# Sets up some standard configure options, like libdir (if necessary), whether
466# debug info is wanted or not.
467standard_configure_options() {
468 local myconf="-prefix ${QTPREFIXDIR} -bindir ${QTBINDIR} -libdir ${QTLIBDIR}
469 -docdir ${QTDOCDIR} -headerdir ${QTHEADERDIR} -plugindir ${QTPLUGINDIR}
470 $(version_is_at_least 4.7 && echo -importdir ${QTIMPORTDIR})
471 -datadir ${QTDATADIR} -translationdir ${QTTRANSDIR} -sysconfdir ${QTSYSCONFDIR}
472 -examplesdir ${QTEXAMPLESDIR} -demosdir ${QTDEMOSDIR}
473 -opensource -confirm-license -shared -fast -largefile -stl -verbose
474 -platform $(qt_mkspecs_dir) -nomake examples -nomake demos"
475
476 [[ $(get_libdir) != lib ]] && myconf+=" -L${EPREFIX}/usr/$(get_libdir)"
477
478 # debug/release
479 if use debug; then
480 myconf+=" -debug"
481 else
482 myconf+=" -release"
483 fi
484 myconf+=" -no-separate-debug-info"
485
486 # exceptions USE flag
487 local exceptions="-exceptions"
488 in_iuse exceptions && exceptions="$(qt_use exceptions)"
489 myconf+=" ${exceptions}"
490
491 # disable RPATH on Qt >= 4.8 (bug 380415)
492 version_is_at_least 4.8 && myconf+=" -no-rpath"
493
494 # precompiled headers don't work on hardened, where the flag is masked
495 myconf+=" $(qt_use pch)"
496
497 # -reduce-relocations
498 # This flag seems to introduce major breakage to applications,
499 # mostly to be seen as a core dump with the message "QPixmap: Must
500 # construct a QApplication before a QPaintDevice" on Solaris.
501 # -- Daniel Vergien
502 [[ ${CHOST} != *-solaris* ]] && myconf+=" -reduce-relocations"
503
504 use aqua && myconf+=" -no-framework"
505
506 # ARCH is set on Gentoo. Qt now falls back to generic on an unsupported
507 # $(tc-arch). Therefore we convert it to supported values.
508 case "$(tc-arch)" in
509 amd64|x64-*) myconf+=" -arch x86_64" ;;
510 ppc-macos) myconf+=" -arch ppc" ;;
511 ppc|ppc64|ppc-*) myconf+=" -arch powerpc" ;;
512 sparc|sparc-*|sparc64-*) myconf+=" -arch sparc" ;;
513 x86-macos) myconf+=" -arch x86" ;;
514 x86|x86-*) myconf+=" -arch i386" ;;
515 alpha|arm|ia64|mips|s390) myconf+=" -arch $(tc-arch)" ;;
516 hppa|sh) myconf+=" -arch generic" ;;
517 *) die "$(tc-arch) is unsupported by this eclass. Please file a bug." ;;
518 esac
519
520 echo "${myconf}"
521} 570}
522 571
523# @FUNCTION: prepare_directories 572# @FUNCTION: prepare_directories
524# @USAGE: < directories > 573# @USAGE: < directories >
525# @INTERNAL 574# @INTERNAL
526# @DESCRIPTION: 575# @DESCRIPTION:
527# Generates Makefiles for the given list of directories. 576# Generates Makefiles for the given list of directories.
528prepare_directories() { 577prepare_directories() {
578 # avoid running over the maximum argument number, bug #299810
579 {
580 echo "${S}"/mkspecs/common/*.conf
581 find "${S}" -name '*.pr[io]'
582 } | xargs sed -i \
583 -e "s:\$\$\[QT_INSTALL_LIBS\]:${QTLIBDIR}:g" \
584 -e "s:\$\$\[QT_INSTALL_PLUGINS\]:${QTPLUGINDIR}:g" \
585 || die
586
529 for x in "$@"; do 587 for x in "$@"; do
530 pushd "${S}"/${x} >/dev/null || die 588 pushd "${S}"/${x} >/dev/null || die
531 einfo "Running qmake in: ${x}" 589 einfo "Running qmake in: ${x}"
532 # avoid running over the maximum argument number, bug #299810 590 "${S}"/bin/qmake \
533 { 591 "LIBS+=-L${QTLIBDIR}" \
534 echo "${S}"/mkspecs/common/*.conf 592 "CONFIG+=nostrip" \
535 find "${S}" -name '*.pr[io]' 593 || die "qmake failed"
536 } | xargs sed -i \
537 -e "s:\$\$\[QT_INSTALL_LIBS\]:${QTLIBDIR}:g" \
538 -e "s:\$\$\[QT_INSTALL_PLUGINS\]:${QTPLUGINDIR}:g" \
539 || die
540 "${S}"/bin/qmake "LIBS+=-L${QTLIBDIR}" "CONFIG+=nostrip" || die "qmake failed"
541 popd >/dev/null || die 594 popd >/dev/null || die
542 done 595 done
543} 596}
544
545 597
546# @FUNCTION: build_directories 598# @FUNCTION: build_directories
547# @USAGE: < directories > 599# @USAGE: < directories >
548# @INTERNAL 600# @INTERNAL
549# @DESCRIPTION: 601# @DESCRIPTION:
550# Compiles the code in the given list of directories. 602# Compiles the code in the given list of directories.
551build_directories() { 603build_directories() {
552 for x in "$@"; do 604 for x in "$@"; do
553 pushd "${S}"/${x} >/dev/null || die 605 pushd "${S}"/${x} >/dev/null || die
606 emake \
607 AR="$(tc-getAR) cqs" \
554 emake CC="$(tc-getCC)" \ 608 CC="$(tc-getCC)" \
555 CXX="$(tc-getCXX)" \ 609 CXX="$(tc-getCXX)" \
556 LINK="$(tc-getCXX)" || die "emake failed" 610 LINK="$(tc-getCXX)" \
611 RANLIB=":" \
612 STRIP=":" \
613 || die "emake failed"
557 popd >/dev/null || die 614 popd >/dev/null || die
558 done 615 done
559} 616}
560 617
561# @FUNCTION: install_directories 618# @FUNCTION: install_directories
612# @FUNCTION: generate_qconfigs 669# @FUNCTION: generate_qconfigs
613# @INTERNAL 670# @INTERNAL
614# @DESCRIPTION: 671# @DESCRIPTION:
615# Generates gentoo-specific qconfig.{h,pri}. 672# Generates gentoo-specific qconfig.{h,pri}.
616generate_qconfigs() { 673generate_qconfigs() {
617 if [[ -n ${QCONFIG_ADD} || -n ${QCONFIG_REMOVE} || -n ${QCONFIG_DEFINE} || ${CATEGORY}/${PN} == x11-libs/qt-core ]]; then 674 if [[ -n ${QCONFIG_ADD} || -n ${QCONFIG_REMOVE} || -n ${QCONFIG_DEFINE} || ${PN} == qt-core ]]; then
618 local x qconfig_add qconfig_remove qconfig_new 675 local x qconfig_add qconfig_remove qconfig_new
619 for x in "${ROOT}${QTDATADIR}"/mkspecs/gentoo/*-qconfig.pri; do 676 for x in "${ROOT}${QTDATADIR}"/mkspecs/gentoo/*-qconfig.pri; do
620 [[ -f ${x} ]] || continue 677 [[ -f ${x} ]] || continue
621 qconfig_add+=" $(sed -n 's/^QCONFIG_ADD=//p' "${x}")" 678 qconfig_add+=" $(sed -n 's/^QCONFIG_ADD=//p' "${x}")"
622 qconfig_remove+=" $(sed -n 's/^QCONFIG_REMOVE=//p' "${x}")" 679 qconfig_remove+=" $(sed -n 's/^QCONFIG_REMOVE=//p' "${x}")"
753# @RETURN: the specs-directory w/o path 810# @RETURN: the specs-directory w/o path
754# @DESCRIPTION: 811# @DESCRIPTION:
755# Allows us to define which mkspecs dir we want to use. 812# Allows us to define which mkspecs dir we want to use.
756qt_mkspecs_dir() { 813qt_mkspecs_dir() {
757 local spec= 814 local spec=
815
758 case ${CHOST} in 816 case "${CHOST}" in
759 *-freebsd*|*-dragonfly*) 817 *-freebsd*|*-dragonfly*)
760 spec=freebsd ;; 818 spec=freebsd ;;
761 *-openbsd*) 819 *-openbsd*)
762 spec=openbsd ;; 820 spec=openbsd ;;
763 *-netbsd*) 821 *-netbsd*)
774 *-solaris*) 832 *-solaris*)
775 spec=solaris ;; 833 spec=solaris ;;
776 *-linux-*|*-linux) 834 *-linux-*|*-linux)
777 spec=linux ;; 835 spec=linux ;;
778 *) 836 *)
779 die "Unknown CHOST, no platform chosen" 837 die "${FUNCNAME}(): Unknown CHOST '${CHOST}'" ;;
780 esac 838 esac
781 839
782 CXX=$(tc-getCXX) 840 case "$(tc-getCXX)" in
783 if [[ ${CXX} == *g++* ]]; then 841 *g++*)
784 spec+=-g++ 842 spec+=-g++ ;;
785 elif [[ ${CXX} == *icpc* ]]; then 843 *icpc*)
786 spec+=-icc 844 spec+=-icc ;;
787 else 845 *)
788 die "Unknown compiler '${CXX}'" 846 die "${FUNCNAME}(): Unknown compiler '$(tc-getCXX)'" ;;
789 fi 847 esac
790 848
791 # Add -64 for 64bit profiles 849 # Add -64 for 64bit profiles
792 if use x64-freebsd || 850 if use x64-freebsd ||
793 use amd64-linux || 851 use amd64-linux ||
794 use x64-macos || 852 use x64-macos ||
799 fi 857 fi
800 858
801 echo "${spec}" 859 echo "${spec}"
802} 860}
803 861
804# @FUNCTION: qt_assistant_cleanup
805# @INTERNAL
806# @DESCRIPTION:
807# Tries to clean up tools.pro for qt-assistant ebuilds.
808# Meant to be called in src_prepare().
809# Since Qt 4.7.4 this function is a no-op.
810qt_assistant_cleanup() {
811 # apply patching to qt-assistant ebuilds only
812 [[ ${PN} != "qt-assistant" ]] && return
813
814 # no longer needed for 4.7.4 and later
815 version_is_at_least "4.7.4" && return
816
817 # different versions (and branches...) may need different handling,
818 # add a case if you need special handling
819 case "${MY_PV_EXTRA}" in
820 *kde-qt*)
821 sed -e "/^[ \t]*porting/,/^[ \t]*win32.*activeqt$/d" \
822 -e "/mac/,/^embedded.*makeqpf$/d" \
823 -i tools/tools.pro || die "patching tools.pro failed"
824 ;;
825 *)
826 sed -e "/^[ \t]*porting/,/^[ \t]*win32.*activeqt$/d" \
827 -e "/mac/,/^embedded.*makeqpf$/d" \
828 -e "s/^\([ \t]*pixeltool\) /\1 qdoc3 /" \
829 -i tools/tools.pro || die "patching tools.pro failed"
830 ;;
831 esac
832}
833
834# @FUNCTION: qt_nolibx11 862# @FUNCTION: qt_nolibx11
835# @INTERNAL 863# @INTERNAL
836# @DESCRIPTION: 864# @DESCRIPTION:
837# Ignore X11 tests for packages that don't need X libraries installed. 865# Ignore X11 tests for packages that don't need X libraries installed.
838qt_nolibx11() { 866qt_nolibx11() {

Legend:
Removed from v.1.119  
changed lines
  Added in v.1.141

  ViewVC Help
Powered by ViewVC 1.1.20