Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#38280 closed enhancement (fixed)

RFE: add a qmake portgroup

Reported by: cooljeanius (Eric Gallager) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.1.3
Keywords: Cc: michaelld (Michael Dickens), mf2k (Frank Schima), NicosPavlov
Port:

Description (last modified by ryandesign (Ryan Schmidt))

qmake currently has multiple issues that ports have to work around (as brought up in tickets #38272 and #38250):

And I'm sure there's other things that could be done with a qmake portgroup, too.

Attachments (3)

qmake-0.1.tcl (2.2 KB) - added by cooljeanius (Eric Gallager) 6 years ago.
initial attempt at creating a qmake portgroup
qmake-1.0.tcl (2.3 KB) - added by cooljeanius (Eric Gallager) 6 years ago.
my latest attempt at the qmake portgroup
qmake-1.0-v2.tcl (2.6 KB) - added by NicosPavlov 6 years ago.

Download all attachments as: .zip

Change History (26)

comment:1 Changed 6 years ago by cooljeanius (Eric Gallager)

oops this wasn't supposed to be a "defect"

Last edited 6 years ago by cooljeanius (Eric Gallager) (previous) (diff)

comment:2 Changed 6 years ago by ryandesign (Ryan Schmidt)

Type: defectenhancement

comment:3 Changed 6 years ago by ryandesign (Ryan Schmidt)

Description: modified (diff)

comment:4 Changed 6 years ago by mf2k (Frank Schima)

Cc: macsforever2000@… added

Cc Me!

Changed 6 years ago by cooljeanius (Eric Gallager)

Attachment: qmake-0.1.tcl added

initial attempt at creating a qmake portgroup

comment:5 Changed 6 years ago by cooljeanius (Eric Gallager)

Attached my first try at this, not exactly sure how to go about testing it...

comment:6 Changed 6 years ago by michaelld (Michael Dickens)

Good start. I think we'll also want to try to overwrite the options for +universal and +debug, as well as add flags for OBJC and OBJCXX.

To test the file, make sure it is in "dports/_resources/port1.0/group/", then you'll need to modify some Portfile which requires QMake to make use of it, via adding "PortGroup qmake 1.0" somewhere before you need the settings / variables.

comment:7 in reply to:  6 Changed 6 years ago by cooljeanius (Eric Gallager)

Replying to michaelld@…:

Good start. I think we'll also want to try to overwrite the options for +universal and +debug

What do you mean by "overwrite" here? Just put in blank variants, or are there any specific settings we should be using for these variants?

comment:8 Changed 6 years ago by michaelld (Michael Dickens)

"overwrite" means in this case to set the QMake-specific variable on the ${configure.cmd} line, and hope that they overwrite those from the project's build script. When we set "QMAKE_CC=${configure.cc}", it generally works because projects are not supposed to play with it. But, setting for +debug and +universal is more generic, and hence takes a bit of work: (1) setting the ${configure.cmd} line correctly; and (2) making sure those variables are not set in the project's qmake build scripts.

For example, +debug for MacPorts generally means to install but release and debug versions, and hence IIRC does something like:

if +debug {
  CONFIG += debug_and_release build_all
} else {
  CONFIG += release
}

+universal I think can use:

if +universal then {
  CONFIG += ${qt_arch_types}
}

All of the above need to be on the configure.cmd arguments line, so in quotes appropriately. Then, inside the project we would need to remove references to these variables so that the overwrite is guaranteed to work.

comment:9 Changed 6 years ago by cooljeanius (Eric Gallager)

idk, I'm still kind unclear about all this, so I'll just attach my latest version of the portgroup, and then let you guys make changes as you see fit. (I tested it with qdjango and it works properly with that port at least, btw)

Changed 6 years ago by cooljeanius (Eric Gallager)

Attachment: qmake-1.0.tcl added

my latest attempt at the qmake portgroup

comment:10 Changed 6 years ago by NicosPavlov

Cc: nicos@… added

Cc Me!

comment:11 Changed 6 years ago by NicosPavlov

It seems a hassle to have to modify the project in order to change the references to some variables individually. I made some tests with qmake, and it seems that adding

variant debug description "Enable debug binaries" {
    configure.pre_args-append   "CONFIG+=debug"	
}

does the trick to enable debug, as "debug" has precedence over "release" when both are invoked. Additionally, it seemed that "debug_and_release" can lead to some issues when building.

Similarly, adding

if {[variant_isset universal]} {
    pre-configure {
        configure.pre_args-append   "CONFIG+=\"${qt_arch_types}\""
    }
}

seem to work for universal build.

comment:12 Changed 6 years ago by NicosPavlov

Should the portgroup be committed ? As there have been no additional comments or suggestions for several weeks, would it be safe to assume that it seems satisfactory ?

comment:13 Changed 6 years ago by michaelld (Michael Dickens)

I will have time this coming week to deal with this ticket; just been too busy the last few weeks.

comment:14 Changed 6 years ago by michaelld (Michael Dickens)

Sorry for the delay; it's just been crazy since my last posting here, with required time away to handle multiple personal matters. I should be able to get to this issue this week.

comment:15 Changed 6 years ago by jmroot (Joshua Root)

Component: baseports

comment:16 Changed 6 years ago by michaelld (Michael Dickens)

OK; obviously I haven't had time for this, so I'd say for someone else to go ahead and check this in and start using it. I don't know when I will find time for this in the coming weeks.

comment:17 in reply to:  16 Changed 6 years ago by cooljeanius (Eric Gallager)

Replying to michaelld@…:

OK; obviously I haven't had time for this, so I'd say for someone else to go ahead and check this in and start using it.

I would if I could... (my application for commit access is still pending review...)

comment:18 Changed 6 years ago by NicosPavlov

I should be able to finalize the tests and commmit it in the next days.

Unless there are objections, I will make final checks based on the last modifications I proposed, giving the attached file.

Changed 6 years ago by NicosPavlov

Attachment: qmake-1.0-v2.tcl added

comment:19 in reply to:  18 Changed 6 years ago by cooljeanius (Eric Gallager)

Replying to nicos@…:

I should be able to finalize the tests and commmit it in the next days.

Unless there are objections, I will make final checks based on the last modifications I proposed, giving the attached file.

Looks good to me, feel free to go ahead and commit it.

comment:20 Changed 6 years ago by NicosPavlov

Resolution: fixed
Status: newclosed

Committed in r106912.

I made a small change after testing it, in order to ensure that instructions in the Portfile (such as compiler.blacklist) would be taken into account when setting variables in the portgroup.

comment:21 Changed 6 years ago by cooljeanius (Eric Gallager)

Yay! Now to actually use it in all the ports it's appropriate for...

comment:22 Changed 6 years ago by mf2k (Frank Schima)

@nicos: Thank you!

@egall: Feel free to open up a single ticket with all such ports. It would be good to know.

comment:23 in reply to:  22 Changed 6 years ago by cooljeanius (Eric Gallager)

Replying to macsforever2000@…:

@egall: Feel free to open up a single ticket with all such ports. It would be good to know.

OK, #39424

Note: See TracTickets for help on using tickets.