Skip to content

Commit

Permalink
Patch *.prl too and *.pc for mingw
Browse files Browse the repository at this point in the history
*.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.
  • Loading branch information
iakov committed Feb 3, 2023
1 parent 7791083 commit d47742c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions aqt/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit d47742c

Please sign in to comment.