Supporting both Qt4 and Qt5 builds

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Supporting both Qt4 and Qt5 builds

Georg Rudoy
Hi,

I'm thinking of converting a few ebuilds (x11-libs/qwt,
dev-libs/kqoauth, net-libs/qxmpp among them) to support building with
both Qt4 and Qt5.

Should this better be done by adding the corresponding useflags (qt4
and qt5 respectively) or by slotting? The pros and cons for each, off
the top of my head:

slotting:
+ Allows having different use flags for qt4 and qt5 builds (can't
think why that would be needed in the above examples though).
- Possibility of exponential growth of the number of slots in case
slotting would be required according to some other criteria (again,
can't think why that would be needed in the above examples).
- Requires keeping two different copies of the same ebuild with
basically the same build rules, with all the consequences.

useflags:
+ Seems to be easier and doing the required trick.
+ app-text/poppler already does this.
- Enabling support for previously disabled Qt version requires
rebuilding the whole library twice.

What's your opinion on this?

I've attached the useflag-based variant as a draft.

--
  Georg Rudoy

kqoauth-0.98-r2.ebuild (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Supporting both Qt4 and Qt5 builds

Johannes Huber
Am Sonntag, 10. August 2014, 14:51:45 schrieb Georg Rudoy:

> Hi,
>
> I'm thinking of converting a few ebuilds (x11-libs/qwt,
> dev-libs/kqoauth, net-libs/qxmpp among them) to support building with
> both Qt4 and Qt5.
>
> Should this better be done by adding the corresponding useflags (qt4
> and qt5 respectively) or by slotting? The pros and cons for each, off
> the top of my head:
>
> slotting:
> + Allows having different use flags for qt4 and qt5 builds (can't
> think why that would be needed in the above examples though).
> - Possibility of exponential growth of the number of slots in case
> slotting would be required according to some other criteria (again,
> can't think why that would be needed in the above examples).
> - Requires keeping two different copies of the same ebuild with
> basically the same build rules, with all the consequences.
>
> useflags:
> + Seems to be easier and doing the required trick.
> + app-text/poppler already does this.
> - Enabling support for previously disabled Qt version requires
> rebuilding the whole library twice.
>
> What's your opinion on this?
>
> I've attached the useflag-based variant as a draft.

Multibuild is prefered.

--
Johannes Huber (johu)
Gentoo Linux Developer / KDE Team
GPG Key ID F3CFD2BD


Reply | Threaded
Open this post in threaded view
|

Re: Supporting both Qt4 and Qt5 builds

Ben de Groot-2
In reply to this post by Georg Rudoy
On 10 August 2014 18:51, Georg Rudoy <[hidden email]> wrote:

> Hi,
>
> I'm thinking of converting a few ebuilds (x11-libs/qwt,
> dev-libs/kqoauth, net-libs/qxmpp among them) to support building with
> both Qt4 and Qt5.
>
> Should this better be done by adding the corresponding useflags (qt4
> and qt5 respectively) or by slotting?
>
> What's your opinion on this?
>

The Qt team has always recommended the useflag method for packages
that support more than one major version of Qt. This is also what we
implement ourselves. So for consistency's sake, please stick with the
useflags.

--
Cheers,

Ben | yngwin
Gentoo developer