Page MenuHomeFreeBSD

Replace bsd.qt.mk by qt.mk and qt-dist.mk
AbandonedPublic

Authored by adridg on May 23 2018, 9:04 PM.

Details

Summary

bsd.qt.mk did two things:

  1. it provides USE_Qt4 and USE_QT5 copmonents to be used by ports depending on Qt
  2. it handles the business of building the Qt4 and Qt5 ports

Further there is qmake.mk which is weirdly interconnected with it.

This diff does the following:

  1. replace the dependency parts of bsd.qt.mk by Uses/qt.mk
  2. replace the Qt-building parts of bsd.qt.mk by Uses/qt-dist.mk

As opposed to the last try (see D8540) this time, keep qmake.mk around.

The changes to the ports tree are the following

  1. Ports depending on Qt4:
USE_QT4=    foo bar

becomes

USES=       qt:4
USE_QT=     foo bar
  1. Ports depending on Qt5:
USE_QT5=    foo bar

becomes

USES=       qt:5
USE_QT=     foo bar
  1. For USES=qmake ports

qmake.mk now accepts a Qt version, so ports only depending on qmake, and on no Qt-component can specify

USES=       qmake:4

or

USES=       qmake:5

respectively.

  1. For ports (misusing) QT_NONSTANDARD:

QT_NONSTANDARD has been deprecated, and is replaced by the new qmake args

  • no_env: Don't add CONFIGURE_ARGS and CONFIGURE_ENV
  • no_configure: Don't add the qmake configure target
  1. For the Qt-dist ports:

Instead of setting
For qt:4

QT_DIST=    yes

and for qt:5

QT_DIST=   foo

now

USES=qt-dist:yes

or

USES=qt-dist:4,yes

respectively

USES=qt-dist:foo

or

USES=qt-dist:5,foo

There is a fallback to uses yes (for qt:4) and ${PORTNAME} (for qt:5).

All in all, the ports tree, and how ports use Qt is only affected minimally -- far less than the previous attempt :)

Test Plan
  • Exp-Run

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 16917
Build 16794: arc lint + arc unit

Event Timeline

Mmmm, phabricator does not seem to want to show the files here ๐Ÿ˜‘
Could you maybe only add the Mk changes to the review, as all the ports changes seem to be pretty mechanical.

I may have missed it, but USE_QT4 and USE_QT5 should be added to the unsupported list in bsd.sanity.mk.

Mk/Uses/qmake.mk
118

I may have missed it, but I did not see where there was something making sure qmake was included before qt.

Mk/Uses/qmake.mk
118

Would a match ala

.if empty(USES:Mqt.*qmake) 
IGNORE=qmake must appear before qt in USES
.endif

work?

Mk/Uses/qmake.mk
50โ€“52

That should not be needed, qmake_ARGS should always be defined, unless this is because we can come here from USES=qt-dist.

118

No, it has to work whatever the order they are added. You'll have to include qt.mk after ading to USE_QT.

I see that qt.mk is already included early here, so adding to USE_QT doesn't, does it? Or maybe it is handled in POST so it does work.

Mk/Uses/qt-dist.mk
63

At this point, PORTSDIR should always be defined.

107โ€“111

You know

tar_ARGS=        xz
โ€‹.include "${USESDIR}/tar.mk"

could be written as:

EXTRACT_SUFX?=  .tar.xz

And it would probably be faster, one less file to open and parse.

Mk/bsd.sanity.mk
255โ€“256

You could probably write USE_QT=${USE_QT4} / USE_QT=${USE_QT5} to help a bit more.

Mk/Uses/qmake.mk
118

I think I added the POST stuff because of this, but I have to check whether it works in any order already.

Mk/Uses/qmake.mk
118

Please do test, it works whatever the order USES is set. (There is a sort police that likes to have it sorted, but the order is really undefined.)

Address some of the concerns.

Mk/Uses/qmake.mk
50โ€“52

Exactly, this is needed for ports like qmake with:

USES=   qt-dist:4
Mk/Uses/qt-dist.mk
63

I don't quite understand what you mean here, sorry :)

63

? :)

Mk/Uses/qmake.mk
118
 #  make -VUSES -VUSE_QT -Cdevel/qbs
compiler:c++11-lib python:run qt:5 qmake:outsource shebangfix
buildtools_build core concurrent gui network script testlib  widgets xml qmake_build

seems to work \o/

Add QT_NONSTANDARD to bsd.sanity.mk

Mk/Uses/qmake.mk
50โ€“52

I think qt-dist should do a qt_ARGS?= so that qt is not special like that in any way

Mk/Uses/qt-dist.mk
63

The only reason we use .CURDIR:H:H in ports to reference PORTSDIR is because bsd.port.mk has not yet been included, and PORTSDIR is not yet defined. Here, we are in a USES, and PORTSDIR is always defined, it should be used instead of the obscure .CURDIR:H:H.

Mk/bsd.sanity.mk
20

This should probably be in the SANITY_UNSUPORTED, not here. The ALL_* variables are for user facing variables, stuff you put in make.conf, for example. I don't think QT_NONSTANDARD is in that category.

  • QT_NONSTANDARD in sanity.m
  • qt_ARGS and qmake_ARGS in qt-dist.mk
  • PORTSDIR instead of CURDIR:H:H
Mk/bsd.sanity.mk
21

woops, stray empty line...

@mat should I ask for an exp-run now?

Yes, I think it is ok now, at least I do not have any more ideas on how to improve it :-)

adridg removed a reviewer: adridg.

Commandeering it so the review can be subsequently abandoned / closed -- since it was committed some time ago.

.. was committed r473503