--- /usr/portage/eclass/qt4.eclass 2008-06-21 19:36:00.000000000 +0400 +++ /usr/portage/eclass/qt4.eclass 2008-06-26 20:09:14.000000000 +0400 @@ -95,8 +95,8 @@ # The use flags are different in 4.4 and above, and it's a split package, so this is used to catch # the various use flag combos specified in the ebuilds to make sure we don't error out. - if [[ ${x} == zlib || ${x} == png ]]; then - # Qt 4.4+ is built with zlib and png by default, so the use flags aren't needed + if [[ ${x} == zlib || ${x} == png || ${x} == gif ]]; then + # Qt 4.4+ is built with zlib, gif and png by default, so the use flags aren't needed continue; elif [[ ${x} == opengl || ${x} == dbus || ${x} == qt3support ]]; then # Make sure the qt-${x} package has been already installed @@ -122,12 +122,43 @@ done local optionalflags="" + local optionalerrormessage="" for x in ${QT4_OPTIONAL_BUILT_WITH_USE_CHECK}; do - if use ${x} && ! built_with_use =x11-libs/qt-4* ${x}; then - optionalflags="${optionalflags} ${x}" - fi + if use ${x}; then + if [[ "${QT4_MINOR_VERSION}" -ge 4 ]]; then + # The use flags are different in 4.4 and above, and it's a split package, so this is used to catch + # the various use flag combos specified in the ebuilds to make sure we don't error out. + + if [[ ${x} == zlib || ${x} == png || ${x} == gif ]]; then + # Qt 4.4+ is built with zlib, gif and png by default, so the use flags aren't needed + continue; + elif [[ ${x} == opengl || ${x} == dbus || ${x} == qt3support ]]; then + # Make sure the qt-${x} package has been already installed + + if ! has_version x11-libs/qt-${x}; then + optionalerrormessage="${optionalerrormessage} install the x11-libs/qt-${x} package." + continue; + fi + elif [[ ${x} == ssl ]]; then + if ! has_version x11-libs/qt-core || ! built_with_use x11-libs/qt-core ssl; then + optionalerrormessage="${optionalerrormessage} install the x11-libs/qt-core package with the ssl flag enabled." + continue; + fi + elif [[ ${x} == sqlite3 ]]; then + if ! has_version x11-libs/qt-sql || ! built_with_use x11-libs/qt-sql sqlite; then + optionalerrormessage="${optionalerrormessage} install the x11-libs/qt-sql package with the sqlite flag enabled." + continue; + fi + fi + elif ! built_with_use =x11-libs/qt-4* ${x}; then + optionalflags="${optionalflags} ${x}" + fi done + if [ "${optionalflags}" != "" ]; then + optionalerrormessage="${optionalerrormessage} recompile qt4 with \"${optionalflags}\" USE flag(s)" + fi + local diemessage="" if [[ ${requiredflags} != "" ]]; then eerror @@ -136,7 +167,7 @@ eerror diemessage="(1) recompile qt4 with \"${requiredflags}\" USE flag(s) ; " fi - if [[ ${optionalflags} != "" ]]; then + if [[ ${optionalerrormessage} != "" ]]; then eerror eerror "(2) You are trying to compile ${CATEGORY}/${PN} package with" eerror "USE=\"${optionalflags}\"" @@ -145,9 +176,9 @@ eerror eerror "Possible solutions to this problem are:" eerror "a) install package ${CATEGORY}/${PN} without \"${optionalflags}\" USE flag(s)" - eerror "b) re-emerge qt4 with \"${optionalflags}\" USE flag(s)" + eerror "b) ${optionalerrormessage}" eerror - diemessage="${diemessage}(2) recompile qt4 with \"${optionalflags}\" USE flag(s) or disable them for ${PN} package\n" + diemessage="${diemessage}(2) ${optionalerrormessage} or disable them for ${PN} package\n" fi [[ ${diemessage} != "" ]] && die "can't emerge ${CATEGORY}/${PN}: ${diemessage}"