1 |
On Thursday 30 June 2005 19:54, Caleb Tennis wrote: |
2 |
> (I'd like to hear your thoughts and comments on the matter below before I |
3 |
> start the process of changing ebuilds to comply.) |
4 |
> |
5 |
> With Qt4 entering portage, we are going to start running into a dependency |
6 |
> problem with ebuilds that do: |
7 |
> |
8 |
> DEPEND=">=x11-libs/qt-3.2" |
9 |
> |
10 |
> Because Qt4 satisfies this depend even though it's not compatible. Enter |
11 |
> my proposed qt.eclass (which also replaces kde-functions.eclass for people |
12 |
> who are using it strictly for Qt). |
13 |
> |
14 |
> Now you can: |
15 |
> |
16 |
> inherit qt |
17 |
> |
18 |
> DEPEND="$(qt_min_version 3.0)" |
19 |
> or |
20 |
> DEPEND="qt? ( $(qt_min_version 3.1.2-r2) )" |
21 |
> |
22 |
> And the eclass will expand out all Qt3 ebuilds which satisfy the statement. |
23 |
> |
24 |
> If you don't need anything this fancy (that is, if the ebuild will work |
25 |
> with any Qt3 version), then the eclass isn't necessary; just change the |
26 |
> ebuild to: |
27 |
> |
28 |
> DEPEND="x11-libs/qt-3*" |
29 |
> |
30 |
> As an added bonus, you get an exported pkg_setup function which will handle |
31 |
> some of the same checks that were handled via kde-functions. |
32 |
> |
33 |
> Thanks, |
34 |
> Caleb |
35 |
|
36 |
I'm back from a trip and I'm slowly catching up with all the mails on this |
37 |
topic, but a couple of things come to my mind ... please bear with me. |
38 |
|
39 |
First, a new eclass for Qt4 ebuilds should really be called qt4.eclass, with |
40 |
another one, qt3.eclass, to be used to port the current Qt3-based ebuilds. |
41 |
Dealing with more than one major version in a single eclass is a pain; this |
42 |
is mostly true for the kde eclasses, but still applies to Qt. |
43 |
In fact, we need to introduce a new clean eclass for KDE4-based applications, |
44 |
so starting from scratch with a kde4.eclass and a qt4.eclass makes a lot of |
45 |
sense. |
46 |
|
47 |
As many already pointed out, using something like |
48 |
DEPEND="$(qt_min_version 3.1)" |
49 |
is very ugly, so we should use it only if it is really unavoidable. |
50 |
|
51 |
There is also another consideration to do: many Qt applications, or |
52 |
applications with optional Qt support, are not maintained by the qt/kde herd. |
53 |
We had many problems in the past because it was not easy at all to write |
54 |
ebuilds for these applications, this time we should make this task as |
55 |
intuitive as possible. |
56 |
|
57 |
There was a lot of discussion internally already with particular focus on the |
58 |
kde eclasses, but the problems for Qt and KDE applications are nearly the |
59 |
same so designing a new qt eclass uncovers the same problems. |
60 |
|
61 |
Among the options discussed, I particularly like the following one (I think |
62 |
something like this also showed up in this thread, too): |
63 |
|
64 |
An application based on Qt4 should look just like this: |
65 |
|
66 |
inherit qt4 |
67 |
|
68 |
HOMEPAGE=... |
69 |
SRC_URI=... |
70 |
... |
71 |
|
72 |
the qt4 eclass would automatically add a DEPEND="=x11-libs/qt-4*", and would |
73 |
provide default src_compile(), src_install()... |
74 |
|
75 |
For the applciations (<5% ?) that require an higher version of Qt, the ebuild |
76 |
should look like: |
77 |
|
78 |
NEED_QT="4.1" |
79 |
inherit qt4 |
80 |
|
81 |
HOMEPAGE=... |
82 |
SRC_URI=... |
83 |
... |
84 |
|
85 |
the qt4 eclass would insert the right line in DEPEND. |
86 |
|
87 |
For applications with optional Qt support, the ebuild could manually set the |
88 |
dependency on x11-libs/qt; it is enough to ship a qt4-info.eclass that |
89 |
provides useful functions, with qt_min_versions() among them. |
90 |
|
91 |
So an ebuild with optional Qt support could be like |
92 |
|
93 |
inherit qt4-info |
94 |
|
95 |
HOMEPAGE=... |
96 |
SRC_URI=... |
97 |
|
98 |
DEPEND="qt? ( =x11-libs/qt-4* )" |
99 |
... |
100 |
|
101 |
(I think this would be the case for 99% of the ebuilds) or |
102 |
|
103 |
inherit qt4-info |
104 |
|
105 |
HOMEPAGE=... |
106 |
SRC_URI=... |
107 |
|
108 |
DEPEND="qt? ( $(qt_min_version 4.1.2) )" |
109 |
... |
110 |
|
111 |
if there's absolutely no other way to do it. |
112 |
|
113 |
This proposal is meant for Qt, but it should be read as a proposal for both Qt |
114 |
and KDE: we can have a kde4.eclass and a kde4-info.eclass that work in the |
115 |
same way. |
116 |
-- |
117 |
gentoo-dev@g.o mailing list |