--- /usr/portage/eclass/qt4.eclass 2006-08-16 12:35:50.000000000 +0000 +++ qt4.eclass 2006-09-24 17:34:52.000000000 +0000 @@ -13,7 +13,9 @@ # 08.16.06 - Renamed qt_min_* to qt4_min_* to avoid conflicts with the qt3 eclass. # - Caleb Tennis -inherit versionator +inherit eutils versionator + +IUSE="${IUSE} debug" QTPKG="x11-libs/qt-" QT4MAJORVERSIONS="4.1 4.0" @@ -50,3 +52,72 @@ echo "${VERSIONS}" } + +qt4_pkg_setup() { + if use debug && ! built_with_use qt debug; then + einfo + einfo "You are trying to compile ${PN} package with active USE=\"debug\"" + einfo "while qt4 is build without this particular flag. It will not" + einfo "work." + einfo + einfo "Possible solutions to this problem are:" + einfo "a) install package ${PN} without debug USE flag" + einfo "b) re-emerge qt4 with debug USE flag" + einfo + + die "can't emerge ${PN} with debug USE flag" + fi +} + +eqmake() { + local projprofile="" + if [ -z $1 ]; then + projprofile="${PN}.pro" + else + projprofile="${1}" + fi; + + einfo "Processing qmake ${projprofile}" + + # file exists? + if [[ ! -f ${projprofile} ]]; then + echo + eerror "Project pro file \"${projprofile}\" does not exists" + eerror "qmake cannot handle the non-existing pro files" + echo + eerror "This shouldn't happen - send a bug report to bugs.gentoo.org" + echo + die "non existing pro file in ${PN} sources" + fi; + + # as a workaround for broken qmake, put everything into file + if use debug; then + echo -e "$CONFIG -= release\nCONFIG += no_fixpath debug" >> ${projprofile} + else + echo -e "$CONFIG -= debug\nCONFIG += no_fixpath release" >> ${projprofile} + fi; + + # any special qmake options should be passed as a second eqmake parameter + /usr/bin/qmake ${projprofile} \ + QMAKE=/usr/bin/qmake \ + QMAKE_CFLAGS_RELEASE="${CFLAGS}" \ + QMAKE_CFLAGS_DEBUG="${CFLAGS}" \ + QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS}" \ + QMAKE_CXXFLAGS_DEBUG="${CXXFLAGS}" \ + QMAKE_RPATH= \ + ${2} + + # successfull qmake? + if [[ $? -ne 0 ]]; then + echo + eerror "Running qmake on \"${projprofile}\" has failed" + echo + eerror "This shouldn't happen - send a bug report to bugs.gentoo.org" + echo + die "qmake has failed on ${projprofile}" + fi; + + eend 0 +} + +EXPORT_FUNCTIONS pkg_setup