diff options
author | Félix Piédallu <felix@piedallu.me> | 2017-10-30 11:44:34 +0100 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-10-31 01:05:46 +0200 |
commit | bb84c1d1092465738efabc23342cb9fa943ccb77 (patch) | |
tree | 3cab442098b3fe97526de4202deb6054623152d9 /mesonbuild/dependencies/misc.py | |
parent | 02bea7d5bf5c98c586e59e60357fc5ca11826172 (diff) | |
download | meson-bb84c1d1092465738efabc23342cb9fa943ccb77.zip meson-bb84c1d1092465738efabc23342cb9fa943ccb77.tar.gz meson-bb84c1d1092465738efabc23342cb9fa943ccb77.tar.bz2 |
Add LibWmf as a specified dependency, and associated tests.
Diffstat (limited to 'mesonbuild/dependencies/misc.py')
-rw-r--r-- | mesonbuild/dependencies/misc.py | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index a24c873..e65675b 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -761,6 +761,44 @@ class CupsDependency(ExternalDependency): else: return [DependencyMethods.PKGCONFIG, DependencyMethods.CUPSCONFIG] + +class LibWmfDependency(ExternalDependency): + def __init__(self, environment, kwargs): + super().__init__('libwmf', environment, None, kwargs) + if DependencyMethods.PKGCONFIG in self.methods: + try: + kwargs['required'] = False + pcdep = PkgConfigDependency('libwmf', environment, kwargs) + if pcdep.found(): + self.type_name = 'pkgconfig' + self.is_found = True + self.compile_args = pcdep.get_compile_args() + self.link_args = pcdep.get_link_args() + self.version = pcdep.get_version() + return + except Exception as e: + mlog.debug('LibWmf not found via pkgconfig. Trying next, error was:', str(e)) + if DependencyMethods.LIBWMFCONFIG in self.methods: + libwmfconf = shutil.which('libwmf-config') + if libwmfconf: + stdo = Popen_safe(['libwmf-config', '--cflags'])[1] + self.compile_args = stdo.strip().split() + stdo = Popen_safe(['libwmf-config', '--libs'])[1] + self.link_args = stdo.strip().split() + stdo = Popen_safe(['libwmf-config', '--version'])[1] + self.version = stdo.strip() + self.is_found = True + mlog.log('Dependency', mlog.bold('libwmf'), 'found:', + mlog.green('YES'), '(%s)' % libwmfconf) + return + mlog.debug('Could not find libwmf-config binary, trying next.') + + def get_methods(self): + if mesonlib.is_osx(): + return [DependencyMethods.PKGCONFIG, DependencyMethods.LIBWMFCONFIG, DependencyMethods.EXTRAFRAMEWORK] + else: + return [DependencyMethods.PKGCONFIG, DependencyMethods.LIBWMFCONFIG] + # Generated with boost_names.py BOOST_LIBS = [ 'boost_atomic', |