Gentoo Archives: gentoo-commits

From: "Caleb Tennis (caleb)" <caleb@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in x11-libs/qt: qt-3.3.8-r4.ebuild qt-4.3.1-r1.ebuild
Date: Fri, 14 Sep 2007 21:39:56
Message-Id: E1IWIm6-0003q1-HF@stork.gentoo.org
1 caleb 07/09/14 21:32:30
2
3 Added: qt-3.3.8-r4.ebuild qt-4.3.1-r1.ebuild
4 Log:
5 adding
6
7 Revision Changes Path
8 1.1 x11-libs/qt/qt-3.3.8-r4.ebuild
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-libs/qt/qt-3.3.8-r4.ebuild?rev=1.1&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-libs/qt/qt-3.3.8-r4.ebuild?rev=1.1&content-type=text/plain
12
13 Index: qt-3.3.8-r4.ebuild
14 ===================================================================
15 # Copyright 1999-2007 Gentoo Foundation
16 # Distributed under the terms of the GNU General Public License v2
17 # $Header: /var/cvsroot/gentoo-x86/x11-libs/qt/qt-3.3.8-r4.ebuild,v 1.1 2007/09/14 21:32:30 caleb Exp $
18
19 # *** Please remember to update qt3.eclass when revbumping this ***
20
21 inherit eutils flag-o-matic toolchain-funcs
22
23 SRCTYPE="free"
24 DESCRIPTION="The Qt toolkit is a comprehensive C++ application development framework."
25 HOMEPAGE="http://www.trolltech.com/"
26
27 IMMQT_P="qt-x11-immodule-unified-qt3.3.8-20070321-gentoo"
28
29 SRC_URI="ftp://ftp.trolltech.com/qt/source/qt-x11-${SRCTYPE}-${PV}.tar.gz
30 immqt? ( mirror://gentoo/${IMMQT_P}.diff.bz2 )
31 immqt-bc? ( mirror://gentoo/${IMMQT_P}.diff.bz2 )"
32 LICENSE="|| ( QPL-1.0 GPL-2 )"
33
34 SLOT="3"
35 KEYWORDS="alpha amd64 hppa ia64 ~mips ppc ppc64 sparc x86 ~x86-fbsd"
36 IUSE="cups debug doc examples firebird gif ipv6 mysql nas nis odbc opengl postgres sqlite xinerama immqt immqt-bc"
37
38 DEPEND="x11-libs/libXcursor
39 x11-libs/libXi
40 x11-libs/libXrandr
41 x11-libs/libSM
42 x11-proto/inputproto
43 x11-proto/xextproto
44 xinerama? ( x11-proto/xineramaproto x11-libs/libXinerama )
45 immqt? ( x11-proto/xineramaproto )
46 immqt-bc? ( x11-proto/xineramaproto )
47 virtual/xft
48 media-libs/libpng
49 media-libs/jpeg
50 >=media-libs/libmng-1.0.9
51 >=media-libs/freetype-2
52 sys-libs/zlib
53 nas? ( >=media-libs/nas-1.5 )
54 mysql? ( virtual/mysql )
55 firebird? ( dev-db/firebird )
56 opengl? ( virtual/opengl virtual/glu )
57 postgres? ( dev-db/libpq )
58 cups? ( net-print/cups )"
59 PDEPEND="odbc? ( ~dev-db/qt-unixODBC-$PV )"
60
61 S=${WORKDIR}/qt-x11-${SRCTYPE}-${PV}
62
63 QTBASE=/usr/qt/3
64
65 pkg_setup() {
66 if use immqt && use immqt-bc ; then
67 ewarn
68 ewarn "immqt and immqt-bc are exclusive. You cannot set both."
69 ewarn "Please specify either immqt or immqt-bc."
70 ewarn
71 die
72 elif use immqt ; then
73 ewarn
74 ewarn "You are going to compile binary imcompatible immodule for Qt. This means"
75 ewarn "you have to recompile everything depending on Qt after you install it."
76 ewarn "Be aware."
77 ewarn
78 fi
79
80 export QTDIR=${S}
81
82 CXX=$(tc-getCXX)
83 if [[ ${CXX/g++/} != ${CXX} ]]; then
84 PLATCXX="g++"
85 elif [[ ${CXX/icpc/} != ${CXX} ]]; then
86 PLATCXX="icc"
87 else
88 die "Unknown compiler ${CXX}."
89 fi
90
91 case ${CHOST} in
92 *-freebsd*|*-dragonfly*)
93 PLATNAME="freebsd" ;;
94 *-openbsd*)
95 PLATNAME="openbsd" ;;
96 *-netbsd*)
97 PLATNAME="netbsd" ;;
98 *-darwin*)
99 PLATNAME="darwin" ;;
100 *-linux-*|*-linux)
101 PLATNAME="linux" ;;
102 *)
103 die "Unknown CHOST, no platform choosed."
104 esac
105
106 # probably this should be '*-64' for 64bit archs
107 # in a fully multilib environment (no compatibility symlinks)
108 export PLATFORM="${PLATNAME}-${PLATCXX}"
109 }
110
111 src_unpack() {
112 unpack ${A}
113 cd ${S}
114
115 sed -i -e 's:read acceptance:acceptance=yes:' configure
116
117 # Do not link with -rpath. See bug #75181.
118 find ${S}/mkspecs -name qmake.conf | xargs \
119 sed -i -e 's:QMAKE_RPATH.*:QMAKE_RPATH =:'
120
121 # Patch for uic includehint errors (aseigo patch)
122 epatch ${FILESDIR}/${P}-uic-fix.patch
123
124 # Patch for mysql unload crash (Bug #171883)
125 epatch ${FILESDIR}/${P}-mysql-unload-crash.diff
126
127 # KDE related patches
128 epatch ${FILESDIR}/0001-dnd_optimization.patch
129 epatch ${FILESDIR}/0002-dnd_active_window_fix.patch
130 epatch ${FILESDIR}/0038-dragobject-dont-prefer-unknown.patch
131 epatch ${FILESDIR}/0044-qscrollview-windowactivate-fix.diff
132 epatch ${FILESDIR}/0047-fix-kmenu-widget.diff
133 epatch ${FILESDIR}/0048-qclipboard_hack_80072.patch
134
135 # possible rce, CVE-2007-3388
136 epatch ${FILESDIR}/0081-format-string-fixes.diff
137
138 # Bug #192472
139 epatch ${FILESDIR}/${P}-unicode-off-by-one.patch
140
141 # ulibc patch (bug #100246)
142 epatch ${FILESDIR}/qt-ulibc.patch
143
144 # xinerama patch: http://ktown.kde.org/~seli/xinerama/
145 epatch "${FILESDIR}/${P}-seli-xinerama.patch"
146
147 epatch ${FILESDIR}/utf8-bug-qt3.diff
148
149 # Visibility patch, apply only on GCC 4.1 and later for safety
150 # [[ $(gcc-major-version)$(gcc-minor-version) -ge 41 ]] && \
151 epatch "${FILESDIR}/${P}-visibility.patch"
152
153 if use immqt || use immqt-bc ; then
154 epatch ../${IMMQT_P}.diff
155 sh make-symlinks.sh || die "make symlinks failed"
156 fi
157
158 if use ppc-macos ; then
159 epatch "${FILESDIR}/${PN}-3.3.5-macos.patch"
160 fi
161
162 # known working flags wrt #77623
163 use sparc && export CFLAGS="-O1" && export CXXFLAGS="${CFLAGS}"
164 # set c/xxflags and ldflags
165 strip-flags
166 append-flags -fno-strict-aliasing
167 sed -i -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \
168 -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \
169 -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=${LDFLAGS}:" \
170 -e "s:\<QMAKE_CC\>.*=.*:QMAKE_CC=$(tc-getCC):" \
171 -e "s:\<QMAKE_CXX\>.*=.*:QMAKE_CXX=$(tc-getCXX):" \
172 -e "s:\<QMAKE_LINK\>.*=.*:QMAKE_LINK=$(tc-getCXX):" \
173 -e "s:\<QMAKE_LINK_SHLIB\>.*=.*:QMAKE_LINK_SHLIB=$(tc-getCXX):" \
174 ${S}/mkspecs/${PLATFORM}/qmake.conf || die
175
176 if [ $(get_libdir) != "lib" ] ; then
177 sed -i -e "s:/lib$:/$(get_libdir):" \
178 ${S}/mkspecs/${PLATFORM}/qmake.conf || die
179 fi
180 }
181
182 src_compile() {
183 export SYSCONF=${D}${QTBASE}/etc/settings
184
185 # Let's just allow writing to these directories during Qt emerge
186 # as it makes Qt much happier.
187 addwrite "${QTBASE}/etc/settings"
188 addwrite "${HOME}/.qt"
189
190 [ $(get_libdir) != "lib" ] && myconf="${myconf} -L/usr/$(get_libdir)"
191
192 # unixODBC support is now a PDEPEND on dev-db/qt-unixODBC; see bug 14178.
193 use nas && myconf="${myconf} -system-nas-sound"
194 use nis && myconf="${myconf} -nis" || myconf="${myconf} -no-nis"
195 use gif && myconf="${myconf} -qt-gif" || myconf="${myconf} -no-gif"
196 use mysql && myconf="${myconf} -plugin-sql-mysql -I/usr/include/mysql -L/usr/$(get_libdir)/mysql" || myconf="${myconf} -no-sql-mysql"
197 use postgres && myconf="${myconf} -plugin-sql-psql -I/usr/include/postgresql/server -I/usr/include/postgresql/pgsql -I/usr/include/postgresql/pgsql/server" || myconf="${myconf} -no-sql-psql"
198 use firebird && myconf="${myconf} -plugin-sql-ibase -I/opt/firebird/include" || myconf="${myconf} -no-sql-ibase"
199 use sqlite && myconf="${myconf} -plugin-sql-sqlite" || myconf="${myconf} -no-sql-sqlite"
200 use cups && myconf="${myconf} -cups" || myconf="${myconf} -no-cups"
201 use opengl && myconf="${myconf} -enable-module=opengl" || myconf="${myconf} -disable-opengl"
202 use debug && myconf="${myconf} -debug" || myconf="${myconf} -release -no-g++-exceptions"
203 use xinerama && myconf="${myconf} -xinerama" || myconf="${myconf} -no-xinerama"
204
205 myconf="${myconf} -system-zlib"
206
207 use ipv6 && myconf="${myconf} -ipv6" || myconf="${myconf} -no-ipv6"
208 use immqt-bc && myconf="${myconf} -inputmethod"
209 use immqt && myconf="${myconf} -inputmethod -inputmethod-ext"
210
211 if use ppc-macos ; then
212 myconf="${myconf} -no-sql-ibase -no-sql-mysql -no-sql-psql -no-cups -lresolv -shared"
213 myconf="${myconf} -I/usr/X11R6/include -L/usr/X11R6/lib"
214 myconf="${myconf} -L${S}/lib -I${S}/include"
215 sed -i -e "s,#define QT_AOUT_UNDERSCORE,," mkspecs/${PLATFORM}/qplatformdefs.h || die
216 fi
217
218 export YACC='byacc -d'
219 tc-export CC CXX
220 export LINK="$(tc-getCXX)"
221
222 ./configure -sm -thread -stl -system-libjpeg -verbose -largefile \
223 -qt-imgfmt-{jpeg,mng,png} -tablet -system-libmng \
224 -system-libpng -xft -platform ${PLATFORM} -xplatform \
225 ${PLATFORM} -xrender -prefix ${QTBASE} -libdir ${QTBASE}/$(get_libdir) \
226 -fast -no-sql-odbc ${myconf} -dlopen-opengl || die
227
228 emake src-qmake src-moc sub-src || die
229
230 export DYLD_LIBRARY_PATH="${S}/lib:/usr/X11R6/lib:${DYLD_LIBRARY_PATH}"
231 export LD_LIBRARY_PATH="${S}/lib:${LD_LIBRARY_PATH}"
232
233 emake sub-tools || die
234
235 if use examples; then
236 emake sub-tutorial sub-examples || die
237 fi
238
239 # Make the msg2qm utility (not made by default)
240 cd ${S}/tools/msg2qm
241 ../../bin/qmake
242 emake
243
244 # Make the qembed utility (not made by default)
245 cd ${S}/tools/qembed
246 ../../bin/qmake
247 emake
248
249 }
250
251 src_install() {
252 # binaries
253 into ${QTBASE}
254 dobin bin/*
255 dobin tools/msg2qm/msg2qm
256 dobin tools/qembed/qembed
257
258 # libraries
259 if use ppc-macos; then
260 # dolib is broken on BSD because of missing readlink(1)
261 dodir ${QTBASE}/$(get_libdir)
262 cp -fR lib/*.{dylib,la,a} ${D}/${QTBASE}/$(get_libdir) || die
263
264 cd ${D}/${QTBASE}/$(get_libdir)
265 for lib in libqt-mt* ; do
266 ln -s ${lib} ${lib/-mt/}
267 done
268 else
269 dolib.so lib/lib{editor,qassistantclient,designercore}.a
270 dolib.so lib/libqt-mt.la
271 dolib.so lib/libqt-mt.so.${PV} lib/libqui.so.1.0.0
272 cd ${D}/${QTBASE}/$(get_libdir)
273
274 for x in libqui.so ; do
275 ln -s $x.1.0.0 $x.1.0
276 ln -s $x.1.0 $x.1
277 ln -s $x.1 $x
278 done
279
280 # version symlinks - 3.3.5->3.3->3->.so
281 ln -s libqt-mt.so.${PV} libqt-mt.so.3.3
282 ln -s libqt-mt.so.3.3 libqt-mt.so.3
283 ln -s libqt-mt.so.3 libqt-mt.so
284
285 # libqt -> libqt-mt symlinks
286 ln -s libqt-mt.so.${PV} libqt.so.${PV}
287 ln -s libqt-mt.so.3.3 libqt.so.3.3
288 ln -s libqt-mt.so.3 libqt.so.3
289 ln -s libqt-mt.so libqt.so
290 fi
291
292 # plugins
293 cd ${S}
294 local plugins=$(find plugins -name "lib*.so" -print)
295 for x in ${plugins}; do
296 exeinto ${QTBASE}/$(dirname ${x})
297 doexe ${x}
298 done
299
300 # Past this point just needs to be done once
301 is_final_abi || return 0
302
303 # includes
304 cd ${S}
305 dodir ${QTBASE}/include/private
306 cp include/* ${D}/${QTBASE}/include/
307 cp include/private/* ${D}/${QTBASE}/include/private/
308
309 # prl files
310 sed -i -e "s:${S}:${QTBASE}:g" ${S}/lib/*.prl
311 insinto ${QTBASE}/$(get_libdir)
312 doins ${S}/lib/*.prl
313
314 # pkg-config file
315 insinto ${QTBASE}/$(get_libdir)/pkgconfig
316 doins ${S}/lib/*.pc
317
318 # List all the multilib libdirs
319 local libdirs
320 for libdir in $(get_all_libdirs); do
321 libdirs="${libdirs}:${QTBASE}/${libdir}"
322 done
323
324 # environment variables
325 if use ppc-macos; then
326 cat <<EOF > ${T}/45qt3
327 PATH=${QTBASE}/bin
328 ROOTPATH=${QTBASE}/bin
329 DYLD_LIBRARY_PATH=${libdirs:1}
330 QMAKESPEC=${PLATFORM}
331 MANPATH=${QTBASE}/doc/man
332 PKG_CONFIG_PATH=${QTBASE}/$(get_libdir)/pkgconfig
333 EOF
334 else
335 cat <<EOF > ${T}/45qt3
336 PATH=${QTBASE}/bin
337 ROOTPATH=${QTBASE}/bin
338 LDPATH=${libdirs:1}
339 QMAKESPEC=${PLATFORM}
340 MANPATH=${QTBASE}/doc/man
341 PKG_CONFIG_PATH=${QTBASE}/$(get_libdir)/pkgconfig
342 EOF
343 fi
344 cat <<EOF > ${T}/50qtdir3
345 QTDIR=${QTBASE}
346 EOF
347
348 cat <<EOF > ${T}/50-qt3-revdep
349 SEARCH_DIRS="${QTBASE}"
350 EOF
351
352 insinto /etc/revdep-rebuild
353 doins ${T}/50-qt3-revdep
354
355 doenvd ${T}/45qt3 ${T}/50qtdir3
356
357 if [ "${SYMLINK_LIB}" = "yes" ]; then
358 dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) ${QTBASE}/lib
359 fi
360
361 insinto ${QTBASE}/tools/designer
362 doins -r tools/designer/templates
363
364 insinto ${QTBASE}
365 doins -r translations
366
367 keepdir ${QTBASE}/etc/settings
368
369 if use doc; then
370 insinto ${QTBASE}
371 doins -r ${S}/doc
372 fi
373
374 if use examples; then
375 find ${S}/examples ${S}/tutorial -name Makefile | \
376 xargs sed -i -e "s:${S}:${QTBASE}:g"
377
378 cp -r ${S}/examples ${D}${QTBASE}/
379 cp -r ${S}/tutorial ${D}${QTBASE}/
380 fi
381
382 # misc build reqs
383 insinto ${QTBASE}/mkspecs
384 doins -r ${S}/mkspecs/${PLATFORM}
385
386 sed -e "s:${S}:${QTBASE}:g" \
387 ${S}/.qmake.cache > ${D}${QTBASE}/.qmake.cache
388
389 dodoc FAQ README README-QT.TXT changes*
390 if use immqt || use immqt-bc ; then
391 dodoc ${S}/README.immodule
392 fi
393 }
394
395 pkg_postinst() {
396 echo
397 elog "After a rebuild of Qt, it can happen that Qt plugins (such as Qt/KDE styles,"
398 elog "or widgets for the Qt designer) are no longer recognized. If this situation"
399 elog "occurs you should recompile the packages providing these plugins,"
400 elog "and you should also make sure that Qt and its plugins were compiled with the"
401 elog "same version of gcc. Packages that may need to be rebuilt are, for instance,"
402 elog "kde-base/kdelibs, kde-base/kdeartwork and kde-base/kdeartwork-styles."
403 elog "See http://doc.trolltech.com/3.3/plugins-howto.html for more infos."
404 echo
405 }
406
407
408
409 1.1 x11-libs/qt/qt-4.3.1-r1.ebuild
410
411 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-libs/qt/qt-4.3.1-r1.ebuild?rev=1.1&view=markup
412 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-libs/qt/qt-4.3.1-r1.ebuild?rev=1.1&content-type=text/plain
413
414 Index: qt-4.3.1-r1.ebuild
415 ===================================================================
416 # Copyright 1999-2007 Gentoo Foundation
417 # Distributed under the terms of the GNU General Public License v2
418 # $Header: /var/cvsroot/gentoo-x86/x11-libs/qt/qt-4.3.1-r1.ebuild,v 1.1 2007/09/14 21:32:30 caleb Exp $
419
420 inherit eutils flag-o-matic toolchain-funcs multilib
421
422 SRCTYPE="opensource-src"
423 DESCRIPTION="The Qt toolkit is a comprehensive C++ application development framework."
424 HOMEPAGE="http://www.trolltech.com/"
425
426 SRC_URI="ftp://ftp.trolltech.com/pub/qt/source/qt-x11-${SRCTYPE}-${PV}.tar.gz"
427 S=${WORKDIR}/qt-x11-${SRCTYPE}-${PV}
428
429 LICENSE="|| ( QPL-1.0 GPL-2 )"
430 SLOT="4"
431 KEYWORDS="alpha amd64 hppa ia64 ~ppc ppc64 sparc x86 ~x86-fbsd"
432
433 IUSE_INPUT_DEVICES="input_devices_wacom"
434
435 IUSE="accessibility cups dbus debug doc examples firebird gif glib jpeg mng mysql nas nis odbc opengl pch png postgres qt3support sqlite sqlite3 ssl tiff xinerama zlib ${IUSE_INPUT_DEVICES}"
436
437 RDEPEND="x11-libs/libXrandr
438 x11-libs/libXcursor
439 x11-libs/libXfont
440 x11-libs/libSM
441 xinerama? ( x11-libs/libXinerama )
442 media-libs/fontconfig
443 >=media-libs/freetype-2
444 png? ( media-libs/libpng )
445 jpeg? ( media-libs/jpeg )
446 mng? ( >=media-libs/libmng-1.0.9 )
447 tiff? ( media-libs/tiff )
448 nas? ( >=media-libs/nas-1.5 )
449 odbc? ( dev-db/unixODBC )
450 mysql? ( virtual/mysql )
451 firebird? ( dev-db/firebird )
452 sqlite3? ( =dev-db/sqlite-3* )
453 sqlite? ( =dev-db/sqlite-2* )
454 opengl? ( virtual/opengl virtual/glu )
455 postgres? ( dev-db/libpq )
456 cups? ( net-print/cups )
457 zlib? ( sys-libs/zlib )
458 glib? ( dev-libs/glib )
459 dbus? ( >=sys-apps/dbus-1.0.2 )
460 ssl? ( dev-libs/openssl )
461 input_devices_wacom? ( x11-libs/libXi x11-drivers/linuxwacom )"
462
463 DEPEND="${RDEPEND}
464 xinerama? ( x11-proto/xineramaproto )
465 x11-proto/xextproto
466 input_devices_wacom? ( x11-proto/inputproto )
467 dev-util/pkgconfig"
468
469 pkg_setup() {
470 QTBASEDIR=/usr/$(get_libdir)/qt4
471 QTPREFIXDIR=/usr
472 QTBINDIR=/usr/bin
473 QTLIBDIR=/usr/$(get_libdir)/qt4
474 QTPCDIR=/usr/$(get_libdir)/pkgconfig
475 QTDATADIR=/usr/share/qt4
476 QTDOCDIR=/usr/share/doc/${PF}
477 QTHEADERDIR=/usr/include/qt4
478 QTPLUGINDIR=${QTLIBDIR}/plugins
479 QTSYSCONFDIR=/etc/qt4
480 QTTRANSDIR=${QTDATADIR}/translations
481 QTEXAMPLESDIR=${QTDATADIR}/examples
482 QTDEMOSDIR=${QTDATADIR}/demos
483
484 PLATFORM=$(qt_mkspecs_dir)
485
486 }
487
488 qt_use() {
489 local flag="$1"
490 local feature="$1"
491 local enableval=
492
493 [[ -n $2 ]] && feature=$2
494 [[ -n $3 ]] && enableval="-$3"
495
496 useq $flag && echo "${enableval}-${feature}" || echo "-no-${feature}"
497 return 0
498 }
499
500 qt_mkspecs_dir() {
501 # Allows us to define which mkspecs dir we want to use.
502 local spec
503
504 case ${CHOST} in
505 *-freebsd*|*-dragonfly*)
506 spec="freebsd" ;;
507 *-openbsd*)
508 spec="openbsd" ;;
509 *-netbsd*)
510 spec="netbsd" ;;
511 *-darwin*)
512 spec="darwin" ;;
513 *-linux-*|*-linux)
514 spec="linux" ;;
515 *)
516 die "Unknown CHOST, no platform choosed."
517 esac
518
519 CXX=$(tc-getCXX)
520 if [[ ${CXX/g++/} != ${CXX} ]]; then
521 spec="${spec}-g++"
522 elif [[ ${CXX/icpc/} != ${CXX} ]]; then
523 spec="${spec}-icc"
524 else
525 die "Unknown compiler ${CXX}."
526 fi
527
528 echo "${spec}"
529 }
530
531 src_unpack() {
532
533 unpack ${A}
534 cd ${S}
535 epatch ${FILESDIR}/qt-4.2.3-hppa-ldcw-fix.patch
536 epatch ${FILESDIR}/qt-4.3.1-powerpc64.patch
537
538 # Bug #182472
539 epatch ${FILESDIR}/${P}-unicode-off-by-one.patch
540
541 cd ${S}/mkspecs/$(qt_mkspecs_dir)
542 # set c/xxflags and ldflags
543
544 # Don't let the user go too overboard with flags. If you really want to, uncomment
545 # out the line below and give 'er a whirl.
546 strip-flags
547 replace-flags -O3 -O2
548
549 sed -i -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \
550 -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \
551 -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=${LDFLAGS}:" \
552 -e "/CONFIG/s:$: nostrip:" \
553 qmake.conf
554
555 # Do not link with -rpath. See bug #75181.
556 sed -i -e "s:QMAKE_RPATH.*=.*:QMAKE_RPATH=:" qmake.conf
557
558 # Replace X11R6/ directories, so /usr/X11R6/lib -> /usr/lib
559 sed -i -e "s:X11R6/::" qmake.conf
560
561 # The trolls moved the definitions of the above stuff for g++, so we need to edit those files
562 # separately as well.
563 cd ${S}/mkspecs/common
564
565 sed -i -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CPPFLAGS} ${CFLAGS} ${ASFLAGS}:" \
566 -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CPPFLAGS} ${CXXFLAGS} ${ASFLAGS}:" \
567 -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=${LDFLAGS}:" \
568 g++.conf
569
570 # Do not link with -rpath. See bug #75181.
571 sed -i -e "s:QMAKE_RPATH.*=.*:QMAKE_RPATH=:" g++.conf
572
573 # Replace X11R6/ directories, so /usr/X11R6/lib -> /usr/lib
574 sed -i -e "s:X11R6/::" linux.conf
575
576 cd ${S}/qmake
577
578 sed -i -e "s:CXXFLAGS.*=:CXXFLAGS=${CPPFLAGS} ${CXXFLAGS} ${ASFLAGS} :" \
579 -e "s:LFLAGS.*=:LFLAGS=${LDFLAGS} :" Makefile.unix
580
581 cd ${S}
582
583 }
584
585 src_compile() {
586 export PATH="${S}/bin:${PATH}"
587 export LD_LIBRARY_PATH="${S}/lib:${LD_LIBRARY_PATH}"
588
589 [ $(get_libdir) != "lib" ] && myconf="${myconf} -L/usr/$(get_libdir)"
590
591 # Disable visibility explicitly if gcc version isn't 4
592 if [[ "$(gcc-major-version)" != "4" ]]; then
593 myconf="${myconf} -no-reduce-exports"
594 fi
595
596 # Add a switch that will attempt to use recent binutils to reduce relocations. Should be harmless for other
597 # cases. From bug #178535
598 myconf="${myconf} -reduce-relocations"
599
600 myconf="${myconf} $(qt_use accessibility) $(qt_use cups) $(qt_use xinerama)"
601 myconf="${myconf} $(qt_use opengl) $(qt_use nis)"
602
603 use nas && myconf="${myconf} -system-nas-sound"
604
605 myconf="${myconf} $(qt_use gif gif qt) $(qt_use png libpng system)"
606 myconf="${myconf} $(qt_use jpeg libjpeg system) $(qt_use tiff libtiff system)"
607 myconf="${myconf} $(qt_use zlib zlib system) $(qt_use mng libmng system)"
608
609 use debug && myconf="${myconf} -debug -no-separate-debug-info" || myconf="${myconf} -release -no-separate-debug-info"
610
611 use mysql && myconf="${myconf} -plugin-sql-mysql -I/usr/include/mysql -L/usr/$(get_libdir)/mysql" || myconf="${myconf} -no-sql-mysql"
612 use postgres && myconf="${myconf} -plugin-sql-psql -I/usr/include/postgresql/pgsql" || myconf="${myconf} -no-sql-psql"
613 use firebird && myconf="${myconf} -plugin-sql-ibase -I/opt/firebird/include" || myconf="${myconf} -no-sql-ibase"
614 use sqlite3 && myconf="${myconf} -plugin-sql-sqlite -system-sqlite" || myconf="${myconf} -no-sql-sqlite"
615 use sqlite && myconf="${myconf} -plugin-sql-sqlite2" || myconf="${myconf} -no-sql-sqlite2"
616 use odbc && myconf="${myconf} -plugin-sql-odbc" || myconf="${myconf} -no-sql-odbc"
617
618 use dbus && myconf="${myconf} -qdbus" || myconf="${myconf} -no-qdbus"
619 use glib && myconf="${myconf} -glib" || myconf="${myconf} -no-glib"
620 use qt3support && myconf="${myconf} -qt3support" || myconf="${myconf} -no-qt3support"
621 use ssl && myconf="${myconf} -openssl" || myconf="${myconf} -no-openssl"
622
623 use pch && myconf="${myconf} -pch" || myconf="${myconf} -no-pch"
624
625 use input_devices_wacom && myconf="${myconf} -tablet" || myconf="${myconf} -no-tablet"
626
627 myconf="${myconf} -xrender -xrandr -xkb -xshape -sm"
628
629 if ! use examples; then
630 myconf="${myconf} -nomake examples"
631 fi
632
633 myconf="-stl -verbose -largefile -confirm-license \
634 -platform ${PLATFORM} -xplatform ${PLATFORM} -no-rpath \
635 -prefix ${QTPREFIXDIR} -bindir ${QTBINDIR} -libdir ${QTLIBDIR} -datadir ${QTDATADIR} \
636 -docdir ${QTDOCDIR} -headerdir ${QTHEADERDIR} -plugindir ${QTPLUGINDIR} \
637 -sysconfdir ${QTSYSCONFDIR} -translationdir ${QTTRANSDIR} \
638 -examplesdir ${QTEXAMPLESDIR} -demosdir ${QTDEMOSDIR} ${myconf}"
639
640 echo ./configure ${myconf}
641 ./configure ${myconf} || die
642
643 emake all || die
644 }
645
646 src_install() {
647 export PATH="${S}/bin:${PATH}"
648 export LD_LIBRARY_PATH="${S}/lib:${LD_LIBRARY_PATH}"
649
650 make INSTALL_ROOT=${D} install_subtargets || die
651 make INSTALL_ROOT=${D} install_qmake || die
652 make INSTALL_ROOT=${D} install_mkspecs || die
653
654 if use doc; then
655 make INSTALL_ROOT=${D} install_htmldocs || die
656 fi
657
658 # Install the translations. This may get use flagged later somehow
659 make INSTALL_ROOT=${D} install_translations || die
660
661 keepdir "${QTSYSCONFDIR}"
662
663 sed -i -e "s:${S}/lib:${QTLIBDIR}:g" ${D}/${QTLIBDIR}/*.la
664 sed -i -e "s:${S}/lib:${QTLIBDIR}:g" ${D}/${QTLIBDIR}/*.prl
665 sed -i -e "s:${S}/lib:${QTLIBDIR}:g" ${D}/${QTLIBDIR}/pkgconfig/*.pc
666
667 # pkgconfig files refer to WORKDIR/bin as the moc and uic locations. Fix:
668 sed -i -e "s:${S}/bin:${QTBINDIR}:g" ${D}/${QTLIBDIR}/pkgconfig/*.pc
669
670 # Move .pc files into the pkgconfig directory
671 dodir ${QTPCDIR}
672 mv ${D}/${QTLIBDIR}/pkgconfig/*.pc ${D}/${QTPCDIR}
673
674 # Install .desktop files, from bug #174033
675 insinto /usr/share/applications
676 doins ${FILESDIR}/qt4/*.desktop
677
678 # List all the multilib libdirs
679 local libdirs
680 for libdir in $(get_all_libdirs); do
681 libdirs="${libdirs}:/usr/${libdir}/qt4"
682 done
683
684 cat > "${T}/44qt4" << EOF
685 LDPATH=${libdirs:1}
686 QMAKESPEC=$(qt_mkspecs_dir)
687 EOF
688 doenvd "${T}/44qt4"
689 }
690
691
692
693 --
694 gentoo-commits@g.o mailing list