Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[qt6] Add support for MACOSX_BUNDLE #24642

Merged
merged 4 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions recipes/qt/5.x.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@
else:
self.requires("libjpeg/9e")
if self.options.get_safe("with_libpng", False) and not self.options.multiconfiguration:
self.requires("libpng/1.6.42")
self.requires("libpng/[>=1.6 <2]")
if self.options.with_sqlite3 and not self.options.multiconfiguration:
self.requires("sqlite3/3.45.0")
if self.options.get_safe("with_mysql", False):
Expand All @@ -404,7 +404,7 @@
if self.options.with_zstd:
self.requires("zstd/1.5.5")
if self.options.qtwebengine and self.settings.os in ["Linux", "FreeBSD"]:
self.requires("expat/2.6.0")
self.requires("expat/[>=2.6.2 <3]")
self.requires("opus/1.4")
if not self.options.qtwayland:
self.requires("xorg-proto/2022.2")
Expand Down Expand Up @@ -445,9 +445,9 @@

def build_requirements(self):
if self._settings_build.os == "Windows" and is_msvc(self):
self.tool_requires("jom/1.1.3")
self.tool_requires("jom/[>=1.1 <2]")
if self.options.qtwebengine:
self.tool_requires("ninja/1.11.1")
self.tool_requires("ninja/[>=1.12 <2]")
self.tool_requires("nodejs/18.15.0")
self.tool_requires("gperf/3.1")
# gperf, bison, flex, python >= 2.7.5 & < 3
Expand Down Expand Up @@ -933,7 +933,7 @@
filecontents += 'set(CMAKE_AUTOMOC_MACRO_NAMES "Q_OBJECT" "Q_GADGET" "Q_GADGET_EXPORT" "Q_NAMESPACE" "Q_NAMESPACE_EXPORT")\n'
save(self, os.path.join(self.package_folder, self._cmake_core_extras_file), filecontents)

def _create_private_module(module, dependencies=[]):

Check warning on line 936 in recipes/qt/5.x.x/conanfile.py

View workflow job for this annotation

GitHub Actions / Lint changed conanfile.py (v2 migration)

Dangerous default value [] as argument
if "Core" not in dependencies:
dependencies.append("Core")
dependencies_string = ';'.join(f'Qt5::{dependency}' for dependency in dependencies)
Expand Down Expand Up @@ -1002,7 +1002,7 @@
reqs.append(corrected_req)
return reqs

def _create_module(module, requires=[], has_include_dir=True):

Check warning on line 1005 in recipes/qt/5.x.x/conanfile.py

View workflow job for this annotation

GitHub Actions / Lint changed conanfile.py (v2 migration)

Dangerous default value [] as argument
componentname = f"qt{module}"
assert componentname not in self.cpp_info.components, f"Module {module} already present in self.cpp_info.components"
self.cpp_info.components[componentname].set_property("cmake_target_name", f"Qt5::{module}")
Expand Down
12 changes: 8 additions & 4 deletions recipes/qt/6.x.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def requirements(self):
else:
self.requires("libjpeg/9e")
if self.options.get_safe("with_libpng", False) and not self.options.multiconfiguration:
self.requires("libpng/1.6.42")
self.requires("libpng/[>=1.6 <2]")
if self.options.with_sqlite3 and not self.options.multiconfiguration:
self.requires("sqlite3/3.45.0")
if self.options.get_safe("with_mysql", False):
Expand Down Expand Up @@ -380,7 +380,7 @@ def requirements(self):
if self.options.with_brotli:
self.requires("brotli/1.1.0")
if self.options.get_safe("qtwebengine") and self.settings.os == "Linux":
self.requires("expat/2.6.0")
self.requires("expat/[>=2.6.2 <3]")
self.requires("opus/1.4")
self.requires("xorg-proto/2022.2")
self.requires("libxshmfence/1.3")
Expand All @@ -400,9 +400,9 @@ def requirements(self):

def build_requirements(self):
self.tool_requires("cmake/[>=3.21.1 <4]")
self.tool_requires("ninja/1.11.1")
self.tool_requires("ninja/[>=1.12 <2]")
if not self.conf.get("tools.gnu:pkg_config", check_type=str):
self.tool_requires("pkgconf/2.1.0")
self.tool_requires("pkgconf/[>=2.2 <3]")
if self.settings.os == "Windows":
self.tool_requires('strawberryperl/5.32.1.1')

Expand Down Expand Up @@ -803,6 +803,8 @@ def package(self):
if self.settings.os == "Macos":
save(self, ".qmake.stash", "")
save(self, ".qmake.super", "")
copy(self, "Info.plist.app.in", src=os.path.join(self.package_folder, "lib", "cmake", "Qt6", "macos"),
dst=os.path.join(self.package_folder, "res", "macos"))
cmake = CMake(self)
cmake.install()
copy(self, "*LICENSE*", self.source_folder, os.path.join(self.package_folder, "licenses"),
Expand Down Expand Up @@ -837,6 +839,8 @@ def package(self):
filecontents += f"set(QT_VERSION_MAJOR {ver.major})\n"
filecontents += f"set(QT_VERSION_MINOR {ver.minor})\n"
filecontents += f"set(QT_VERSION_PATCH {ver.patch})\n"
if self.settings.os == "Macos":
filecontents += f'set(__qt_internal_cmake_apple_support_files_path "{os.path.join(self.package_folder, "res", "macos")}")\n'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this not cause a file inside package_folder to have a full, absolute path referencing a file that existed at package build time, but may not exist on a different computer? intuitively this should be a relative path?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, it should be relative path. Absolute will break users for sure.

targets = ["moc", "rcc", "tracegen", "cmake_automoc_parser", "qlalr", "qmake"]
if self.options.with_dbus:
targets.extend(["qdbuscpp2xml", "qdbusxml2cpp"])
Expand Down
Loading