patch pkgconfig Libs.private path

This commit is contained in:
tsteven4
2021-06-12 07:27:31 -07:00
parent aa595fdbee
commit f88ab2c9ca

View File

@@ -85,24 +85,19 @@ class Updater:
return True return True
return False return False
def patch_pkgconfig(self, os_name): def patch_pkgconfig(self, oldvalue):
for pcfile in self.prefix.joinpath("lib", "pkgconfig").glob("*.pc"): for pcfile in self.prefix.joinpath("lib", "pkgconfig").glob("*.pc"):
if os_name == "linux": self.logger.info("Patching {}".format(pcfile))
self.logger.info("Patching {}".format(pcfile)) self._patch_textfile(
self._patch_textfile( pcfile,
pcfile, "prefix={}".format(oldvalue),
"prefix=/home/qt/work/install", "prefix={}".format(str(self.prefix)),
"prefix={}".format(str(self.prefix)), )
) self._patch_textfile(
elif os_name == "mac": pcfile,
self.logger.info("Patching {}".format(pcfile)) "-F{}/lib".format(oldvalue),
self._patch_textfile( "-F{}/lib".format(str(self.prefix)),
pcfile, )
"prefix=/Users/qt/work/install",
"prefix={}".format(str(self.prefix)),
)
else:
pass
def patch_qmake(self): def patch_qmake(self):
"""Patch to qmake binary""" """Patch to qmake binary"""
@@ -243,8 +238,10 @@ class Updater:
]: # desktop version ]: # desktop version
updater.make_qtconf(base_dir, target.version, arch_dir) updater.make_qtconf(base_dir, target.version, arch_dir)
updater.patch_qmake() updater.patch_qmake()
if os.path.isdir(prefix.joinpath("lib", "pkgconfig")): if target.os_name == "linux":
updater.patch_pkgconfig(target.os_name) updater.patch_pkgconfig("/home/qt/work/install")
elif target.os_name == "mac":
updater.patch_pkgconfig("/Users/qt/work/install")
if Version(target.version) < Version("5.14.0"): if Version(target.version) < Version("5.14.0"):
updater.patch_qtcore(target) updater.patch_qtcore(target)
elif Version(target.version) in SimpleSpec(">=5.0,<6.0"): elif Version(target.version) in SimpleSpec(">=5.0,<6.0"):