diff --git a/libs/qtav/qtav.py b/libs/qtav/qtav.py --- a/libs/qtav/qtav.py +++ b/libs/qtav/qtav.py @@ -30,13 +30,25 @@ class Package(QMakePackageBase): def __init__(self): QMakePackageBase.__init__(self) - - def configureOptions(self, defines=""): - return super().configureOptions(defines + ' "CONFIG += no-examples no-tests"') + self.subinfo.options.configure.args += ' "CONFIG += no-examples no-tests"' def install(self, options=None): - if not super().install(options): - return False - if OsUtils.isWin(): - return utils.system("sdk_install.bat", cwd=self.buildDir()) - return True + # package is supposed to be installed using sdk_install.sh/bat (??) instead of make install + + # install script doesn't create all needed dirs + for dir in ["bin", "lib", "mkspecs/features", "mkspecs/modules", "qml/QtAV"]: + os.makedirs(os.path.join(self.installDir(), dir.replace('/', os.sep)), exist_ok=True) + + # create patched script that copies files to self.installDir() instead of self.installPrefix() + script = "sdk_install.bat" if OsUtils.isWin() else "sdk_install.sh" + with open(os.path.join(self.buildDir(), script), "rt") as f: + content = f.read() + scriptPath = os.path.join(self.buildDir(), f"fixed_{script}") + with open(scriptPath, "wt") as f: + instOld = re.escape(self.installPrefix()) + instNew = self.installDir().replace('\\', '\\\\') + f.write(re.compile(instOld + "(\S+(\n|$))").sub(instNew + "\\1", content)) + if OsUtils.isUnix(): + os.chmod(scriptPath, 0o755) + + return utils.system(os.path.join(".", f"fixed_{script}"), cwd=self.buildDir())