Opened 3 weeks ago

Last modified 8 days ago

#62964 new enhancement

QT 5.9: Add Mavericks Compatibility

Reported by: Wowfunhappy (Jonathan) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.7.0
Keywords: haspatch mavericks Cc: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), Wowfunhappy (Jonathan), mascguy (Christopher Nielsen)
Port: qt59

Description

It turns out that QT 5.9 is surprisingly easy to build on Mavericks. I just commented out a few functions, and away it went. Replacing qmacstyle_mac.mm with the version from QT 5.8 (plus a couple changes) made apps look pretty too!

This patch will allow qt59-qtbase and most of its submodules to build and run on Mavericks. I used this a few weekends ago to bulid Mavericks-compatible versions of several emulators which require QT 5.9, most notably Citra and Dolphin.

There is one thing I'm a bit stuck on. When I compile QT without using MacPorts (ie, by following https://wiki.qt.io/Building_Qt_5_from_Git#Installing_.28Linux_.2F_OS_X.29), QTTools builds without issue! In MacPorts, however, it fails:

Undefined symbols for architecture x86_64:
  "vtable for ApplicationEventFilter", referenced from:
      _main in main.o

I'd rather not disable the QTTools subport, since I know it should be able to work.

Anyway, up to you whether the patch is desirable to have in MacPorts, I just wanted to share it. Please let me know if there's anything I can fix up, as I've never done this before!

Attachments (10)

portfile.patch (1.4 KB) - added by Wowfunhappy (Jonathan) 3 weeks ago.
patch-mavericks-compatibility.diff (17.1 KB) - added by Wowfunhappy (Jonathan) 3 weeks ago.
patch-mavericks-aesthetics.diff (577.3 KB) - added by Wowfunhappy (Jonathan) 3 weeks ago.
Portfile.patch (2.0 KB) - added by Wowfunhappy (Jonathan) 8 days ago.
patch-qttools-skip-assistant.diff (584 bytes) - added by Wowfunhappy (Jonathan) 8 days ago.
patch-qoperatingsystemversion-109.diff (3.1 KB) - added by Wowfunhappy (Jonathan) 8 days ago.
patch-qcocoa-build-on-109.diff (6.4 KB) - added by Wowfunhappy (Jonathan) 8 days ago.
patch-backport-gui-109.diff (928 bytes) - added by Wowfunhappy (Jonathan) 8 days ago.
patch-backport-corelib-109.diff (1.8 KB) - added by Wowfunhappy (Jonathan) 8 days ago.
patch-firstObject-109.diff (641 bytes) - added by Wowfunhappy (Jonathan) 8 days ago.

Download all attachments as: .zip

Change History (16)

Changed 3 weeks ago by Wowfunhappy (Jonathan)

Attachment: portfile.patch added

Changed 3 weeks ago by Wowfunhappy (Jonathan)

Changed 3 weeks ago by Wowfunhappy (Jonathan)

comment:1 Changed 3 weeks ago by Wowfunhappy (Jonathan)

Type: defectenhancement

comment:2 Changed 3 weeks ago by Wowfunhappy (Jonathan)

Cc: Wowfunhappy added

comment:3 Changed 8 days ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:4 Changed 8 days ago by mascguy (Christopher Nielsen)

Marcus, I've only taken a cursory look, but this seems like it could be a worthwhile addition.

Your thoughts?

Changed 8 days ago by Wowfunhappy (Jonathan)

Attachment: Portfile.patch added

Changed 8 days ago by Wowfunhappy (Jonathan)

Changed 8 days ago by Wowfunhappy (Jonathan)

Changed 8 days ago by Wowfunhappy (Jonathan)

Changed 8 days ago by Wowfunhappy (Jonathan)

Attachment: patch-backport-gui-109.diff added

Changed 8 days ago by Wowfunhappy (Jonathan)

Changed 8 days ago by Wowfunhappy (Jonathan)

Attachment: patch-firstObject-109.diff added

comment:5 Changed 8 days ago by Wowfunhappy (Jonathan)

If there is still interest in this, please use the new set of files I've just attached.

What I didn't realize two weeks ago was that RJVB independently added Mavericks compatibility to QT 5.9 several years back, in his MacStrop repository of custom port files. We made many of the same changes, but RJVB made some edits I did not, and unlike me I'm pretty sure he actually knew what he was doing. Furthermore, his qmacstyle is based on the QT 5.9 version rather than the 5.8 version, so the diff count is reasonable and you can see what actually changed.

(This also means it's basically RJVB's work, I just pulled out the patches needed for Mavericks, since Macstrop contains many other more extensive edits!)

QTTools is still failing with the same error. The failure looks to be in Linguist, so the easy way out would be to just disable that piece... but again, the whole of QTTools builds fine outside of MacPorts, so it should be able to work.

comment:6 Changed 8 days ago by kencu (Ken)

Well, to have a chance of getting this in, qttools would have to work.

This bug report <https://bugreports.qt.io/browse/QTBUG-58341?gerritIssueStatus=All> looks somewhat similar to your error.

This is a weird helper message:

NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.

and that error brought me here:

<https://stackoverflow.com/questions/31861803/a-missing-vtable-usually-means-the-first-non-inline-virtual-member-function-has>

But you say it builds outside MacPorts but not inside MacPorts? Then if that is the case, you're talking compiler selection, SDK being used, or something being picked up in ${prefix} usually.

Note: See TracTickets for help on using tickets.