Replace bsd.qt.mk by qt.mk and qt-dist.mk
Needs ReviewPublic

Authored by tcberner on Wed, May 23, 9:04 PM.

Details

Reviewers
mat
adamw
rakuco
adridg
Group Reviewers
portmgr
kde
O5: Ports Framework(Owns No Changed Paths)
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 16975
Build 16844: arc lint + arc unit
tcberner created this revision.Wed, May 23, 9:04 PM
mat added a comment.Thu, May 24, 7:46 AM

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.

tcberner updated this revision to Diff 42918.Thu, May 24, 7:58 AM

Just the good bits.

mat added a comment.Wed, May 30, 5:48 PM

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
115

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

tcberner updated this revision to Diff 43154.Wed, May 30, 5:56 PM

Append to bsd.sanity.mk

Mk/Uses/qmake.mk
115

Would a match ala

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

work?

mat added inline comments.Wed, May 30, 8:18 PM
Mk/Uses/qmake.mk
52โ€“63

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

115

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
65

At this point, PORTSDIR should always be defined.

109โ€“115

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
256โ€“257

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

tcberner added inline comments.Fri, Jun 1, 5:41 AM
Mk/Uses/qmake.mk
115

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

mat added inline comments.Fri, Jun 1, 10:14 AM
Mk/Uses/qmake.mk
115

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.)

tcberner updated this revision to Diff 43264.Sat, Jun 2, 7:19 AM

Address some of the concerns.

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

Exactly, this is needed for ports like qmake with:

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

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

65

? :)

tcberner added inline comments.Sat, Jun 2, 7:37 AM
Mk/Uses/qmake.mk
115
 #  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/

tcberner updated this revision to Diff 43265.Sat, Jun 2, 7:52 AM

Add QT_NONSTANDARD to bsd.sanity.mk

mat added inline comments.Sat, Jun 2, 9:10 AM
Mk/Uses/qmake.mk
52โ€“63

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
65

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
21

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.

tcberner updated this revision to Diff 43267.EditedSat, Jun 2, 10:35 AM
  • QT_NONSTANDARD in sanity.m
  • qt_ARGS and qmake_ARGS in qt-dist.mk
  • PORTSDIR instead of CURDIR:H:H
tcberner added inline comments.Sat, Jun 2, 10:37 AM
Mk/bsd.sanity.mk
21

woops, stray empty line...