
    <h	f                       S SK Jr  S SKrS SKrS SKrS SK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  SSKJr  SS	KJrJrJrJrJrJrJrJr  SS
KJr  SSKJrJr  SSKJrJ r J!r!  SSK"J#r#J$r$J%r&  SSK'J(r(  SSK)J*r*J+r+J,r,J-r-  SSK.J/r/J0r0J1r1J2r2J3r3J4r4J5r5J6r6J7r7J8r8J9r9J:r:  SSKJ;r;  SSKJ<r<  SSK=J>r>J?r?  \R                  (       aj  S SKAJBrBJCrC  SSK	JDrD  SSKJErEJFrF  SSKJGrG  SSK"JHrH  SSKIJJrJ  SSKKJLrLJrM  SSKNJOrOJPrP   " S S\B5      rQ " S S\L5      rR " S  S!\M5      rS\R                  \?S"4   rUS#S$1rV\VR                  \5        \VS%S&1-  rV\- V s/ s H  o R                  S';  d  M  U PM     sn rY " S( S"\5      rZ\6" S)\[\*45      r\\6" S#\]S*S+9r^\6" S$\]S*S,S-9r_\6" S#\]\*45      r` " S. S/\(S"   5      ra " S0 S1\
5      rbS3S2 jrcgs  sn f )4    )annotationsN   )ExtensionModule
ModuleInfo   )mesonlib)mlog)UserFeatureOption)known_shmod_kwargsCustomTargetCustomTargetIndexBuildTargetGeneratedListStructuredSourcesExtractedObjectsSharedModule)NotFoundDependency)get_dep_identifierfind_external_dependency)BasicPythonExternalProgrampython_factory_PythonDependencyBase)extract_required_kwargpermitted_dependency_kwargs
primitives)_ExternalProgramHolder)NoneTypeDEPENDENCY_KWSPRESERVE_PATH_KWSHARED_MOD_KWS)	noPosargsnoKwargspermittedKwargsContainerTypeInfoInvalidArgumentstyped_pos_argstyped_kwargs	KwargInfo
FeatureNewFeatureNewKwargsdisablerIfNotFoundInterpreterObject)MachineChoice)	OptionKey)ExternalProgramNonExistingExternalProgram)	TypedDictNotRequired)ModuleState)BuildData)
Dependency)Interpreter)BuildTargetSource)ExtractRequiredr   )TYPE_varTYPE_kwargsc                  4    \ rS rSr% S\S'   S\S'   S\S'   Srg	)
PyInstallKw(   T.Optional[bool]purestrsubdirT.Optional[str]install_tag N__name__
__module____qualname____firstlineno____annotations____static_attributes__rE       z/mnt/mint/home/seanl/mnt/public/Repos/ladybird/Build/vcpkg/downloads/tools/meson-1.9.0-d1fcc2/mesonbuild/modules/python.pyr=   r=   (   s    $$rM   r=   c                  4    \ rS rSr% S\S'   S\S'   S\S'   Srg	)
FindInstallationKw.   booldisablerzT.List[str]modulesr?   r@   rE   NrF   rE   rM   rN   rP   rP   .   s    rM   rP   c                       \ rS rSr% S\S'   Srg)ExtensionModuleKw4   zNotRequired[T.Optional[str]]rB   rE   NrF   rE   rM   rN   rV   rV   4   s    ,,rM   rV   PythonExternalProgramrB   limited_apiname_prefixname_suffix>   rZ   r[   c                  J   ^  \ rS rSr% 0 rS\S'   SSU 4S jjjrS	S jrSrU =r	$ )
rX   B   zT.ClassVar[T.Dict[str, bool]]run_bytecompilec                   > [         TU ]  5       nU(       aW  U R                  US5      U l        U R                  US5      U l        U R
                  R                  U R                  S   S5        U$ )NplatlibpurelibversionF)supersanity	_get_pathr`   ra   r^   
setdefaultinfo)selfstateret	__class__s      rN   rd   PythonExternalProgram.sanityI   sZ    gn>>%;DL>>%;DL  ++DIIi,@%H
rM   c                Z   U R                   S   U   SS  nU(       d  U$ [        R                  " SUR                  SU S35      5      nU(       a2  UR	                  S5      (       a  [
        R                  " SU S35      eU$ UR                  S5      nUS:X  a  U R                   S	   (       a  S
OSnUS:X  a2  [        R                  R                  U R                   S   S   U5      nU$ US
:X  a<  U R                   S	   (       d  [
        R                  " S5      eU R                   S   U   nU$ )Ninstall_pathsr   rA   zpython.dirzpython.install_envz1dir and python.install_env are mutually exclusiveautois_venvvenvsystem	variablesprefixzDpython.install_env cannot be set to "venv" unless you are in a venv!sysconfig_paths)
rg   Tcast
get_optionis_user_defined_optionr   MesonExceptionospathjoin)rh   ri   keyrel_pathvalueinstall_envs         rN   re   PythonExternalProgram._get_pathQ   s   99_-c2126Oue..S/ABC++,@AA--u<m.nooL&&';<& $(IIi$8&hK("ww||DIIk$:8$DhOH  F"99Y'--.tuuyy!23C8HrM   )r`   ra   N)ri   T.Optional['ModuleState']returnrR   )ri   r   r   rA   r   rA   )
rG   rH   rI   rJ   r^   rK   rd   re   rL   __classcell__rk   s   @rN   rX   rX   B   s$    
 68O27  rM   r@    defaultz1.3.0r   sincec                    ^  \ rS rSrS/S jr\" \5      \" S\\\	R                  \\\\\\4S9\" S/\Q\P\P7SS06\R,                  " S5      S0S j5       5       5       5       rS1S	 jrS2S
 jr\\" \S1-  5      \" SSS/5      \\" S/\Q7SS06\R,                  " S5      S3S j5       5       5       5       5       5       r\" S\\	R                  4S9\" S\ \!\"\#" S\\$4SS95      \R,                  " S5          S4S j5       5       5       r%\\" S\ \!5      \R,                  " S5      S5S j5       5       5       r&S6S jr'\\(\R,                  " S5      S7S j5       5       5       r)\" S\5      \(\R,                  " S5      S8S j5       5       5       r*\" S \\+/S!9\(\R,                  " S"5      S9S# j5       5       5       r,\" S$\5      \(\R,                  " S%5      S8S& j5       5       5       r-\" S'\\+/S!9\(\R,                  " S(5      S9S) j5       5       5       r.\\(\/" S*S+5      \R,                  " S,5      S7U 4S- jj5       5       5       5       r0S.r1U =r2$ ):PythonInstallationp   c                   [         R                  " XU5        UR                  nU R                  R                  R
                  R                  R                  [        S5      5      n[        U[        5      (       d   S5       eUS   U l        US   U l        US   U l        US   U l        UR                  U l        [         R"                  R%                  XAR&                  5      U l        [         R"                  R%                  XAR*                  5      U l        US   U l        US   U l        US	   U l        US
   U l        g )Nru   for mypyrt   suffixlimited_api_suffixpathsrb   platformis_pypylink_libpython)r   __init__rg   interpreterenvironmentcoredataoptstoreget_value_forr.   
isinstancerA   rt   r   r   r   r@   r|   r}   r~   r`   platlib_install_pathra   purelib_install_pathrb   r   r   r   )rh   pythonr   rg   ru   s        rN   r   PythonInstallation.__init__q   s    ''kB{{!!--66??MMiX`Nab&#&&2
2&k*8n"&';"<']
KK	$&GGLL$H!$&GGLL$H!IZ(I"#34rM   zpython.extension_module)varargsallow_unknownTextension_modulec                d   SU;   a  US   b  [        S5      eO/UR                  S5      =(       d    SnU R                  SU5      US'   U R                  n[        R
                  " US5      n[        S U 5       S 5      nUc{  U R                  0 5      nUR                  5       (       d  [        R                  " S5      eUR                  U5        [        R                  " S	S
U R                  SU R                  5        UR                  S5      nU R                  R                   R"                  R$                  R'                  [)        S5      5      nUS:w  Ga=  U(       Ga5  U R*                  nU R-                  XvR.                  5      n	SU	 3n
[        R
                  " US5      nUR                  U
5        XS'   [        R
                  " US5      nUR                  U
5        XS'   US   nU R                  R                   R0                  U   R3                  5       (       a}  [4        R4                  " U5      nUR7                  U R8                  SS9  UR                  5       (       d  [        R                  " S5      eUR;                  U5        UR                  U5        U R                  R                   R"                  R<                  U   n[?        S URA                  5        5       5      (       a  UR.                  RC                  SS5      nSU S3nSU S3n[        R
                  " US5      nU R                  R                   R"                  R$                  RE                  S5      nU(       a  UR                  U5        OUR                  U5        UUS'   XRS'   URG                  SS5      u  nnUS   U-   US   4nSUS'   XBS'   US    S:X  a<  U RH                  (       d&  [        RJ                  " U R.                  S!5      (       a  S"US '   U R                  RM                  U R                  X[N        5      $ )#Ninstall_dirrB   z1"subdir" and "install_dir" are mutually exclusiver   Fdependenciesc              3  T   #    U  H  n[        U[        5      (       d  M  Uv   M      g 7fr   )r   r   ).0deps     rN   	<genexpr>=PythonInstallation.extension_module_method.<locals>.<genexpr>   s     XXcCAV1WccXs   (	(Python dependency not foundzGpython_installation.extension_module with implicit dependency on pythonz0.63.0z$use python_installation.dependency()rY   zpython.allow_limited_apiz-DPy_LIMITED_API=c_argscpp_argsnativeT)rY   z2Python dependency supporting limited API not foundc              3  F   #    U  H  oR                  5       S :H  v   M     g7f)msvcN)get_id)r   compilers     rN   r   r      s     R?Q8??$.?Qs   !.z/NODEFAULTLIB:pythonz_d.libz.lib	link_argsdebugr   r   rZ   r[   gnu_symbol_visibilityz>=3.9inlineshidden)(r%   pop_get_install_dir_implr   r   extract_as_listnext_dependency_method_implfoundr{   appendr)   
single_use
subprojectcurrent_noder   r   r   r   r   r.   r   &_convert_api_version_to_py_version_hexrb   machines
is_windowscopyfind_libpy_windowsenvremove	compilersanyvaluesreplace	get_valuersplitr   version_comparebuild_targetr   )rh   argskwargsrB   target_suffixnew_depspydeplimited_api_versionallow_limited_apilimited_api_version_hexlimited_api_definition
new_c_argsnew_cpp_argsfor_machine
pydep_copyr   pyver#python_windows_debug_link_exception%python_windows_release_link_exceptionnew_link_argsis_debugsplits                         rN   extension_module_method*PythonInstallation.extension_module_method   s   
 F"h+&'Z[[ , ZZ)/RF$($>$>uf$MF=!++FNCXXXZ^_=004E;;==--.KLLOOE"!!"k"*DOO=c"&"3"35 %jj7 ,,88AAJJXXYbc}Y~"$): 33M&*&Q&QRegtgt&u#'89P8Q%R"!11&(CJ45)8#33FJGL 67!-: !*K++44[ALLNN!YYu-
--dhhD-I!''))"112fgg&
+ ((44==GGTIRy?O?O?QRRR--c268LUGSY6Z3:NugUY8Z5 ( 8 8 M++77@@IISST[\!(()LM!(()NO&3{#!)~  -33C;}Q%a) "} -})*b0!9!9$,,!P!P.=F*+,,T->->l[[rM   c                   [         R                  " S5      nUR                  U5      nU(       d  [        SU S35      e[        R
                  " US5      (       a  [        SU S35      e[        R
                  " USU-   5      (       a  [        SU S	U S
35      eUR                  S5      n[        US   5      n[        US   5      nSR                  Xg5      $ )Nz[0-9]\.[0-9]{1,2}zPython API version invalid: "z".z<3.2z$Python Limited API version invalid: z (must be greater than 3.2)>z%Python Limited API version too high: z (detected )r   r   r   z0x{:02x}{:02x}0000)	recompile	fullmatchr%   r   r   r   intformat)rh   api_versiondetected_versionpython_api_version_formatdecimal_matchversion_componentsmajorminors           rN   r   9PythonInstallation._convert_api_version_to_py_version_hex   s    $&JJ/C$D!1;;KH"%B;-r#RSS##K88"%I+Vq#rss##K7G1GHH"%J;-Wbcsbttu#vww(..s3&q)*&q)*#**588rM   c                   U R                   R                  U5      n[        U R                  5       U5      nU R                   R                  R
                  U   R                  U5      nUb  U$ UR                  5       nSUS'   [        U R                   R                  X%U R                  5      n[        SU R                   R                  XV5      nU R                   R                  R
                  U   R                  X45        U$ )NFrequiredr   )r   machine_from_native_kwargr   
_full_pathr   depsgetr   r   r   held_objectr   put)rh   r   r   
identifierr   
new_kwargs
candidatess          rN   r   *PythonInstallation._dependency_method_impl   s    &&@@H'(96B
'',,[9==jI?J[[]
!&
:#D$4$4$@$@+[_[k[kl
&x1A1A1M1Mzf!!&&{377
H
rM   embedzpython_installation.dependencyz0.53.0
dependencyc                   [        X R                  5      u  p4nU(       ab  [        R                  " S[        R                  " S5      S[        R                  " U5      S5        [        SU R                  R                  5      $ U R                  U5      nU(       a+  UR                  5       (       d  [        R                  " S5      eU$ )Nr6   r   zskipped: featuredisabledr   )r   r   r	   logboldr   r   r   r   r   r   r{   )rh   r   r   r	  r   featurer   s          rN   dependency_method$PythonInstallation.dependency_method   s     '=V__&U#GHH\499X#68JDIIV]L^`jk%h0@0@0L0LMM..v6C		--.KLLJrM   install_dataz#python_installation.install_sourcesrD   z0.60.0)r   install_sourcesc           
     \   SU R                   R                  U R                  '   US   =(       d    SnUS   b  US   OU R                  nU R	                  XBS   5      nU R
                  R                  U R
                  R                  US   5      U[        R                  " 5       S USUS   S	9$ )
NTrD   python-runtimer@   rB   r   r   preserve_path)renametaginstall_data_typer  )
r   r^   rb   r@   r   r   install_data_implsource_strings_to_filesr   FileMode)rh   r   r   r  r@   r   s         rN   install_sources_method)PythonInstallation.install_sources_method  s     :>((6]#7'7!'!;vf~00h7GH1144T!W=# 1	 2 3 	3rM   zpython_installation.install_dirget_install_dirc                    SU R                   R                  U R                  '   US   b  US   OU R                  nU R	                  X2S   5      $ )NTr@   rB   )r   r^   rb   r@   r   )rh   r   r   r@   s       rN   get_install_dir_method)PythonInstallation.get_install_dir_method%  sL     :>((6!'!;vf~))$x0@AArM   c                    U(       a  U R                   nSnOU R                  nSn[        R                  " [        R
                  R                  X25      [        R
                  R                  XB5      5      $ )N{py_purelib}{py_platlib})r   r   P_OBJOptionStringr|   r}   r~   )rh   r@   rB   basenames        rN   r   (PythonInstallation._get_install_dir_impl-  sR    ,,D!D,,D!D!!"'',,t"<bggll4>XYYrM   language_versionc                    U R                   $ r   )rb   rh   r   r   s      rN   language_version_method*PythonInstallation.language_version_method7  s     ||rM   zpython_installation.has_pathhas_pathc                &    US   U R                   ;   $ Nr   )r   r*  s      rN   has_path_method"PythonInstallation.has_path_method=  s     Aw$**$$rM   zpython_installation.get_pathoptargsget_pathc                p    Uu  p4 U R                   U   $ ! [         a    Ub  Us $ [        U S35      ef = f)Nz is not a valid path name)r   KeyErrorr%   )rh   r   r   	path_namefallbacks        rN   get_path_method"PythonInstallation.get_path_methodC  sP     #		L::i(( 	L#"i[0I#JKK	L    55z python_installation.has_variablehas_variablec                &    US   U R                   ;   $ r/  )rt   r*  s      rN   has_variable_method&PythonInstallation.has_variable_methodO  s     Aw$..((rM   z python_installation.get_variableget_variablec                p    Uu  p4 U R                   U   $ ! [         a    Ub  Us $ [        U S35      ef = f)Nz is not a valid variable name)rt   r6  r%   )rh   r   r   var_namer8  s        rN   get_variable_method&PythonInstallation.get_variable_methodU  sP     "	O>>(++ 	O#"hZ/L#MNN	Or;  zPython module path methodz0.50.0r}   c                "   > [         TU ]  X5      $ r   )rc   path_method)rh   r   r   rk   s      rN   rF  PythonInstallation.path_methoda  s    
 w"400rM   )r   r   r   r   r   r   r@   r   r   rt   rb   )r   z'PythonExternalProgram'r   'Interpreter')r   z'T.Tuple[str, T.List[BuildTargetSource]]r   rV   r   z'SharedModule')r   rA   r   rA   r   rA   )r   r;   r   r6   )r   T.List['TYPE_var']r   'TYPE_kwargs'r   z'Dependency')r   z,T.Tuple[T.List[T.Union[str, mesonlib.File]]]r   'PyInstallKw'r   z'Data')r   rI  r   rK  r   rA   )r@   rR   rB   rA   r   zP_OBJ.OptionString)r   rI  r   rJ  r   rA   )r   zT.Tuple[str]r   rJ  r   rR   )r   z$T.Tuple[str, T.Optional['TYPE_var']]r   rJ  r   z
'TYPE_var')3rG   rH   rI   rJ   r   r#   
mod_kwargsr&   rA   r   Filer   r   r   r   r   r   r'   _MOD_KWARGS_DEFAULTABLE_SUBDIR_KW_LIMITED_API_KWr,   methodr   r   r   r+   r   r*   r!   r   r  _PURE_KW
_SUBDIR_KWr   r(   r   r  r  r   r"   r+  r0  objectr9  r>  rC  r)   rF  rL   r   r   s   @rN   r   r   p   s-   5" Z -sS(--Q]_pr  BS  Ue  gr  =s  t+wkw;QwSbwrvw01W\ 2 x t !W\r9   0G9<=67)L2X^XSWXl+	 , Y  M > 	 NS(--,@A--#xA /0
3'4
39?
3 1 B
3 3XzJ/0B 1 K B
Z 01 2   2C8j)% *  9% 2C&Jj)L *  KL 6<n-) .  =) 6fXNn-O .  OO +X6f%1 & 7  1rM   r   c                    ^  \ rS rSr\" SS5      rSU 4S jjrSS jrSS jr\	SS j5       r
SS	 jr\\" S
\/S9\" S
\" S\\4SS9\" S\SSS9\" S\" \\5      S/ SS9\R-                  SSS95          SS j5       5       5       rSrU =r$ )PythonModuleii  r   z0.46.0c                   > [         TU ]  U5        0 U l        U R                  R	                  SU R
                  05        g )Nfind_installation)rc   r   installationsmethodsupdaterX  )rh   r   rk   s     rN   r   PythonModule.__init__m  s:    %;=!7!7
 	rM   c                	   U R                   R                  n/ nU R                   R                  R                  R                  R                  [        S5      5      nUS:X  a  U$ [        [        R                  R                  5       5      (       d  U$ UR                  5       n/ nSSS jjnUR                   H  nU" UR                  5      (       d  M  UR                  UR                  [        R                   R#                  UR$                  UR&                  [        R                   R)                  UR*                  5      5      45        M     UR,                   Hk  nU" UR.                  5      (       d  M  UR                  UR.                  [        R                   R#                  UR$                  UR0                  5      45        Mm     UR2                   Hl  nU" UR.                  S5      (       d  M  UR                  UR.                  [        R                   R#                  UR$                  UR0                  5      45        Mn     SS Kn	[        R                   R#                  U R                   R                  R7                  5       S5      n
[9        U
S5       nUR;                  U	R<                  R?                  SS5      5        S S S 5        U R@                  R                  5        GH  n[C        U[        5      (       d  M  UR                  URD                  S	      (       d  M>  [F        RH                  " S
U5      nSURD                  S	    S3n/ nU H  u  pURK                  [        R                   R#                  UR$                  URL                  5      [        R                   R#                  UR$                  URN                  5      45      (       d  M  UR                  U5        M     [9        [        R                   R#                  U R                   R                  R7                  5       U5      SSS9 n[P        RR                  " X5        S S S 5        URT                  X[W        U5      /-   nURY                  USSURN                  URL                  S.S9nUR                  U5        GM     U$ ! , (       d  f       GN= f! , (       d  f       N{= f)Nzpython.bytecompilec                f    U R                  S5      =(       a    U R                  S5      =(       d    U$ )N)r"  r!  z.py)
startswithendswith)fisdirs     rN   should_append8PythonModule._get_install_scripts.<locals>.should_append  s)     << @AbqzzRWGXGa\abrM   Tr   zpycompile.pywbzmesonbuild.scriptsrb   rX   zpython-z-installed.jsonwzutf-8)encodingr  )
py_purelib
py_platlib)verboser  installdir_map)F)rc  rR   )-r   backendr   r   r   r   r.   r   rX   r^   r   create_install_datatargetsout_namer   r|   r}   r~   ru   outdirbasenamefnamedatainstall_path_nameinstall_pathinstall_subdirsimportlib.resourcesget_scratch_diropenwrite	resourcesread_binaryrY  r   rg   rw   rx   r`  r`   ra   jsondumpcommandrA   get_executable_serialisation)rh   rm  rj   optlevelinstalldatapy_filesrd  td	importlib	pycompilerb  imanifestmanifest_jsonr&  cmdscripts                     rN   _get_install_scripts!PythonModule._get_install_scriptst  s   ""**##//88AAOOPYZnPopr>J(88??ABBJ113	c
 $$AQZZ((RWW\\+:L:LahhXZX_X_XhXhijipipXq-r st % !!AQ0011!4!4bggll;CUCUWXWeWe6f gh " ,,AQ00$77!4!4bggll;CUCUWXWeWe6f gh - 	#GGLL!1!1!=!=!M!M!OQ_`	)T"aGGI''334H.YZ # ##**,A!2338I8I!&&QZJ[8\8\FF2A6$QVVI%6$7G "'GD||RWW\\+2D2Daii%PRTRYRYR^R^_j_q_qsts|s|R}$~%,,T2  ( "'',,t'7'7'C'C'S'S'UW_`bepwx|}IIm/ yii9H"FF ==c4Ue\]\e\euvu~u~M > A

6" - 
% #" yxs   ,R-3R?-
R<?
S	c                V    UR                   R                  U R                  5       5        g r   )install_scriptsextendr  )rh   bs     rN   postconf_hookPythonModule.postconf_hook  s    	  !:!:!<=rM   c                `   U R                  S5      (       d  g [        R                  " S5      (       d  g SU SS   3nSUSS/n[        R                  " U5      u  p4nUR                  5       n[        R                  R                  U5      (       a   [        R                  R                  US5      $ g )N)python2python3py-   -cz;import sysconfig; print(sysconfig.get_config_var('BINDIR'))r   )
r`  shutilwhichr   
Popen_safestripr|   r}   existsr~   )name_or_pathverr  _stdout	directorys         rN   _get_win_pythonpath PythonModule._get_win_pythonpath  s    &&'=>>||D!!,qr"#$S$ ]^**3/1LLN	77>>)$$77<<	844rM   r   c                   U(       d  [        S[        R                  5      nO[        R                  " X#5      n[        X&S9nUR                  5       (       d;  [        R                  " 5       (       a!  U R                  U5      nUb  Un[        U5      nUR                  5       (       d&  US;   a   [        R                  " US5      n[        X6S9nUR                  5       (       aX  UR                  U5      (       a  U$ U S3nU(       a  [        R                  " U5      e[        R                  " XR                  S9  [        UR                  5      $ )Nr  )ext_prog>   r  r  r   z1 is not a valid python or it is missing distutils)location)rX   r   python_commandr/   
from_entryr   r   r  rd   r{   r	   warningr   r0   r&  )	rh   ri   display_namer  r   r   
tmp_python
pythonpath	sanitymsgs	            rN   _find_installation_impl$PythonModule._find_installation_impl  s   *9h6M6MNF(33LOJ*<MF<<>>h&9&9&;&;!55lC
)#-L2<@F <<>>l6L&L,77hO
.|Q<<>>}}U##%h&WX	"11)<<LL5G5GH)&++66rM   zpython.find_installationr2  Tr   rS   Fz0.49.0r   rT   z0.51.0)listifyr   r   z0.64.0c           
        [        SS5      n[        X1R                  U5      u  pVnUR                  R	                  [
        R                  S5      =(       d    / nUS   n	U	=(       d    Sn
U(       d  U	b  U	/nU(       a  US   OS nU(       aW  [        R                  " SU=(       d    SS[        R                  " S5      S[        R                  " U5      S	5        [        5       $ U R                  R                  U5      nU(       d   U R                  XX5      nXR                  U'   US
   n/ n/ nUR                  5       (       an  U(       ag  U Ha  n[         R"                  " UR$                  SSU 3/-   5      tnnUR&                  S:w  a  UR)                  U5        MP  UR)                  U5        Mc     SUR*                  /nU(       a/  UR)                  SR-                  SR/                  U5      5      5        UR)                  S5        UR                  5       (       aW  U(       dP  UR1                  [        R2                  " S5      SR-                  SR/                  UR$                  5      5      /5        O%UR)                  [        R                  " S5      5        U(       a1  UR)                  S5        UR)                  SR/                  U5      5        [        R                  " U6   UR                  5       (       dJ  U(       a.  [         R4                  " SR-                  U=(       d    S5      5      e[        UR*                  5      $ U(       aZ  U(       a>  [         R4                  " SR-                  U=(       d    SSR/                  U5      5      5      e[        UR*                  5      $ [7        U[8        5      (       d   S5       e[:        R:                  " U5      nUS   Ul        U$ )Nz-Passing "feature" option to find_installationz0.48.0r   r   Programzfound:NOz(disabled by:r   rT   r  zimport z({})z, YES zmodules:z{} not foundz{} is missing modules: {}r   r@   ) r)   r   r   r   lookup_binary_entryr-   HOSTr	   r
  redr  r0   rY  r   r  r   r   r  r  
returncoder   r&  r   r~   r  greenr{   r   rX   r   r@   MesonBugException)rh   ri   r   r   feature_checkr	  r   r  npr8  r  r  r   want_modulesfound_modulesmissing_modulesmodpr  msgs                       rN   rX  PythonModule.find_installation  s    ##RT\]&<VEUEUWd&e#G  ++??@R@RT\]cac7+8h*B "r!uHHY 8(DHHTNTceienenovewy|}-//##''511%|^F/5|,i(%'')<<>>l# ++NNWSE?+,-A <<1$#**3/!((- $ ,5fkk*BJJv}}TYY|%<=>

8<<>>/JJ

5)6==&..9Q+RSTJJtxx~&JJz"JJtyy/0#||~~--n.C.CLD\T\.]^^-fkk::--.I.P.PQ]Qiaikoktkt  vE  lF  /G  H  H-fkk::f&;<<HjH<YYv&F .FKMrM   )rY  )r   rH  r   None)r   z(T.List[mesonlib.ExecutableSerialisation])r  r4   r   r  )r  rA   r   rC   )
ri   'ModuleState'r  rA   r  rA   r   rR   r   MaybePythonProg)ri   r  r   zT.Tuple[T.Optional[str]]r   z'FindInstallationKw'r   r  )rG   rH   rI   rJ   r   INFOr   r  r  staticmethodr  r  r+   r&   rA   r'   r(   rR   r
   r$   listrR  evolverX  rL   r   r   s   @rN   rV  rV  i  s    h)D/b>  7B .>"*t%67F*dEB).tS94QS[cdH5Dk"6Dk;JDk ? DkrM   rV  c                d    [        U 5      nUR                  R                  [        [        5        U$ r   )rV  r   append_holder_maprX   r   )r   r  s     rN   
initializer  *  s'    
{
#COO%%&;=OPJrM   )r   rH  r   rV  )d
__future__r   r   r~  r|   r  r   typingrw   r   r   r   r   r	   optionsr
   buildr   r   r   r   r   r   r   r   r   r   dependencies.detectr   r   dependencies.pythonr   r   r   r   r   r   r   r#  interpreter.interpreterobjectsr   interpreter.type_checkingr   r   r   r    interpreterbaser!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   programsr/   r0   TYPE_CHECKINGtyping_extensionsr1   r2   r3   r4   r5   r6   r7   interpreter.interpreterr8   interpreter.kwargsr9   SharedModuleKwinterpreterbase.baseobjectsr:   r;   r=   rP   rV   Unionr  rL  r[  r&  rN  rX   rR   rR  rA   rS  rP  rO  r   rV  r  )ks   0rN   <module>r     s   # ! ! !  )   ' W  W  W - N c c b b C b b   
 %  B??8#));TC%i %_ -N - gg8:QQRO &
 
  $ % 
}m, ,
(Y.QFF:X,Xq.Y&6 &R VdH-.xb1
M3'J"8c8_= v1/0GH v1r~k? ~kBW Zs   F=#F=