From d47742c506968b605cc6d0bfef9d9c9a9a980532 Mon Sep 17 00:00:00 2001 From: iakov Date: Thu, 2 Feb 2023 21:54:55 +0300 Subject: [PATCH] Patch *.prl too and *.pc for mingw *.prl are qmake's library descriptions like *.pc are for package-config, and contain incorrect paths for some archives/modules (at least qttools is bad in 5.11) Also .pc can be used with mingw via MSYS's pkgconfig, and should be patched on Windows too. --- aqt/updater.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/aqt/updater.py b/aqt/updater.py index 4ccf3dc2..15950231 100644 --- a/aqt/updater.py +++ b/aqt/updater.py @@ -102,6 +102,15 @@ def _detect_qmake(self) -> bool: return True return False + def patch_prl(self, oldvalue): + for prlfile in self.prefix.joinpath("lib").glob("*.prl"): + self.logger.info("Patching {}".format(prlfile)) + self._patch_textfile( + prlfile, + oldvalue, + "$$[QT_INSTALL_LIBS]" + ) + def patch_pkgconfig(self, oldvalue, os_name): for pcfile in self.prefix.joinpath("lib", "pkgconfig").glob("*.pc"): self.logger.info("Patching {}".format(pcfile)) @@ -292,10 +301,14 @@ def update(cls, target: TargetConfig, base_path: Path, installed_desktop_arch_di if target.os_name == "linux": updater.patch_pkgconfig("/home/qt/work/install", target.os_name) updater.patch_libtool("/home/qt/work/install/lib", target.os_name) + updater.patch_prl("/home/qt/work/install/lib") elif target.os_name == "mac": updater.patch_pkgconfig("/Users/qt/work/install", target.os_name) updater.patch_libtool("/Users/qt/work/install/lib", target.os_name) + updater.patch_prl("/Users/qt/work/install/lib") elif target.os_name == "windows": + updater.patch_pkgconfig("c:/Users/qt/work/install", target.os_name) + updater.patch_prl("c:/Users/qt/work/install/lib") updater.make_qtenv2(base_dir, version_dir, arch_dir) if version < Version("5.14.0"): updater.patch_qtcore(target)