QtPackage: modify QT_ADDITIONAL_PACKAGES_PREFIX_PATH handling (#49297)

* QtPackage: mv QT_ADDITIONAL_PACKAGES_PREFIX_PATH handling

* geomodel: support Qt6

* qt-base: rm import re
This commit is contained in:
Wouter Deconinck 2025-03-05 08:09:32 -06:00 committed by GitHub
parent f015b18230
commit 8677063142
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 13 deletions

View File

@ -80,7 +80,12 @@ class Geomodel(CMakePackage):
depends_on("pythia8", when="+pythia")
with when("+visualization"):
depends_on("hdf5+cxx")
depends_on("qt +gui +opengl +sql")
depends_on("qmake")
with when("^[virtuals=qmake] qt"):
depends_on("qt +gui +opengl +sql")
with when("^[virtuals=qmake] qt-base"):
depends_on("qt-base +gui +opengl +sql +widgets")
depends_on("qt-5compat")
depends_on("coin3d")
depends_on("soqt")
depends_on("opengl")
@ -94,5 +99,8 @@ def cmake_args(self):
self.define_from_variant("GEOMODEL_BUILD_EXAMPLES", "examples"),
self.define_from_variant("GEOMODEL_BUILD_TOOLS", "tools"),
self.define_from_variant("CMAKE_CXX_STANDARD", "cxxstd"),
self.define(
"GEOMODEL_USE_QT6", self.spec.satisfies("+visualization ^[virtuals=qmake] qt-base")
),
]
return args

View File

@ -3,7 +3,6 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import re
import shutil
import sys
import tempfile
@ -59,17 +58,6 @@ def cmake_args(self):
# Start with upstream cmake_args
args = super().cmake_args()
# Qt components typically install cmake config files in a single prefix,
# so we have to point them to the cmake config files of dependencies
qt_prefix_path = []
re_qt = re.compile("qt-.*")
for dep in self.spec.dependencies():
if re_qt.match(dep.name):
qt_prefix_path.append(self.spec[dep.name].prefix)
# Now append all qt-* dependency prefixes into a prefix path
args.append(self.define("QT_ADDITIONAL_PACKAGES_PREFIX_PATH", ":".join(qt_prefix_path)))
# Make our CMAKE_INSTALL_RPATH redundant:
# for prefix of current package ($ORIGIN/../lib type of rpaths),
args.append(self.define("QT_DISABLE_RPATH", True))
@ -130,6 +118,11 @@ def setup_run_environment(self, env):
if os.path.exists(self.prefix.plugins):
env.prepend_path("QT_PLUGIN_PATH", self.prefix.plugins)
def setup_dependent_build_environment(self, env, dependent_spec):
# Qt components typically install cmake config files in a single prefix,
# so we have to point dependencies to the cmake config files.
env.prepend_path("QT_ADDITIONAL_PACKAGES_PREFIX_PATH", self.spec.prefix)
class QtBase(QtPackage):
"""Qt Base (Core, Gui, Widgets, Network, ...)"""