Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 97404 - How to handle qt3 and qt4 dependencies [meta]
Summary: How to handle qt3 and qt4 dependencies [meta]
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] KDE (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords:
Depends on: 100235
Blocks:
  Show dependency tree
 
Reported: 2005-06-29 09:59 UTC by Caleb Tennis (RETIRED)
Modified: 2005-12-17 08:22 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Caleb Tennis (RETIRED) gentoo-dev 2005-06-29 09:59:57 UTC
This is where we can pose thoughts and related issues to having both qt3 and  
qt4 installed at the same time.  
  
Right now, it should *just work*.  What we need to do is update portage deps  
to handle this scenario.  Things to fix:  
  
1) ebuilds with deps like ">=x11-libs/qt-3.3.2"  
2) ebuilds that use the need-qt function  
3) ebuilds that call qmake somewhere in the src_compile() function  
  
#3 should be easy.  Change all occurrences of qmake to $QTDIR/qmake, since 
QTDIR is not used in Qt4. 
 
2) Can we deprecate this, and just rely on a straight dependency in the 
ebuild? 
 
1) Change ebuilds to have deps like: "=x11-libs/qt-3.3*" ? 
 
There are problem some fringe cases, but it will probably help to get started 
sooner than later.  Thoughts? 

Reproducible: Always
Steps to Reproduce:
Comment 1 Caleb Tennis (RETIRED) gentoo-dev 2005-06-29 11:26:13 UTC
I assume that portage can handle this: 
 
DEPEND="=x11-libs/qt-3* >=x11-libs/qt-3.3.1".  Maybe just updating the ebuilds 
in portage to use this type of syntax would work? 
Comment 2 Carsten Lohrke (RETIRED) gentoo-dev 2005-06-29 12:49:26 UTC
>I assume that portage can handle this:
>DEPEND="=x11-libs/qt-3* >=x11-libs/qt-3.3.1". 

Iirc it doesn't. This would need general support for ranges.


>1) ebuilds with deps like ">=x11-libs/qt-3.3.2"  

Can be changed to <qt-4. The portage tree is not a snapshot. Users have to adapt. ;)


>2) ebuilds that use the need-qt function  
>3) ebuilds that call qmake somewhere in the src_compile() function

There are a number of things needed to improve regarding kde* eclasses

1. Switching from need-foo() to NEED_FOO="bar" to comply with  GLEP 33
2. Dealing of qmake/.pro issues inside an eclass, instead reinventing the whell
with every qt related ebuild.
3. Proper support of application which can be build against Qt or KDE inside eclass.
4. support scons build scripts via eclass
5. _Not_ building against the latest available kde version, but against
kde-config --prefix or user defined one (e.g. reusing KDEDIR for this purpose),
similiar approach needed for Qt as well
6. may have missed something


>2) Can we deprecate this, and just rely on a straight dependency in the 
ebuild? 

There are two ways to deprecate it: Turn it into a variable (to be set before
inherit) or explicitly setting the needed dependency/ies in every ebuild.
Comment 3 Caleb Tennis (RETIRED) gentoo-dev 2005-06-29 13:03:02 UTC
Ooh, my brain was going crazy when I suddenly thought of a way that we might be 
able to make all of this a LOT easier! 
 
Why not name the package "qt4" ? 
 
Okay, it's a hack, but it might make things a lot easier... 
Comment 4 Caleb Tennis (RETIRED) gentoo-dev 2005-06-29 13:22:56 UTC
Barring that, what about this: 
 
Any ebuild that currently has something like this: 
 
>=x11-libs/qt-3 
 
Change to  
 
=x11-libs/qt-3 
 
Easy. 
 
 
For more interesting cases, create a qt3.eclass which creates: 
 
QT3VERSIONS="|| ( qt-3.0.1-r1 qt-3.0.1-r2 qt-3.0.1-r3 ... qt-3.3.4-r5 )" 
 
and then in an ebuild: 
 
DEPEND="$QT3VERSIONS" 
 
And we can create some eclass function to dynamically create QT3VERSIONS based 
on what you tell it: 
 
DEPEND="$(qt3_version_min 3.1)"  
 
or something like that... 
Comment 5 Caleb Tennis (RETIRED) gentoo-dev 2005-06-30 06:26:15 UTC
I've committed qt.eclass which is an initial handler for ebuilds which need Qt. 
 
The stuff in the ebuild itself is a bit of a hack (could be much prettier), but 
in a nutshell, an ebuild should be able to: 
 
inherit qt 
 
DEPEND="$(qt3_min_version 3.0)" 
 
and it should just work (it does so by expanding out all of the known version 
of Qt which would work: 
 
IE: 
 
DEPEND="||(x11-libs/qt-3.3.4-r5 x11-libs/qt-3.3.4-r4 ... x11-libs/qt-3.3.0)" 
 
As a special case, if a user specifies 3, 3.0, or 3.0.0, then it expands to: 
 
DEPEND="|| ( x11-libs/qt-3* )" 
 
Thoughts? 
Comment 6 Caleb Tennis (RETIRED) gentoo-dev 2005-06-30 06:35:48 UTC
I also put in a qt_pkg_setup function which handles the setting of QTDIR, so I 
believe that other than a possible 'addwrite' the qt eclass can replace the use 
of need-qt and set-qtdir in kde-functions.eclass. 
Comment 7 Caleb Tennis (RETIRED) gentoo-dev 2005-07-06 22:16:03 UTC
I've gone through portage and updated all of the *easy* ebuilds (those who had 
>=x11-libs/qt-3.0.0 -> =x11-libs/qt-3* ). 
 
 
Comment 8 Caleb Tennis (RETIRED) gentoo-dev 2005-07-07 08:11:04 UTC
So KDE team, did we ever come to a consensus on how to handle this?  Nobody 
seemed to really liked my $(qt_min_version) idea via the eclass. 
 
I've fixed most of the easy cases in portage now, but how to handle, for 
example: 
 
>=x11-libs/qt-3.3.3 
 
I have renamed qt.eclass to qt3.eclass and I believe we can tell people to 
prefer using it over kde-functions/need-qt.  Basically, set the depend for Qt 
explicitly within the ebuild, and the pkg_setup should handle setting QTDIR up 
for the user. 
 
I'd like to go ahead and start getting the ebuilds in portage fixed with this 
new scheme, but I want to make sure I don't have any problems with it before 
the transition starts... 
Comment 9 Gregorio Guidi (RETIRED) gentoo-dev 2005-07-08 02:09:07 UTC
To summarize:  
  
If an ebuilds uses kde-functions and need-qt(), it is changed to inherit qt3  
instead and in *DEPEND it gets =x11-libs/qt-3*, if appropriate, or 
$(qt_min_version 3.x.y) if needed. 
 
If an ebuild uses kde-functions and set-qtdir(), it is changed to inherit qt3 
and the qt versions in *DEPEND are changed in the same way. 
 
If an ebuild does not use kde-functions, the qt versions in *DEPEND are 
changed to =x11-libs/qt-3*, if appropriate, or it is changed to inherit qt3 
and do $(qt_min_version 3.x.y), if needed. 
 
Right? 
That's ok for me, in case. 
Comment 10 Caleb Tennis (RETIRED) gentoo-dev 2005-07-10 18:32:23 UTC
Sounds good.  I think I'll open a new bug in the next few days to this regard and see if we can't get people 
to start using the qt3.eclass
Comment 11 Gregorio Guidi (RETIRED) gentoo-dev 2005-07-12 00:47:42 UTC
I found a little problem: addwrite/addpredict do not work in pkg_setup, they 
must be in global scope or in a specific src_*. 
 
Maybe we can remove the has_version and move everything in pkg_setup() in 
global scope? 
 
Comment 12 Gregorio Guidi (RETIRED) gentoo-dev 2005-07-13 07:11:03 UTC
I committed the change to qt3.eclass as explained in previous comment. 
Comment 13 Caleb Tennis (RETIRED) gentoo-dev 2005-12-17 08:22:35 UTC
Closing as fixed.