Gentoo Archives: gentoo-commits

From: Davide Pesavento <pesa@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/qt:master commit in: eclass/
Date: Sun, 01 Jun 2014 02:41:44
Message-Id: 1401590396.5e4bec4f6f92e1ca4a3d6bab63604c8ae8c59b29.pesa@gentoo
1 commit: 5e4bec4f6f92e1ca4a3d6bab63604c8ae8c59b29
2 Author: Davide Pesavento <pesa <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jun 1 01:38:35 2014 +0000
4 Commit: Davide Pesavento <pesa <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 1 02:39:56 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/qt.git;a=commit;h=5e4bec4f
7
8 [qt4-build-multilib.eclass] Initial multilib support.
9
10 ---
11 eclass/qt4-build-multilib.eclass | 68 +++++++++++++++++++++++++++++-----------
12 1 file changed, 50 insertions(+), 18 deletions(-)
13
14 diff --git a/eclass/qt4-build-multilib.eclass b/eclass/qt4-build-multilib.eclass
15 index 2fe2bce..9c0d397 100644
16 --- a/eclass/qt4-build-multilib.eclass
17 +++ b/eclass/qt4-build-multilib.eclass
18 @@ -17,7 +17,7 @@ case ${EAPI} in
19 *) die "qt4-build-multilib.eclass: unsupported EAPI=${EAPI:-0}" ;;
20 esac
21
22 -inherit eutils flag-o-matic multilib toolchain-funcs # TODO multilib-minimal
23 +inherit eutils flag-o-matic multilib multilib-minimal toolchain-funcs
24
25 HOMEPAGE="http://qt-project.org/ http://qt.digia.com/"
26 LICENSE="|| ( LGPL-2.1 GPL-3 )"
27 @@ -46,10 +46,10 @@ if [[ ${PN} != qttranslations ]]; then
28 [[ ${PN} != qtxmlpatterns ]] && IUSE+=" +exceptions"
29 fi
30
31 -DEPEND="virtual/pkgconfig"
32 -if [[ ${QT4_BUILD_TYPE} == live ]]; then
33 - DEPEND+=" dev-lang/perl"
34 -fi
35 +DEPEND="
36 + dev-lang/perl
37 + virtual/pkgconfig[${MULTILIB_USEDEP}]
38 +"
39
40 EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm
41
42 @@ -106,12 +106,9 @@ qt4-build-multilib_src_unpack() {
43 # Prepare the sources before the configure phase. Strip CFLAGS if necessary, and fix
44 # the build system in order to respect CFLAGS/CXXFLAGS/LDFLAGS specified in make.conf.
45 qt4-build-multilib_src_prepare() {
46 - qt4_prepare_env
47 -
48 if [[ ${PN} != qtcore ]]; then
49 skip_qmake_build
50 skip_project_generation
51 - symlink_tools_to_buildtree
52 fi
53
54 # skip X11 tests in non-gui packages to avoid spurious dependencies
55 @@ -244,6 +241,16 @@ qt4-build-multilib_src_prepare() {
56 # @DESCRIPTION:
57 # Runs configure and generates Makefiles for all QT4_TARGET_DIRECTORIES.
58 qt4-build-multilib_src_configure() {
59 + multilib-minimal_src_configure
60 +}
61 +
62 +multilib_src_configure() {
63 + qt4_prepare_env
64 +
65 + if [[ ${PN} != qtcore ]]; then
66 + qt4_symlink_tools_to_build_dir
67 + fi
68 +
69 # toolchain setup
70 tc-export CC CXX OBJCOPY STRIP
71 export AR="$(tc-getAR) cqs"
72 @@ -331,11 +338,11 @@ qt4-build-multilib_src_configure() {
73 fi
74 fi
75
76 + # append module-specific arguments
77 conf+=" ${myconf}"
78 - myconf=
79
80 einfo "Configuring with:" ${conf}
81 - ./configure ${conf} || die "configure failed"
82 + "${S}"/configure ${conf} || die "configure failed"
83
84 # configure is stupid and assigns QMAKE_LFLAGS twice,
85 # thus the previous -rpath-link flag gets overwritten
86 @@ -345,12 +352,17 @@ qt4-build-multilib_src_configure() {
87
88 local dir
89 for dir in . ${QT4_TARGET_DIRECTORIES}; do
90 - pushd ${dir} >/dev/null || die
91 + mkdir -p "${dir}" || die
92 + pushd "${dir}" >/dev/null || die
93 +
94 + local projectdir=${PWD/#${BUILD_DIR}/${S}}
95 einfo "Running qmake in: ${dir}"
96 - "${S}"/bin/qmake \
97 - LIBS+=-L"${QT4_LIBDIR}" \
98 + "${BUILD_DIR}"/bin/qmake \
99 CONFIG+=nostrip \
100 - || die "qmake failed"
101 + LIBS+=-L"${QT4_LIBDIR}" \
102 + "${projectdir}" \
103 + || die "qmake failed (${projectdir})"
104 +
105 popd >/dev/null || die
106 done
107 }
108 @@ -359,6 +371,12 @@ qt4-build-multilib_src_configure() {
109 # @DESCRIPTION:
110 # Compiles the code in QT4_TARGET_DIRECTORIES.
111 qt4-build-multilib_src_compile() {
112 + multilib-minimal_src_compile
113 +}
114 +
115 +multilib_src_compile() {
116 + qt4_prepare_env
117 +
118 local dir
119 for dir in ${QT4_TARGET_DIRECTORIES}; do
120 pushd ${dir} >/dev/null || die
121 @@ -371,9 +389,15 @@ qt4-build-multilib_src_compile() {
122 # @DESCRIPTION:
123 # Runs unit tests in all QT4_TARGET_DIRECTORIES.
124 qt4-build-multilib_src_test() {
125 + multilib-minimal_src_test
126 +}
127 +
128 +multilib_src_test() {
129 # QtMultimedia does not have any test suite (bug #332299)
130 [[ ${PN} == qtmultimedia ]] && return
131
132 + qt4_prepare_env
133 +
134 local dir
135 for dir in ${QT4_TARGET_DIRECTORIES}; do
136 emake -j1 check -C ${dir}
137 @@ -385,6 +409,12 @@ qt4-build-multilib_src_test() {
138 # Performs the actual installation, running 'emake install'
139 # inside all QT4_TARGET_DIRECTORIES, and installing qconfigs.
140 qt4-build-multilib_src_install() {
141 + multilib-minimal_src_install
142 +}
143 +
144 +multilib_src_install() {
145 + qt4_prepare_env
146 +
147 local dir
148 for dir in ${QT4_TARGET_DIRECTORIES}; do
149 pushd ${dir} >/dev/null || die
150 @@ -577,15 +607,17 @@ skip_project_generation() {
151 sed -i -e "s:echo \"Finding:exit 0\n\necho \"Finding:g" "${S}"/configure || die
152 }
153
154 -# @FUNCTION: symlink_tools_to_buildtree
155 +# @FUNCTION: qt4_symlink_tools_to_build_dir
156 # @INTERNAL
157 # @DESCRIPTION:
158 -# Symlinks generated binaries to buildtree, so they can be used during compilation time.
159 -symlink_tools_to_buildtree() {
160 +# Symlinks qtcore tools to BUILD_DIR, so they can be used during compilation.
161 +qt4_symlink_tools_to_build_dir() {
162 + mkdir -p "${BUILD_DIR}"/bin || die
163 +
164 local bin
165 for bin in "${QT4_BINDIR}"/{qmake,moc,rcc,uic}; do
166 if [[ -e ${bin} ]]; then
167 - ln -s "${bin}" "${S}"/bin/ || die "failed to symlink ${bin}"
168 + ln -s "${bin}" "${BUILD_DIR}"/bin/ || die "failed to symlink ${bin}"
169 fi
170 done
171 }