@ -25,6 +25,7 @@ from .base import DependencyException, DependencyMethods
from . base import BuiltinDependency , SystemDependency
from . cmake import CMakeDependency
from . configtool import ConfigToolDependency
from . detect import packages
from . factory import DependencyFactory , factory_methods
from . pkgconfig import PkgConfigDependency
@ -57,6 +58,8 @@ def netcdf_factory(env: 'Environment',
return candidates
packages [ ' netcdf ' ] = netcdf_factory
class DlBuiltinDependency ( BuiltinDependency ) :
def __init__ ( self , name : str , env : ' Environment ' , kwargs : T . Dict [ str , T . Any ] ) :
@ -136,6 +139,8 @@ class OpenMPDependency(SystemDependency):
if not self . is_found :
mlog . log ( mlog . yellow ( ' WARNING: ' ) , ' OpenMP found but omp.h missing. ' )
packages [ ' openmp ' ] = OpenMPDependency
class ThreadDependency ( SystemDependency ) :
def __init__ ( self , name : str , environment : ' Environment ' , kwargs : T . Dict [ str , T . Any ] ) - > None :
@ -183,6 +188,8 @@ class BlocksDependency(SystemDependency):
self . is_found = True
packages [ ' blocks ' ] = BlocksDependency
class PcapDependencyConfigTool ( ConfigToolDependency ) :
@ -489,6 +496,7 @@ def curses_factory(env: 'Environment',
candidates . append ( functools . partial ( CursesSystemDependency , ' curses ' , env , kwargs ) )
return candidates
packages [ ' curses ' ] = curses_factory
@factory_methods ( { DependencyMethods . PKGCONFIG , DependencyMethods . SYSTEM } )
@ -524,83 +532,84 @@ def shaderc_factory(env: 'Environment',
candidates . append ( functools . partial ( ShadercDependency , env , kwargs ) )
return candidates
packages [ ' shaderc ' ] = shaderc_factory
cups_factory = DependencyFactory (
packages [ ' cups ' ] = cups_factory = DependencyFactory (
' cups ' ,
[ DependencyMethods . PKGCONFIG , DependencyMethods . CONFIG_TOOL , DependencyMethods . EXTRAFRAMEWORK , DependencyMethods . CMAKE ] ,
configtool_class = CupsDependencyConfigTool ,
cmake_name = ' Cups ' ,
)
dl_factory = DependencyFactory (
packages [ ' dl ' ] = dl_factory = DependencyFactory (
' dl ' ,
[ DependencyMethods . BUILTIN , DependencyMethods . SYSTEM ] ,
builtin_class = DlBuiltinDependency ,
system_class = DlSystemDependency ,
)
gpgme_factory = DependencyFactory (
packages [ ' gpgme ' ] = gpgme_factory = DependencyFactory (
' gpgme ' ,
[ DependencyMethods . PKGCONFIG , DependencyMethods . CONFIG_TOOL ] ,
configtool_class = GpgmeDependencyConfigTool ,
)
libgcrypt_factory = DependencyFactory (
packages [ ' libgcrypt ' ] = libgcrypt_factory = DependencyFactory (
' libgcrypt ' ,
[ DependencyMethods . PKGCONFIG , DependencyMethods . CONFIG_TOOL ] ,
configtool_class = LibGCryptDependencyConfigTool ,
)
libwmf_factory = DependencyFactory (
packages [ ' libwmf ' ] = libwmf_factory = DependencyFactory (
' libwmf ' ,
[ DependencyMethods . PKGCONFIG , DependencyMethods . CONFIG_TOOL ] ,
configtool_class = LibWmfDependencyConfigTool ,
)
pcap_factory = DependencyFactory (
packages [ ' pcap ' ] = p cap_factory = DependencyFactory (
' pcap ' ,
[ DependencyMethods . PKGCONFIG , DependencyMethods . CONFIG_TOOL ] ,
configtool_class = PcapDependencyConfigTool ,
pkgconfig_name = ' libpcap ' ,
)
threads_factory = DependencyFactory (
packages [ ' threads ' ] = threads_factory = DependencyFactory (
' threads ' ,
[ DependencyMethods . SYSTEM , DependencyMethods . CMAKE ] ,
cmake_name = ' Threads ' ,
system_class = ThreadDependency ,
)
iconv_factory = DependencyFactory (
packages [ ' iconv ' ] = iconv_factory = DependencyFactory (
' iconv ' ,
[ DependencyMethods . BUILTIN , DependencyMethods . SYSTEM ] ,
builtin_class = IconvBuiltinDependency ,
system_class = IconvSystemDependency ,
)
intl_factory = DependencyFactory (
packages [ ' intl ' ] = intl_factory = DependencyFactory (
' intl ' ,
[ DependencyMethods . BUILTIN , DependencyMethods . SYSTEM ] ,
builtin_class = IntlBuiltinDependency ,
system_class = IntlSystemDependency ,
)
openssl_factory = DependencyFactory (
packages [ ' openssl ' ] = openssl_factory = DependencyFactory (
' openssl ' ,
[ DependencyMethods . PKGCONFIG , DependencyMethods . SYSTEM , DependencyMethods . CMAKE ] ,
system_class = OpensslSystemDependency ,
cmake_class = lambda name , env , kwargs : CMakeDependency ( ' OpenSSL ' , env , dict ( kwargs , modules = [ ' OpenSSL::Crypto ' , ' OpenSSL::SSL ' ] ) ) ,
)
libcrypto_factory = DependencyFactory (
packages [ ' libcrypto ' ] = libcrypto_factory = DependencyFactory (
' libcrypto ' ,
[ DependencyMethods . PKGCONFIG , DependencyMethods . SYSTEM , DependencyMethods . CMAKE ] ,
system_class = OpensslSystemDependency ,
cmake_class = lambda name , env , kwargs : CMakeDependency ( ' OpenSSL ' , env , dict ( kwargs , modules = [ ' OpenSSL::Crypto ' ] ) ) ,
)
libssl_factory = DependencyFactory (
packages [ ' libssl ' ] = libssl_factory = DependencyFactory (
' libssl ' ,
[ DependencyMethods . PKGCONFIG , DependencyMethods . SYSTEM , DependencyMethods . CMAKE ] ,
system_class = OpensslSystemDependency ,