| 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.125 2012/04/19 14:52:12 pesa Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v 1.129 2012/05/20 17:12:34 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. |
| … | |
… | |
| 46 | fi |
46 | fi |
| 47 | if version_is_at_least 4.8; then |
47 | if version_is_at_least 4.8; then |
| 48 | IUSE+=" c++0x qpa" |
48 | IUSE+=" c++0x qpa" |
| 49 | fi |
49 | fi |
| 50 | |
50 | |
| 51 | DEPEND="dev-util/pkgconfig" |
51 | DEPEND="virtual/pkgconfig" |
| 52 | if [[ ${QT4_BUILD_TYPE} == live ]]; then |
52 | if [[ ${QT4_BUILD_TYPE} == live ]]; then |
| 53 | DEPEND+=" dev-lang/perl" |
53 | DEPEND+=" dev-lang/perl" |
| 54 | fi |
54 | fi |
| 55 | |
55 | |
| 56 | RDEPEND=" |
56 | RDEPEND=" |
| … | |
… | |
| 281 | sed -i -e "/bin\/qmake/ s: \"QT_BUILD_TREE=: \ |
281 | sed -i -e "/bin\/qmake/ s: \"QT_BUILD_TREE=: \ |
| 282 | 'QMAKE_CC=$(tc-getCC)' 'QMAKE_CXX=$(tc-getCXX)' 'QMAKE_LINK=$(tc-getCXX)' \ |
282 | 'QMAKE_CC=$(tc-getCC)' 'QMAKE_CXX=$(tc-getCXX)' 'QMAKE_LINK=$(tc-getCXX)' \ |
| 283 | 'QMAKE_CFLAGS+=${CFLAGS}' 'QMAKE_CXXFLAGS+=${CXXFLAGS}' 'QMAKE_LFLAGS+=${LDFLAGS}'&:" \ |
283 | 'QMAKE_CFLAGS+=${CFLAGS}' 'QMAKE_CXXFLAGS+=${CXXFLAGS}' 'QMAKE_LFLAGS+=${LDFLAGS}'&:" \ |
| 284 | || die "sed config.tests failed" |
284 | || die "sed config.tests failed" |
| 285 | |
285 | |
|
|
286 | if ! version_is_at_least 4.8; then |
| 286 | # Strip predefined CFLAGS from mkspecs (bug 312689) |
287 | # Strip predefined CFLAGS from mkspecs (bugs 312689 and 352778) |
| 287 | sed -i -e '/^QMAKE_CFLAGS_RELEASE/s:+=.*:+=:' mkspecs/common/g++.conf || die |
288 | sed -i -e '/^QMAKE_CFLAGS_RELEASE/s:+=.*:+=:' mkspecs/common/g++.conf || die |
|
|
289 | fi |
| 288 | |
290 | |
| 289 | # Bug 172219 |
291 | # Bug 172219 |
| 290 | sed -e 's:/X11R6/:/:' -i mkspecs/$(qt_mkspecs_dir)/qmake.conf || die |
292 | sed -e 's:/X11R6/:/:' -i mkspecs/$(qt_mkspecs_dir)/qmake.conf || die |
| 291 | |
293 | |
| 292 | if [[ ${CHOST} == *-darwin* ]]; then |
294 | if [[ ${CHOST} == *-darwin* ]]; then |
| … | |
… | |
| 502 | # @DESCRIPTION: |
504 | # @DESCRIPTION: |
| 503 | # For MacOS X we need to add some symlinks when frameworks are |
505 | # For MacOS X we need to add some symlinks when frameworks are |
| 504 | # being used, to avoid complications with some more or less stupid packages. |
506 | # being used, to avoid complications with some more or less stupid packages. |
| 505 | fix_includes() { |
507 | fix_includes() { |
| 506 | if use aqua && [[ ${CHOST##*-darwin} -ge 9 ]]; then |
508 | if use aqua && [[ ${CHOST##*-darwin} -ge 9 ]]; then |
|
|
509 | local frw dest f h rdir |
| 507 | # Some packages tend to include <Qt/...> |
510 | # Some packages tend to include <Qt/...> |
| 508 | dodir "${QTHEADERDIR#${EPREFIX}}"/Qt |
511 | dodir "${QTHEADERDIR#${EPREFIX}}"/Qt |
| 509 | |
512 | |
| 510 | # Fake normal headers when frameworks are installed... eases life later on |
513 | # Fake normal headers when frameworks are installed... eases life later |
| 511 | local dest f h |
514 | # on, make sure we use relative links though, as some ebuilds assume |
|
|
515 | # these dirs exist in src_install to add additional files |
|
|
516 | f=${QTHEADERDIR} |
|
|
517 | h=${QTLIBDIR} |
|
|
518 | while [[ -n ${f} && ${f%%/*} == ${h%%/*} ]] ; do |
|
|
519 | f=${f#*/} |
|
|
520 | h=${h#*/} |
|
|
521 | done |
|
|
522 | rdir=${h} |
|
|
523 | f="../" |
|
|
524 | while [[ ${h} == */* ]] ; do |
|
|
525 | f="${f}../" |
|
|
526 | h=${h#*/} |
|
|
527 | done |
|
|
528 | rdir="${f}${rdir}" |
|
|
529 | |
| 512 | for frw in "${D}${QTLIBDIR}"/*.framework; do |
530 | for frw in "${D}${QTLIBDIR}"/*.framework; do |
| 513 | [[ -e "${frw}"/Headers ]] || continue |
531 | [[ -e "${frw}"/Headers ]] || continue |
| 514 | f=$(basename ${frw}) |
532 | f=$(basename ${frw}) |
| 515 | dest="${QTHEADERDIR#${EPREFIX}}"/${f%.framework} |
533 | dest="${QTHEADERDIR#${EPREFIX}}"/${f%.framework} |
| 516 | dosym "${QTLIBDIR#${EPREFIX}}"/${f}/Headers "${dest}" |
534 | dosym "${rdir}"/${f}/Headers "${dest}" |
| 517 | |
535 | |
| 518 | # Link normal headers as well. |
536 | # Link normal headers as well. |
| 519 | for hdr in "${D}/${QTLIBDIR}/${f}"/Headers/*; do |
537 | for hdr in "${D}/${QTLIBDIR}/${f}"/Headers/*; do |
| 520 | h=$(basename ${hdr}) |
538 | h=$(basename ${hdr}) |
| 521 | dosym "${QTLIBDIR#${EPREFIX}}"/${f}/Headers/${h} "${QTHEADERDIR#${EPREFIX}}"/Qt/${h} |
539 | dosym "../${rdir}"/${f}/Headers/${h} \ |
|
|
540 | "${QTHEADERDIR#${EPREFIX}}"/Qt/${h} |
| 522 | done |
541 | done |
| 523 | done |
542 | done |
| 524 | fi |
543 | fi |
| 525 | } |
544 | } |
| 526 | |
545 | |
| … | |
… | |
| 559 | QTDEMOSDIR=${QTDATADIR}/demos |
578 | QTDEMOSDIR=${QTDATADIR}/demos |
| 560 | QMAKE_LIBDIR_QT=${QTLIBDIR} |
579 | QMAKE_LIBDIR_QT=${QTLIBDIR} |
| 561 | QT_INSTALL_PREFIX=${EPREFIX}/usr/$(get_libdir)/qt4 |
580 | QT_INSTALL_PREFIX=${EPREFIX}/usr/$(get_libdir)/qt4 |
| 562 | |
581 | |
| 563 | PLATFORM=$(qt_mkspecs_dir) |
582 | PLATFORM=$(qt_mkspecs_dir) |
| 564 | |
|
|
| 565 | unset QMAKESPEC |
583 | unset QMAKESPEC |
|
|
584 | |
|
|
585 | export XDG_CONFIG_HOME="${T}" |
| 566 | } |
586 | } |
| 567 | |
587 | |
| 568 | # @FUNCTION: prepare_directories |
588 | # @FUNCTION: prepare_directories |
| 569 | # @USAGE: < directories > |
589 | # @USAGE: < directories > |
| 570 | # @INTERNAL |
590 | # @INTERNAL |