From d08c06788871e76304e1edefd1e3dcf21fc4c05a Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Tue, 8 Dec 2020 10:22:05 +0200 Subject: [PATCH] build script: define pkg-config extra libraries as string this allows to specify frameworks in addition to libraries --- build.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/build.py b/build.py index 3fa05df7..f2c4e6cd 100755 --- a/build.py +++ b/build.py @@ -131,7 +131,7 @@ class Target(BaseTarget): self.update_pc_files(builder) @staticmethod - def update_pc_file(path: str, extra_libs=None): + def update_pc_file(path: str, extra_libs: str = None): with open(path, 'r') as f: content = f.readlines() @@ -146,10 +146,8 @@ class Target(BaseTarget): patched_line = prefix + os.linesep elif extra_libs and line.startswith('Libs:'): # Append extra libraries to link with - patched_line = patched_line.strip('\n') - for lib in extra_libs: - patched_line += f' -l{lib}' - patched_line += os.linesep + if extra_libs not in line: + patched_line = line.rstrip('\n') + ' ' + extra_libs + os.linesep patched_content.append(patched_line) @@ -929,9 +927,9 @@ class VorbisTarget(ConfigureMakeStaticDependencyTarget): def __init__(self, name='vorbis'): super().__init__(name) self.pkg_libs = { - 'vorbis': ('ogg',), - 'vorbisenc': ('vorbis', 'ogg'), - 'vorbisfile': ('vorbis', 'ogg'), + 'vorbis': '-logg', + 'vorbisenc': '-lvorbis -logg', + 'vorbisfile': '-lvorbis -logg', } def prepare_source(self, builder: 'Builder'):