qt-base: fix build on macos, when +network (#38519)

* qt-base: always link to GSS framework on macOS

On macos, the code in src/network/kernel/qauthenticator.cpp
unconditionally includes the header from the GSS framework, so we should
link against it.

This applies two patches from the dev branch. They are to be cherry-picked
into the 6.5 (probably released with 6.5.2) and 6.6 branches, but they
apply against 6.3.2 as well.

* qt-base: disable libproxy on macOS

src/network/CMakeLists.txt disables it on MACOS anyway. And as it is not
found without pkg-config, building with +network would break because of
the feature being explicitly enabled.

* qt-base: don't depend on pkgconfig on macOS

On macOS, usage of pkg-config is disabled by unsetting
PKG_CONFIG_EXECUTABLE, unless the feature pkg-config is requested explicitly.

* qt-base: don't depend on at-spi2-core on macOS

Does not build on macOS and seems to be targeted at linux. Qt6 on
homebrew does not depend on it, either.

* qt-base: fix long lines

* qt-base: restrict use of pkgconfig to linux

yes, probably not needed on windows, either

Co-authored-by: Alec Scott <alec@bcs.sh>

* qt-base: disable libproxy on Windows as well

according to src/network/CMakeLists.txt it's only used on Unix

* qt-base: improvements based on reviewer suggestions

---------

Co-authored-by: Alec Scott <alec@bcs.sh>
This commit is contained in:
Martin Aumüller 2023-07-17 17:53:47 +02:00 committed by GitHub
parent dc216adde2
commit 193e6e7678
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,7 +36,7 @@ def get_list_url(qualname):
# Default dependencies for all qt-* components
generator("ninja")
depends_on("cmake@3.16:", type="build")
depends_on("pkgconfig", type="build")
depends_on("pkgconfig", type="build", when="platform=linux")
depends_on("python", type="build")
# List of unnecessary directories in src/3rdparty
@ -130,8 +130,7 @@ class QtBase(QtPackage):
depends_on("zstd")
with when("platform=linux"):
depends_on("libdrm")
depends_on("at-spi2-core", when="+accessibility")
depends_on("at-spi2-core", when="+accessibility")
depends_on("dbus", when="+dbus")
depends_on("gl", when="+opengl")
depends_on("sqlite", when="+sql")
@ -148,12 +147,24 @@ class QtBase(QtPackage):
depends_on("libxrender")
with when("+network"):
depends_on("libproxy")
depends_on("openssl")
with when("platform=linux"):
depends_on("libproxy")
# Qt6 requires newer compilers: see https://github.com/spack/spack/issues/34418
conflicts("%gcc@:7")
# ensure that Qt links against GSS framework on macOS: https://bugreports.qt.io/browse/QTBUG-114537
with when("@6.3.2:6.5.1"):
patch(
"https://github.com/qt/qtbase/commit/c3d3e7312499189dde2ff9c0cb14bd608d6fd1cd.patch?full_index=1",
sha256="85c16db15406b0094831bb57016dab7e0c0fd0978b082a1dc103c87334db7915",
)
patch(
"https://github.com/qt/qtbase/commit/1bf144ba78ff10d712b4de55d2797b9256948a1d.patch?full_index=1",
sha256="e4d9f1aee0566558e77eef5609b63c1fde3f3986bea1b9d5d7930b297f916a5e",
)
@property
def archive_files(self):
"""Save both the CMakeCache and the config summary."""
@ -211,7 +222,9 @@ def define_feature(key, variant=None):
if "+dbus" in spec:
features.append("dbus_linked")
if "+network" in spec:
features += ["openssl_linked", "openssl", "libproxy"]
features.extend(["openssl_linked", "openssl"])
if sys.platform == "linux":
features.append("libproxy")
for k in features:
define("FEATURE_" + k, True)