
    <hm                    (   S SK Jr  S SKrS SKrSSKJrJr  SSKJr  SSKJ	r	J
r
  SSKJr  SSKJr  SS	KJr  \R"                  (       a  SS
KJr  SSKJr  SSKJr  SSKJr  \R2                  / \4   r\R2                  S\\R6                  \\R:                  4   \R<                  \   /\R<                  \   4   r\R2                  S\\R6                  \\R:                  4   /\R<                  \   4   r \R2                  S\4   r! " S S5      r"SS jr#g)    )annotationsN   )DependencyExceptionDependencyMethodsprocess_method_kw)BuiltinDependencySystemDependency)CMakeDependency)ExtraFrameworkDependency)PkgConfigDependency)ExternalDependency)ConfigToolDependency   )Environment)MachineChoicer   .c                      \ rS rSrSrSS\S\SS\\\	S.
                   S	S jjr
\S
S j5       r    SS jrSrg)DependencyFactory/   a  Factory to get dependencies from multiple sources.

This class provides an initializer that takes a set of names and classes
for various kinds of dependencies. When the initialized object is called
it returns a list of callables return Dependency objects to try in order.

:name: The name of the dependency. This will be passed as the name
    parameter of the each dependency unless it is overridden on a per
    type basis.
:methods: An ordered list of DependencyMethods. This is the order
    dependencies will be returned in unless they are removed by the
    _process_method function
:*_name: This will overwrite the name passed to the corresponding class.
    For example, if the name is 'zlib', but cmake calls the dependency
    'Z', then using `cmake_name='Z'` will pass the name as 'Z' to cmake.
:*_class: A *type* or callable that creates a class, and has the
    signature of an ExternalDependency
:system_class: If you pass DependencyMethods.SYSTEM in methods, you must
    set this argument.
N)
extra_kwargspkgconfig_namepkgconfig_class
cmake_namecmake_classconfigtool_classframework_nameframework_classbuiltin_classsystem_classc       
           [         R                  U;   a  U(       d  [        S5      eU=(       d    0 U l        X l        [         R
                  [        R                  " X=(       d    U5      [         R                  [        R                  " XT=(       d    U5      [         R                  [        R                  " Xv=(       d    U5      [         R                  [        R                  " X5      [         R                  [        R                  " X5      [         R                  S 0U l        Ub2  [        R                  " X5      U R                  [         R                  '   g g )Nz%A configtool must have a custom class)r   CONFIG_TOOLr   r   methodsEXTRAFRAMEWORK	functoolspartial	PKGCONFIGCMAKESYSTEMBUILTINclasses)selfnamer"   r   r   r   r   r   r   r   r   r   r   s                ڀ/mnt/mint/home/seanl/mnt/public/Repos/ladybird/Build/vcpkg/downloads/tools/meson-1.9.0-d1fcc2/mesonbuild/dependencies/factory.py__init__DependencyFactory.__init__F   s     ((G3<L%&MNN(.B ,,i.?.?Qgcg.h''):):?Lb^b)c##Y%6%6{DVRV%W$$i&7&7&K%%y'8'8'M))4	
 	 ':C:K:KL\:cDLL*667 (    c                p    U [         R                  L a#  UR                  U   R                  5       (       d  gg)a  Report whether a method is valid or not.

If the method is valid, return true, otherwise return false. This is
used in a list comprehension to filter methods that are not possible.

By default this only remove EXTRAFRAMEWORK dependencies for non-mac platforms.
FT)r   r#   machines	is_darwin)methodenvfor_machines      r-   _process_method!DependencyFactory._process_methodg   s1     '666LL-7799r0   c                *   [        U R                  U5      nU R                  R                  5       nUR	                  U5        U Vs/ s H@  nU R                  XaU5      (       d  M  [        R                  " U R                  U   X5      PMB     sn$ s  snf )zBReturn a list of Dependencies with the arguments already attached.)	r   r"   r   copyupdater7   r$   r%   r*   )r+   r5   r6   kwargsr"   nwargsms          r-   __call__DependencyFactory.__call__v   s     $DLL&9""'')fIP >A''< @	!!$,,q/3? > 	> >s   B%(B)r*   r   r"   )r,   strr"   zT.List[DependencyMethods]r   zT.Optional[T.Dict[str, T.Any]]r   T.Optional[str]r   z'T.Type[PkgConfigDependency]'r   rB   r   z7'T.Union[T.Type[CMakeDependency], CmakeDependencyFunc]'r   z*'T.Optional[T.Type[ConfigToolDependency]]'r   rB   r   z"'T.Type[ExtraFrameworkDependency]'r   z'T.Type[BuiltinDependency]'r   z'T.Type[SystemDependency]')r4   r   r5   'Environment'r6   r   returnboolr5   rC   r6   r   r<   zT.Dict[str, T.Any]rD   zT.List['DependencyGenerator'])__name__
__module____qualname____firstlineno____doc__r   r   r   r	   r
   r.   staticmethodr7   r?   __static_attributes__ r0   r-   r   r   /   s    , AE37BU/3XgPT37G_>O<Ld=d!0d #@d -	d
 Vd $Nd "1d #Ed !<d  :dB  >+>0M>r0   r   c                   ^  SU 4S jjnU$ )ar  Decorator for handling methods for dependency factory functions.

This helps to make factory functions self documenting
>>> @factory_methods([DependencyMethods.PKGCONFIG, DependencyMethods.CMAKE])
>>> def factory(env: Environment, for_machine: MachineChoice, kwargs: T.Dict[str, T.Any], methods: T.List[DependencyMethods]) -> T.List['DependencyGenerator']:
>>>     pass
c                N   >^  [         R                  " T 5      SU U4S jj5       nU$ )Nc           	     ,   > T" XU[        TU5      5      $ )Nr   )r5   r6   r<   funcr"   s      r-   wrapped/factory_methods.<locals>.inner.<locals>.wrapped   s    &2CGV2TUUr0   rF   )r$   wraps)rR   rS   r"   s   ` r-   innerfactory_methods.<locals>.inner   s'    			V 
	V r0   )rR   z'FactoryFunc'rD   z'WrappedFactoryFunc'rN   )r"   rV   s   ` r-   factory_methodsrX      s     Lr0   )r"   zT.Set[DependencyMethods]rD   z1T.Callable[['FactoryFunc'], 'WrappedFactoryFunc'])$
__future__r   r$   typingTbaser   r   r   r	   r
   cmaker   	frameworkr   	pkgconfigr   TYPE_CHECKINGr   
configtoolr   environmentr   mesonlibr   CallableDependencyGeneratorDictrA   AnyListFactoryFuncWrappedFactoryFuncCmakeDependencyFuncr   rX   rN   r0   r-   <module>rl      s  
 #   8 # 5 " / *??(0)(**R);%;<**FF3:FF$%		
 	
"#	$K FF3:	

 	
"#	$ **S/%9:O> O>dr0   