Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 229193 - qt4.4 built gif support by default, , but qt4.eclass doesn't handle it.
Summary: qt4.4 built gif support by default, , but qt4.eclass doesn't handle it.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 217161
  Show dependency tree
 
Reported: 2008-06-24 11:15 UTC by Vladimir Smirnov (RETIRED)
Modified: 2008-07-17 00:12 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch for qt4.eclass (qt4.eclass.diff,639 bytes, patch)
2008-06-24 11:15 UTC, Vladimir Smirnov (RETIRED)
Details | Diff
New patch. (qt4.eclass.patch,3.40 KB, patch)
2008-06-26 15:47 UTC, Vladimir Smirnov (RETIRED)
Details | Diff
Oops. Forgot one thing. (qt4.eclass.patch,3.49 KB, patch)
2008-06-26 16:16 UTC, Vladimir Smirnov (RETIRED)
Details | Diff
One typo fix, a bit better output. (qt4.eclass.patch,3.91 KB, patch)
2008-06-26 16:23 UTC, Vladimir Smirnov (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Smirnov (RETIRED) gentoo-dev 2008-06-24 11:15:25 UTC
So it is a bit wrong to do workaround in ebuilds.
Comment 1 Vladimir Smirnov (RETIRED) gentoo-dev 2008-06-24 11:15:49 UTC
Created attachment 158197 [details, diff]
patch for qt4.eclass
Comment 2 Vladimir Smirnov (RETIRED) gentoo-dev 2008-06-26 15:47:25 UTC
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.
Comment 3 Vladimir Smirnov (RETIRED) gentoo-dev 2008-06-26 16:16:04 UTC
Created attachment 158521 [details, diff]
Oops. Forgot one thing.
Comment 4 Vladimir Smirnov (RETIRED) gentoo-dev 2008-06-26 16:17:38 UTC
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} &amp;&amp; ! 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} != "" ]] &amp;&amp; die "can't emerge ${CATEGORY}/${PN}: ${diemessage}"
></PRE></BODY></HTML>
Comment 5 Vladimir Smirnov (RETIRED) gentoo-dev 2008-06-26 16:23:29 UTC
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"...
Comment 6 Vladimir Smirnov (RETIRED) gentoo-dev 2008-07-14 11:06:26 UTC
I've seen that part of fixes made their way to portage (gif support), but what about broken QT4_OPTIONAL_BUILT_WITH_USE_CHECK ?
Comment 7 Bo Ørsted Andresen (RETIRED) gentoo-dev 2008-07-17 00:12:51 UTC
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.