RJVB / macstrop

RJVB's repository of alternative macports, with ports missing from or overriding those in the standard collection, including a set of KF5 ports.
20 stars 9 forks source link

Failed to build kf5-osx-integration-devel #10

Closed oprypin closed 7 years ago

oprypin commented 7 years ago
...
:info:build /opt/local/var/macports/build/_Users_oprypin_repos_macstrop_kf5_kf5-osx-integration/kf5-osx-integration-devel/work/kf5-osx-integration-5/src/qcocoa-qpa/qcocoawindow.mm:340:47: error: use of undeclared identifier 'QOperatingSystemVersion'; did you mean 'NSOperatingSystemVersion'?
:info:build     if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSSierra) {
:info:build                                               ^~~~~~~~~~~~~~~~~~~~~~~
:info:build                                               NSOperatingSystemVersion
:info:build /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSProcessInfo.h:25:3: note: 'NSOperatingSystemVersion' declared here
:info:build } NSOperatingSystemVersion;
:info:build   ^
:info:build /opt/local/var/macports/build/_Users_oprypin_repos_macstrop_kf5_kf5-osx-integration/kf5-osx-integration-devel/work/kf5-osx-integration-5/src/qcocoa-qpa/qcocoawindow.mm:340:34: error: no member named 'current' in 'NSOperatingSystemVersion'
:info:build     if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSSierra) {
:info:build         ~~~~~~~~~~~~~~~~~~~~~~~~~^
:info:build /opt/local/var/macports/build/_Users_oprypin_repos_macstrop_kf5_kf5-osx-integration/kf5-osx-integration-devel/work/kf5-osx-integration-5/src/qcocoa-qpa/qcocoawindow.mm:340:72: error: no member named 'MacOSSierra' in 'NSOperatingSystemVersion'
:info:build     if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSSierra) {
:info:build                                               ~~~~~~~~~~~~~~~~~~~~~~~~~^
...

I have qt5-kde @5.8.0_0+harfbuzz+mariadb55+qt5kde - which I installed just now (without specifying a particular version). What's worrisome is that QOperatingSystemVersion was introduced in Qt 5.9.

The actual problem I'm trying to solve is that icons don't show in Kate and all possible solutions seem to hinge on kf5-osx-integration-devel

oprypin commented 7 years ago

No idea why Qt 5.9 specific functionality is enforced when only Qt 5.8 is available to install. Workaround I had to apply:

diff --git a/kf5/kf5-osx-integration/Portfile b/kf5/kf5-osx-integration/Portfile
index f703eb7c..223e5b8d 100644
--- a/kf5/kf5-osx-integration/Portfile
+++ b/kf5/kf5-osx-integration/Portfile
@@ -58,11 +58,8 @@ if {${subport} eq "${name}-devel"} {
     fetch.type      git
     git.url         git://anongit.kde.org/osx-integration
     # master branch has Qt plugins from Qt 5.8.0
-    # git.branch      e9ed4fd77985781643eb4e1cf640954df5fb6f2c
-    # version         5.31.32
-    # qt590 branch has plugins from Qt 5.9.0 (RC, to be exact)
-    git.branch      0738cf544f4630dd2abddd46f6d43dd062567a40
-    version         5.31.83
+    git.branch      e9ed4fd77985781643eb4e1cf640954df5fb6f2c
+    version         5.31.32
     worksrcdir      ${name}-5
     distname        ${name}-5
 } else {
RJVB commented 7 years ago

Both Qt plugins in osx-integration's qt590 branch indeed come from Qt 5.9.0, but have been backported to build against Qt 5.8.0 . The QAltMacStyle plugin has a private copy of QOperatingSystemVersion, and QAltCocoa has a simplified private implementation. I didn't notice this issue because I'm not running 10.12 . Could you please try adding

#if QT_VERSION < QT_VERSION_CHECK(5, 9, 0)
#include <qaltoperatingsystemversion.h>
#endif

at an appropriate location and report back?

RJVB commented 7 years ago

On Wednesday June 28 2017 20:58:25 Oleh Prypin wrote:

No idea why Qt 5.9 specific functionality is enforced when only Qt 5.8 is available to install.

It's not. Where necessary private copies are included, but my goal is indeed to provide the Qt 5.9 plugins also to Qt 5.8 . That's not as difficult as it sounds, and works fine.

oprypin commented 7 years ago

Reverted my change, made sure that build fails, then added this in /opt/local/var/macports/build/_Users_oprypin_repos_macstrop_kf5_kf5-osx-integration/kf5-osx-integration-devel/work/kf5-osx-integration-5/src/qcocoa-qpa/qcocoawindow.mm:

 #if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_12)
+#if QT_VERSION < QT_VERSION_CHECK(5, 9, 0)
+#include "qaltoperatingsystemversion.h"
+#endif
     if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSSierra) {

Ran port install kf5-osx-integration-devel and it worked. Thank you. And thanks for the tremendous work on the project.

oprypin commented 7 years ago

Though honestly I have no idea how an #include works in the middle of a function. I even tried it again just to be sure.

RJVB commented 7 years ago

On Wednesday June 28 2017 15:11:45 Oleh Prypin wrote:

Though honestly I have no idea how an #include works in the middle of a function. I even tried it again just to be sure.

include just inserts another file in place of the #include line and as long as that gives valid syntax you're fine.

In this case you probably created a local definition for the QOperatingSystemVersion class.

Thanks for confirming that the fix works. I'll commit it tomorrow.

oprypin commented 7 years ago

Fixed in https://github.com/RJVB/macstrop/commit/6c468e3222a66310b334550355581ea62cf348e2 https://github.com/KDE/osx-integration/commit/a02d2b3c818ee80a61ba96747e43e593d7192749 Thanks