build script: add method to run pkg-config

This commit is contained in:
alexey.lysiuk 2020-12-19 11:55:13 +02:00
parent 56ce2a404c
commit d81e9f10df

View file

@ -1898,6 +1898,14 @@ class Builder(object):
self.source_path = extract_path
self.build_path = self.build_path + first_path_component + os.sep
def run_pkg_config(self, *args) -> str:
os.makedirs(self.build_path, exist_ok=True)
args = (self.bin_path + 'pkg-config',) + args
result = subprocess.check_output(args, cwd=self.build_path)
return result.decode('utf-8').rstrip('\n')
if __name__ == '__main__':
Builder(sys.argv[1:]).run()