So it is a bit wrong to do workaround in ebuilds.
Created attachment 158197 [details, diff] patch for qt4.eclass
Created attachment 158519 [details, diff] New patch. I've found out that qt4.eclass's QT4_OPTIONAL_BUILT_WITH_USE_CHECK doesn't know how to handle qt-4.4. I don't think it is needed to create new bug for that, becouse they are related. So I'm attaching new patch for it. It's one of possible ways (in my opinion) to teach QT4_OPTIONAL_BUILT_WITH_USE_CHECK to handle qt-4.4 properly.
Created attachment 158521 [details, diff] Oops. Forgot one thing.
Comment on attachment 158521 [details, diff] Oops. Forgot one thing. ><HTML><HEAD/><BODY><PRE>--- /usr/portage/eclass/qt4.eclass 2008-06-21 19:36:00.000000000 +0400 >+++ /usr/local/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 >+ 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}" ></PRE></BODY></HTML>
Created attachment 158523 [details, diff] One typo fix, a bit better output. Sorry for previos comment... I thought I can edit patch... Reuploaded patch. Previous one didn't have one "fi"...
I've seen that part of fixes made their way to portage (gif support), but what about broken QT4_OPTIONAL_BUILT_WITH_USE_CHECK ?
I looked at the code and concluded that the logic was completely wrong so I've added a very different patch which should fix this bug too: "zlin * gentoo-x86/eclass/qt4.eclass: Try to handle all flags in QT4{,_OPTIONAL}_BUILT_WITH_USE properly for split qt to avoid duplicating the same code in pkg_setup in lots of ebuilds. See bugs #217161 and #229193." http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/qt4.eclass?r1=1.43&r2=1.44 Please reopen if you find any bugs with this patch.