|
|
@ -795,7 +795,8 @@ class Python3Dependency(ExternalDependency): |
|
|
|
self.version = sysconfig.get_config_var('py_version') |
|
|
|
self.version = sysconfig.get_config_var('py_version') |
|
|
|
self.is_found = True |
|
|
|
self.is_found = True |
|
|
|
|
|
|
|
|
|
|
|
def get_methods(self): |
|
|
|
@staticmethod |
|
|
|
|
|
|
|
def get_methods(): |
|
|
|
if mesonlib.is_windows(): |
|
|
|
if mesonlib.is_windows(): |
|
|
|
return [DependencyMethods.PKGCONFIG, DependencyMethods.SYSCONFIG] |
|
|
|
return [DependencyMethods.PKGCONFIG, DependencyMethods.SYSCONFIG] |
|
|
|
elif mesonlib.is_osx(): |
|
|
|
elif mesonlib.is_osx(): |
|
|
@ -813,90 +814,80 @@ class Python3Dependency(ExternalDependency): |
|
|
|
class PcapDependency(ExternalDependency): |
|
|
|
class PcapDependency(ExternalDependency): |
|
|
|
def __init__(self, environment, kwargs): |
|
|
|
def __init__(self, environment, kwargs): |
|
|
|
super().__init__('pcap', environment, None, kwargs) |
|
|
|
super().__init__('pcap', environment, None, kwargs) |
|
|
|
kwargs['required'] = False |
|
|
|
|
|
|
|
if DependencyMethods.PKGCONFIG in self.methods: |
|
|
|
@classmethod |
|
|
|
|
|
|
|
def _factory(cls, environment, kwargs): |
|
|
|
|
|
|
|
methods = cls._process_method_kw(kwargs) |
|
|
|
|
|
|
|
if DependencyMethods.PKGCONFIG in methods: |
|
|
|
try: |
|
|
|
try: |
|
|
|
pcdep = PkgConfigDependency('pcap', environment, kwargs) |
|
|
|
pcdep = PkgConfigDependency('pcap', environment, kwargs) |
|
|
|
if pcdep.found(): |
|
|
|
if pcdep.found(): |
|
|
|
self.type_name = 'pkgconfig' |
|
|
|
return pcdep |
|
|
|
self.is_found = True |
|
|
|
|
|
|
|
self.compile_args = pcdep.get_compile_args() |
|
|
|
|
|
|
|
self.link_args = pcdep.get_link_args() |
|
|
|
|
|
|
|
self.version = pcdep.get_version() |
|
|
|
|
|
|
|
self.pcdep = pcdep |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
except Exception as e: |
|
|
|
except Exception as e: |
|
|
|
mlog.debug('Pcap not found via pkgconfig. Trying next, error was:', str(e)) |
|
|
|
mlog.debug('Pcap not found via pkgconfig. Trying next, error was:', str(e)) |
|
|
|
if DependencyMethods.CONFIG_TOOL in self.methods: |
|
|
|
if DependencyMethods.CONFIG_TOOL in methods: |
|
|
|
try: |
|
|
|
try: |
|
|
|
ctdep = ConfigToolDependency.factory( |
|
|
|
ctdep = ConfigToolDependency.factory( |
|
|
|
'pcap', environment, None, kwargs, ['pcap-config'], 'pcap-config') |
|
|
|
'pcap', environment, None, kwargs, ['pcap-config'], 'pcap-config') |
|
|
|
if ctdep.found(): |
|
|
|
if ctdep.found(): |
|
|
|
self.config = ctdep.config |
|
|
|
ctdep.compile_args = ctdep.get_config_value(['--cflags'], 'compile_args') |
|
|
|
self.type_name = 'config-tool' |
|
|
|
ctdep.link_args = ctdep.get_config_value(['--libs'], 'link_args') |
|
|
|
self.compile_args = ctdep.get_config_value(['--cflags'], 'compile_args') |
|
|
|
ctdep.version = cls.get_pcap_lib_version(ctdep) |
|
|
|
self.link_args = ctdep.get_config_value(['--libs'], 'link_args') |
|
|
|
return ctdep |
|
|
|
self.version = self.get_pcap_lib_version() |
|
|
|
|
|
|
|
self.is_found = True |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
except Exception as e: |
|
|
|
except Exception as e: |
|
|
|
mlog.debug('Pcap not found via pcap-config. Trying next, error was:', str(e)) |
|
|
|
mlog.debug('Pcap not found via pcap-config. Trying next, error was:', str(e)) |
|
|
|
|
|
|
|
|
|
|
|
def get_methods(self): |
|
|
|
return PcapDependency(environment, kwargs) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod |
|
|
|
|
|
|
|
def get_methods(): |
|
|
|
if mesonlib.is_osx(): |
|
|
|
if mesonlib.is_osx(): |
|
|
|
return [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL, DependencyMethods.EXTRAFRAMEWORK] |
|
|
|
return [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL, DependencyMethods.EXTRAFRAMEWORK] |
|
|
|
else: |
|
|
|
else: |
|
|
|
return [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL] |
|
|
|
return [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL] |
|
|
|
|
|
|
|
|
|
|
|
def get_pcap_lib_version(self): |
|
|
|
@staticmethod |
|
|
|
return self.compiler.get_return_value('pcap_lib_version', 'string', |
|
|
|
def get_pcap_lib_version(ctdep): |
|
|
|
'#include <pcap.h>', self.env, [], [self]) |
|
|
|
return ctdep.compiler.get_return_value('pcap_lib_version', 'string', |
|
|
|
|
|
|
|
'#include <pcap.h>', ctdep.env, [], [ctdep]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CupsDependency(ExternalDependency): |
|
|
|
class CupsDependency(ExternalDependency): |
|
|
|
def __init__(self, environment, kwargs): |
|
|
|
def __init__(self, environment, kwargs): |
|
|
|
super().__init__('cups', environment, None, kwargs) |
|
|
|
super().__init__('cups', environment, None, kwargs) |
|
|
|
kwargs['required'] = False |
|
|
|
|
|
|
|
if DependencyMethods.PKGCONFIG in self.methods: |
|
|
|
@classmethod |
|
|
|
|
|
|
|
def _factory(cls, environment, kwargs): |
|
|
|
|
|
|
|
methods = cls._process_method_kw(kwargs) |
|
|
|
|
|
|
|
if DependencyMethods.PKGCONFIG in methods: |
|
|
|
try: |
|
|
|
try: |
|
|
|
pcdep = PkgConfigDependency('cups', environment, kwargs) |
|
|
|
pcdep = PkgConfigDependency('cups', environment, kwargs) |
|
|
|
if pcdep.found(): |
|
|
|
if pcdep.found(): |
|
|
|
self.type_name = 'pkgconfig' |
|
|
|
return pcdep |
|
|
|
self.is_found = True |
|
|
|
|
|
|
|
self.compile_args = pcdep.get_compile_args() |
|
|
|
|
|
|
|
self.link_args = pcdep.get_link_args() |
|
|
|
|
|
|
|
self.version = pcdep.get_version() |
|
|
|
|
|
|
|
self.pcdep = pcdep |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
except Exception as e: |
|
|
|
except Exception as e: |
|
|
|
mlog.debug('cups not found via pkgconfig. Trying next, error was:', str(e)) |
|
|
|
mlog.debug('cups not found via pkgconfig. Trying next, error was:', str(e)) |
|
|
|
if DependencyMethods.CONFIG_TOOL in self.methods: |
|
|
|
if DependencyMethods.CONFIG_TOOL in methods: |
|
|
|
try: |
|
|
|
try: |
|
|
|
ctdep = ConfigToolDependency.factory( |
|
|
|
ctdep = ConfigToolDependency.factory( |
|
|
|
'cups', environment, None, kwargs, ['cups-config'], 'cups-config') |
|
|
|
'cups', environment, None, kwargs, ['cups-config'], 'cups-config') |
|
|
|
if ctdep.found(): |
|
|
|
if ctdep.found(): |
|
|
|
self.config = ctdep.config |
|
|
|
ctdep.compile_args = ctdep.get_config_value(['--cflags'], 'compile_args') |
|
|
|
self.type_name = 'config-tool' |
|
|
|
ctdep.link_args = ctdep.get_config_value(['--ldflags', '--libs'], 'link_args') |
|
|
|
self.version = ctdep.version |
|
|
|
return ctdep |
|
|
|
self.compile_args = ctdep.get_config_value(['--cflags'], 'compile_args') |
|
|
|
|
|
|
|
self.link_args = ctdep.get_config_value(['--ldflags', '--libs'], 'link_args') |
|
|
|
|
|
|
|
self.is_found = True |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
except Exception as e: |
|
|
|
except Exception as e: |
|
|
|
mlog.debug('cups not found via cups-config. Trying next, error was:', str(e)) |
|
|
|
mlog.debug('cups not found via cups-config. Trying next, error was:', str(e)) |
|
|
|
if DependencyMethods.EXTRAFRAMEWORK in self.methods: |
|
|
|
if DependencyMethods.EXTRAFRAMEWORK in methods: |
|
|
|
if mesonlib.is_osx(): |
|
|
|
if mesonlib.is_osx(): |
|
|
|
fwdep = ExtraFrameworkDependency('cups', False, None, self.env, |
|
|
|
fwdep = ExtraFrameworkDependency('cups', False, None, environment, |
|
|
|
self.language, kwargs) |
|
|
|
kwargs.get('language', None), kwargs) |
|
|
|
if fwdep.found(): |
|
|
|
if fwdep.found(): |
|
|
|
self.is_found = True |
|
|
|
return fwdep |
|
|
|
self.compile_args = fwdep.get_compile_args() |
|
|
|
mlog.log('Dependency', mlog.bold('cups'), 'found:', mlog.red('NO')) |
|
|
|
self.link_args = fwdep.get_link_args() |
|
|
|
|
|
|
|
self.version = fwdep.get_version() |
|
|
|
return CupsDependency(environment, kwargs) |
|
|
|
return |
|
|
|
|
|
|
|
mlog.log('Dependency', mlog.bold('cups'), 'found:', mlog.red('NO')) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_methods(self): |
|
|
|
@staticmethod |
|
|
|
|
|
|
|
def get_methods(): |
|
|
|
if mesonlib.is_osx(): |
|
|
|
if mesonlib.is_osx(): |
|
|
|
return [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL, DependencyMethods.EXTRAFRAMEWORK] |
|
|
|
return [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL, DependencyMethods.EXTRAFRAMEWORK] |
|
|
|
else: |
|
|
|
else: |
|
|
@ -906,36 +897,33 @@ class CupsDependency(ExternalDependency): |
|
|
|
class LibWmfDependency(ExternalDependency): |
|
|
|
class LibWmfDependency(ExternalDependency): |
|
|
|
def __init__(self, environment, kwargs): |
|
|
|
def __init__(self, environment, kwargs): |
|
|
|
super().__init__('libwmf', environment, None, kwargs) |
|
|
|
super().__init__('libwmf', environment, None, kwargs) |
|
|
|
if DependencyMethods.PKGCONFIG in self.methods: |
|
|
|
|
|
|
|
|
|
|
|
@classmethod |
|
|
|
|
|
|
|
def _factory(cls, environment, kwargs): |
|
|
|
|
|
|
|
methods = cls._process_method_kw(kwargs) |
|
|
|
|
|
|
|
if DependencyMethods.PKGCONFIG in methods: |
|
|
|
try: |
|
|
|
try: |
|
|
|
kwargs['required'] = False |
|
|
|
kwargs['required'] = False |
|
|
|
pcdep = PkgConfigDependency('libwmf', environment, kwargs) |
|
|
|
pcdep = PkgConfigDependency('libwmf', environment, kwargs) |
|
|
|
if pcdep.found(): |
|
|
|
if pcdep.found(): |
|
|
|
self.type_name = 'pkgconfig' |
|
|
|
return pcdep |
|
|
|
self.is_found = True |
|
|
|
|
|
|
|
self.compile_args = pcdep.get_compile_args() |
|
|
|
|
|
|
|
self.link_args = pcdep.get_link_args() |
|
|
|
|
|
|
|
self.version = pcdep.get_version() |
|
|
|
|
|
|
|
self.pcdep = pcdep |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
except Exception as e: |
|
|
|
except Exception as e: |
|
|
|
mlog.debug('LibWmf not found via pkgconfig. Trying next, error was:', str(e)) |
|
|
|
mlog.debug('LibWmf not found via pkgconfig. Trying next, error was:', str(e)) |
|
|
|
if DependencyMethods.CONFIG_TOOL in self.methods: |
|
|
|
if DependencyMethods.CONFIG_TOOL in methods: |
|
|
|
try: |
|
|
|
try: |
|
|
|
ctdep = ConfigToolDependency.factory( |
|
|
|
ctdep = ConfigToolDependency.factory( |
|
|
|
'libwmf', environment, None, kwargs, ['libwmf-config'], 'libwmf-config') |
|
|
|
'libwmf', environment, None, kwargs, ['libwmf-config'], 'libwmf-config') |
|
|
|
if ctdep.found(): |
|
|
|
if ctdep.found(): |
|
|
|
self.config = ctdep.config |
|
|
|
ctdep.compile_args = ctdep.get_config_value(['--cflags'], 'compile_args') |
|
|
|
self.type_name = 'config-too' |
|
|
|
ctdep.link_args = ctdep.get_config_value(['--libs'], 'link_args') |
|
|
|
self.version = ctdep.version |
|
|
|
return ctdep |
|
|
|
self.compile_args = ctdep.get_config_value(['--cflags'], 'compile_args') |
|
|
|
|
|
|
|
self.link_args = ctdep.get_config_value(['--libs'], 'link_args') |
|
|
|
|
|
|
|
self.is_found = True |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
except Exception as e: |
|
|
|
except Exception as e: |
|
|
|
mlog.debug('cups not found via libwmf-config. Trying next, error was:', str(e)) |
|
|
|
mlog.debug('cups not found via libwmf-config. Trying next, error was:', str(e)) |
|
|
|
|
|
|
|
|
|
|
|
def get_methods(self): |
|
|
|
return LibWmfDependency(environment, kwargs) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod |
|
|
|
|
|
|
|
def get_methods(): |
|
|
|
if mesonlib.is_osx(): |
|
|
|
if mesonlib.is_osx(): |
|
|
|
return [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL, DependencyMethods.EXTRAFRAMEWORK] |
|
|
|
return [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL, DependencyMethods.EXTRAFRAMEWORK] |
|
|
|
else: |
|
|
|
else: |
|
|
|