Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#51801 closed enhancement (wontfix)

qt5: support older versions of OS X via different versions of Qt 5

Reported by: dliessi (Davide Liessi) Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: mojca (Mojca Miklavec), iEFdev, mkae (Marko Käning)
Port: qt5

Description

In the Portfile for qt5 I found this note

TODO: support older versions of OS X via different versions of Qt 5

I'm still on Snow Leopard and some projects I follow are moving to Qt 5, e.g. Frescobaldi (I maintain its Portfile).

Would it be feasible to implement this? How much effort would it take? I would be glad to help in testing.

Change History (16)

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

Cc: mcalhoun@… removed
Owner: changed from macports-tickets@… to mcalhoun@…

comment:2 Changed 4 years ago by kenneth.f.cunningham@…

I took a stab at starting out. I have Snow leopard with 10.6.8 and the LibCxxOnOlderSystems libc++ upgrade installed. Clang-3.8 is installed and working, and code seems to compile well with it.

To get started, I altered the qt5-1.0.tcl file (the qt5 portgroup) to change the min OS version to SL:

set qt5_min_tested_version     10

and then ran

sudo port -v configure qt5 configure.compiler=macports-clang-3.8

It got started, then stopped due to a deployment target error when somehow /Developer/usr/bin/clang++ was called in instead of the macports-clang-3.8 compiler. This errored out, no surprise. Somewhere qt5 (complicated as it is, to be sure) calls in it's own configuration for clang, and does not fully follow the macports set version. I think it might be in pkg-config (?) as I can't (so far) find it hard coded in to the copious and diffuse qt5 configuration and make files. Here's the last error I came to:

This is the Qt Open Source Edition.

You are licensed to use this software under the terms of
the Lesser GNU General Public License (LGPL) versions 2.1.
You are also licensed to use this software under the terms of
the GNU Lesser General Public License (LGPL) versions 3.

You have already accepted the terms of the Open Source license.

Running configuration tests (phase 1)...
/Developer/usr/bin/clang++ -c -fvisibility=hidden fvisibility.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
Symbol visibility control enabled.
ld: unknown option: --enable-new-dtags
clang: error: linker command failed with exit code 1 (use -v to see invocation)
/Developer/usr/bin/clang++ -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
ld: unknown option: -Bsymbolic-functions
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Symbolic function binding disabled.
DEFAULT_INCDIRS="/usr/include
/usr/local/include"
DEFAULT_LIBDIRS="/lib
/usr/lib"
Done running configuration tests.
Creating qmake...
/Developer/usr/bin/clang++ -c -o project.o -pipe -stdlib=libc++ -isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -ffunction-sections -O2 -fconstant-cfstrings -MMD -g  -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt5/qt5-qtbase/work/qtbase-opensource-src-5.6.1/qmake -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt5/qt5-qtbase/work/qtbase-opensource-src-5.6.1/qmake/library -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt5/qt5-qtbase/work/qtbase-opensource-src-5.6.1/qmake/generators -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt5/qt5-qtbase/work/qtbase-opensource-src-5.6.1/qmake/generators/unix -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt5/qt5-qtbase/work/qtbase-opensource-src-5.6.1/qmake/generators/win32 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt5/qt5-qtbase/work/qtbase-opensource-src-5.6.1/qmake/generators/mac -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt5/qt5-qtbase/work/qtbase-opensource-src-5.6.1/qmake/generators/integrity -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt5/qt5-qtbase/work/qtbase-opensource-src-5.6.1/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt5/qt5-qtbase/work/qtbase-opensource-src-5.6.1/include/QtCore -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt5/qt5-qtbase/work/qtbase-opensource-src-5.6.1/include/QtCore/5.6.1 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt5/qt5-qtbase/work/qtbase-opensource-src-5.6.1/include/QtCore/5.6.1/QtCore -I../src/corelib/global -DHAVE_QCONFIG_CPP -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt5/qt5-qtbase/work/qtbase-opensource-src-5.6.1/mkspecs/macx-clang -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt5/qt5-qtbase/work/qtbase-opensource-src-5.6.1/tools/shared -DQT_VERSION_STR=\"5.6.1\" -DQT_VERSION_MAJOR=5 -DQT_VERSION_MINOR=6 -DQT_VERSION_PATCH=1 -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_COMPRESS -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM -DQT_CRYPTOGRAPHICHASH_ONLY_SHA1 -DQT_JSON_READONLY -DQT_NO_STANDARDPATHS /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt5/qt5-qtbase/work/qtbase-opensource-src-5.6.1/qmake/project.cpp
clang: error: invalid deployment target for -stdlib=libc++ (requires Mac OS X 10.7 or later)
make: *** [project.o] Error 1

in file mkspecs/macx-clang/qmake.conf the deployment target is set as it should be

QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6

So I presume the deployment target of 10.7 is somewhere in the Apple default configs? Not sure of that. Next step would seem to be to find out how /Developer/usr/bin/clang++ is being called in, instead of macports-clang-3.8 ...

comment:3 Changed 4 years ago by kenneth.f.cunningham@…

Ah. In the qt5-qtbase configure script, there is a section called "macSDKify()". This calls

/usr/bin/xcrun -sdk SDK -find clang

and this is what returns /Developer/usr/bin/clang instead of the macports version. So this would be the area of attention to try to get that function to return /opt/local/bin/clang instead. Although, to be clear, it's certainly not yet clear that this version of qt5 will be able to ultimately compile on 10.6.8/libc++ even with clang-3.8. The last qt5 that officially worked on 10.6.8 was 5.4 I think.

comment:4 Changed 4 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

In d1509f4a/macports-ports:

qt5-1.0.tcl: begin building infrastructure to support
different versions of Qt 5

Qt can make major functionality changes between minor version changes.
see https://github.com/Homebrew/homebrew-versions/pull/1191

Qt 5.6 is a long term support release which means MacPorts may

want to keep it around for a while.

see https://blog.qt.io/blog/2015/12/18/introducing-long-term-support/

If possible, we want to support as many versions of macOS as we can.
This sometimes means installing an older version of Qt.
see #51801

Finally, Qt requires substantial patches to KDE Frameworks 5, which

necessitates a separate port.

see #48967

comment:5 Changed 4 years ago by mojca (Mojca Miklavec)

Cc: mojca added

comment:6 Changed 4 years ago by mojca (Mojca Miklavec)

See also #52913.

comment:7 Changed 4 years ago by iEFdev

Cc: iEFdev added

comment:8 Changed 4 years ago by iEFdev

Cc: iEFdev removed

comment:9 Changed 4 years ago by iEFdev

Cc: iEFdev added

comment:10 Changed 4 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

In ad37e39e/macports-ports:

qt55: add new port

Qt 5.5 was the last version to officially support 10.7
see #51801
see #52922

comment:11 Changed 4 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

In 777e827b/macports-ports:

qt5 PG: remove references to supported versions

A better mechanism must be found for providing this information.
see #51801

comment:12 Changed 4 years ago by mkae (Marko Käning)

Cc: mkae added

comment:13 Changed 4 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

In c82ebd59/macports-ports:

qt56: new port and associated subports

Qt 5.6 is the last version that can build on Mac OS X 10.7
See #51801

comment:14 Changed 4 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Resolution: wontfix
Status: newclosed

Although some version of Qt can build on 10.7-10.12 (see changesets in this ticket and #52922), I can see no realistic way of adding support for 10.6.
Going back many versions, Qt 5 uses CFRunLoopTimerCreateWithHandler, which was not introduced until Mac OS X 10.7.
Sorry I can not do more.

comment:15 Changed 4 years ago by dliessi (Davide Liessi)

Didn't 5.3.x compile on 10.6? See the Portfile before commit 2e445fc50b1507164f6a10c6633170e68bf1c07e.

comment:16 in reply to:  15 Changed 4 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to dliessi:

Didn't 5.3.x compile on 10.6? See the Portfile before commit 2e445fc50b1507164f6a10c6633170e68bf1c07e.

I did not try to get a version of Qt 5.3 working because, according to the INSTALL file, Frescobaldi 3.x.x requires ''Qt >= 5.4.''
If you have some indication to the contrary, please let me know.

Note: See TracTickets for help on using tickets.