build script: add pkg-config target

This commit is contained in:
alexey.lysiuk 2020-12-11 16:10:25 +02:00
parent 6c1ffea7b8
commit 043a0b4898

View file

@ -1022,6 +1022,24 @@ class PcreTarget(ConfigureMakeStaticDependencyTarget):
return os.path.exists(builder.source_path + 'pcre.h.in') return os.path.exists(builder.source_path + 'pcre.h.in')
class PkgConfigTarget(ConfigureMakeDependencyTarget):
def __init__(self, name='pkg-config'):
super().__init__(name)
def prepare_source(self, builder: 'Builder'):
builder.download_source(
'https://pkg-config.freedesktop.org/releases/pkg-config-0.29.2.tar.gz',
'6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591')
def detect(self, builder: 'Builder') -> bool:
return os.path.exists(builder.source_path + 'pkg-config.1')
def post_build(self, builder: 'Builder'):
src_path = builder.build_path + 'pkg-config'
dst_path = builder.deps_path + self.name + os.sep + 'bin' + os.sep + 'pkg-config.exe'
shutil.copy(src_path, dst_path)
class SndFileTarget(CMakeStaticDependencyTarget): class SndFileTarget(CMakeStaticDependencyTarget):
def __init__(self, name='sndfile'): def __init__(self, name='sndfile'):
super().__init__(name) super().__init__(name)
@ -1303,6 +1321,7 @@ class Builder(object):
OpusTarget(), OpusTarget(),
OpusFileTarget(), OpusFileTarget(),
PcreTarget(), PcreTarget(),
PkgConfigTarget(),
SndFileTarget(), SndFileTarget(),
VorbisTarget(), VorbisTarget(),
ZlibTarget(), ZlibTarget(),