[MacPorts] #51619: qt5.depends_component procedure

MacPorts noreply at macports.org
Thu Dec 29 20:32:29 CET 2016


#51619: qt5.depends_component procedure
---------------------------+----------------------
  Reporter:  RJVB          |      Owner:  mkae
      Type:  enhancement   |     Status:  assigned
  Priority:  Normal        |  Milestone:
 Component:  ports         |    Version:
Resolution:                |   Keywords:
      Port:  qt5, qt5-kde  |
---------------------------+----------------------

Comment (by RJVB):

 A thought resulting from my reply to  Craig:

 suppose we have a shared Qt5 PG that determines which actual Qt5 port and
 PortGroup are to be used and which also defines a `qt5kde` variant.
 Suppose also that ports can do

 {{{
 default_variants +qt5kde
 PortGroup qt5 1.0
 }}}

 instead of

 {{{
 set qt5.prefer_kde 1
 PortGroup qt5 1.0
 }}}

 and be assured that `[variant_isset qt5kde]` is true in qt5-1.0.tcl .

 I *think* that in that case, setting `+qt5kde` in
 ${prefix}/etc/macports/variants.conf will be analogous to deciding to use
 `port:qt5-kde` simply by installing it. In that case `port deps` will
 change it's output in reaction to a variant and not simply to what's
 installed (something I don't see the problem with but which may be
 unacceptable for that very reason 8-) ).
 I'll have to sleep a few nights over this and see how well I get used to
 the idea, but it's a solution I might be able to live with.

 There's one big problem with this approach: how do we handle the situation
 where `port:qt5` is installed, and a KF5 port or the user sets +qt5kde?
 The logical thing to do in that case would be
 - if +qt5kde is the result of `default_variants`, unset the variant so
 that future tests `[variant_isset qt5kde]` will fail (but we can't)
 - if +qt5kde is the result of +qt5kde on the commandline or in
 variants.conf, raise an error

 Evidently the opposite situation is just as much a problem (though I'd
 hope there will never be a hard reason for ports to require the stock
 `port:qt5`).

 I see that variants set through variants.conf show up as `(+)foo` while
 those set with `default_variants` as `[+]foo`. So at some level the
 difference can be made, but I don't know if that's possible in the
 Portfile.

 PS:
 > `tbool` ​tests for existence

 With interpreted languages it can make a considerable difference to avoid
 calls to user-defined procedures for frequent operations; dependency
 calculations can take long enough as it is already. Better ensure that the
 variable to be tested always exists in that case.

--
Ticket URL: <https://trac.macports.org/ticket/51619#comment:23>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list