ó
    ¯i€Å  ã                   ó"  • S 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rSSK	r	SSK
Jr  SSK
Jr  SSKJrJr  SSKJr  \R&                  (       a	  SSKJs  Jr  \R.                  " \5      rSr\R6                  (       a  \R8                  " \R:                  5      rS rS rSS	 jr SS
 jr!S r"S r#S r$SS jr%\%r&\%r'SS jr(S r)S r*S r+S r,S r-\R\                  (       a  S r/g\R6                  (       a  S r/g\R&                  (       a  S r/gS r/g)z1
Find external dependencies of binary libraries.
é    N)Úcompat)Úlog)ÚdylibÚutils)Úwinutilsc                  ó  • SSK n U R                  5       nUR                  U R                  5       5        [        R
                  " [        R                  5      [        R
                  " [        R                  5      R                  5       [        R
                  " [        R                  5      [        R
                  " [        R                  5      R                  5       1nX Vs/ s H'  n[        R
                  " U5      R                  5       PM)     sn-  n[        5       nU HQ  nU(       d  M  [        R
                  " U5      nUR                  5       (       d  M9  X2;   a  M@  UR                  U5        MS     [        US SS9nU$ s  snf )aw  
Return list of paths that serve as prefixes for parent-directory preservation of collected binaries and/or
shared libraries. If a binary is collected from a location that starts with a path from this list, the relative
directory structure is preserved within the frozen application bundle; otherwise, the binary is collected to the
frozen application's top-level directory.
r   Nc                 ó,   • [        U R                  5      $ ©N)ÚlenÚparents)Úxs    ÚIC:\des-py\RoboSAPF\venv\Lib\site-packages\PyInstaller\depend\bindepend.pyÚ<lambda>Ú>_get_paths_for_parent_directory_preservation.<locals>.<lambda>^   s   € ¬¨A¯I©I¬ó    T)ÚkeyÚreverse)ÚsiteÚgetsitepackagesÚappendÚgetusersitepackagesÚpathlibÚPathÚsysÚbase_prefixÚresolveÚprefixÚsetÚis_dirÚaddÚsorted)r   Ú
orig_pathsÚexcluded_pathsÚpathÚpathss        r   Ú,_get_paths_for_parent_directory_preservationr&   )   s  € ó$ à×%Ñ%Ó'€JØ×Ñ�d×.Ñ.Ó0Ô1ô 	�Š”S—_‘_Ó%Ü�Š”S—_‘_Ó%×-Ñ-Ó/Ü�Š”S—Z‘ZÓ Ü�Š”S—Z‘ZÓ ×(Ñ(Ó*ð	€Nð ¸JÓGºJ°D”7—<’< Ó%×-Ñ-Ö/¹JÑGÑG€Jä‹E€EÛˆÞÙÜ�|Š|˜DÓ!ˆà�{‰{�}‰}ÙàÓ!ÙØ�	‰	�$Žñ ô �5Ñ6ÀÑE€Eà€Lùò' Hs   Ã".Fc                 óp   • U H%  nX R                   ;   d  M  U R                  U5      s  $    U R                  $ r
   )r   Úrelative_toÚname)Úsrc_filenameÚparent_dir_preservation_pathsÚparent_dir_preservation_paths      r   Ú_select_destination_directoryr-   c   s:   € ã(EÐ$Ø'×+?Ñ+?Õ?à×+Ñ+Ð,HÓIÒIñ )Fð ×ÑÐr   c           
      óê
  ^^• [        5       n[        5       n[        5       n/ nU SS nU GHû  u  p‰n
U
S:X  a  M  [        R                  " U	5      nX´;   a  M,  UR	                  U5        [
        R                  SU	5        [        X‘5       GH˜  u  nm[
        R                  SUT5        T(       d  UR                  XÉ45        M9  [        R                  " T5      (       d  [
        R                  ST5        Ml  [        R                  " T5      mTU;   a!  [
        R                  S[        T5      5        M©  UR	                  T5        [        TU5      n[        R                  " U5      n[        R                  (       aŽ  UR                   [        R                  " S5      :X  aj  ["        R$                  " T5      (       aO  TR                   R                   R                   R                   n[        R                  " TR'                  U5      5      n[
        R                  S[        T5      [        U5      5        UR                  [        U5      [        T5      S	45        [        R(                  (       a  GMæ  UR                   [        R                  " S5      :X  a  GM  [+        U4S
 jU 5       5      (       a"  [
        R                  S[        U5      5        GMI  [
        R                  S[        U5      5        UR                  [        UR,                  5      [        U5      S45        GM›     GMþ     U VV	V
s0 s HL  u  p‰oªS:w  d  M  [.        R0                  R3                  [.        R0                  R5                  U	5      5      X‰U
4_MN     nn	nn
[        U VV	V
s/ s H  u  p‰oªS:X  d  M  UPM     sn
n	n5      nU GH­  u  nn[        R                  " U5      (       d  M$  [.        R0                  R3                  [.        R0                  R5                  U5      5      nUR7                  US5      nUc6  [        R8                  " U5      (       d  M’  [
        R;                  SUU5        M«  [        R(                  (       a  MÂ  [        R                  " US   5      n[        R                  " US   5      mUR                   [        R                  " S5      :X  a  GM  UU;   a  GM$  [+        U4S jU 5       5      (       a"  [
        R=                  S[        U5      5        GM`  [
        R=                  S[        U5      5        UR                  U[        U5      S45        UR	                  U5        GM°     U$ s  sn
n	nf s  sn
n	nf )af  
Perform binary dependency analysis on the given TOC list of collected binaries, by recursively scanning each binary
for linked dependencies (shared library imports). Returns new TOC list that contains both original entries and their
binary dependencies.

Additional search paths for dependencies' full path resolution may be supplied via optional argument.
NÚSYMLINKzAnalyzing binary %rz2Processing dependency, name: %r, resolved path: %rz5Skipping dependency %r due to global exclusion rules.z/Skipping dependency %r due to prior processing.Ú.zCollecting dependency %r as %r.ÚBINARYc              3   óF   >#   • U  H  nTR                  U5      v •  M     g 7fr
   ©Úmatch)Ú.0ÚpatternÚdep_src_paths     €r   Ú	<genexpr>Ú-binary_dependency_analysis.<locals>.<genexpr>É   s!   øé € Ð]Ò@\°W�\×'Ñ'¨×0Ð0Ò@\ùó   ƒ!z‡Skipping symbolic link from %r to top-level application directory due to source path matching one of symlink suppression path patterns.z@Adding symbolic link from %r to top-level application directory.z:Library not found: could not resolve %r, dependency of %r.r   é   c              3   óF   >#   • U  H  nTR                  U5      v •  M     g 7fr
   r3   )r5   r6   Údependency_src_paths     €r   r8   r9      s"   øé € ÐbÒEa¸'Ð&×,Ñ,¨W×5Ð5ÒEaùr:   z¤Missing dependency handling: skipping symbolic link from %r to top-level application directory due to source path matching one of symlink suppression path patterns.z]Missing dependency handling: adding symbolic link from %r to top-level application directory.)r&   r   r   r   r    ÚloggerÚdebugÚget_importsr   r   Úinclude_libraryÚstrr-   ÚPurePathr   Ú	is_darwinÚparentÚosxutilsÚis_framework_bundle_libr(   Úis_winÚanyr)   Úosr$   ÚnormcaseÚbasenameÚgetÚwarn_missing_libÚwarningÚinfo)ÚbinariesÚsearch_pathsÚsymlink_suppression_patternsr+   Úprocessed_binariesÚprocessed_dependenciesÚmissing_dependenciesÚ
output_tocÚ	dest_nameÚsrc_nameÚtypecodeÚsrc_pathÚdep_nameÚdep_dest_pathÚframework_parent_pathÚseen_binariesÚexisting_symlinksÚdependency_nameÚreferring_binaryÚdependency_basenameÚdependency_toc_entryÚdependency_dest_pathr7   r=   s                         @@r   Úbinary_dependency_analysisrf   n   s‚  ù€ ô %QÓ$RÐ!ô ›ÐÜ ›UÐð
 Ðð ™!�€JÜ)3Ñ%ˆ	˜Xà�yÓ Ùô —<’< Ó)ˆØÓ)ÙØ×Ñ˜xÔ(ä�‰Ð*¨HÔ5ô '2°(×&IÑ"ˆH�lÜ�L‰LÐMÈxÐYeÔfö  Ø$×+Ñ+¨XÐ,@ÔAÙô ×(Ò(¨×6Ñ6Ü—‘ÐTÐVbÔcÙä"Ÿ<š<¨Ó5ˆLð Ð5Ó5Ü—‘ÐNÔPSÐT`ÓPaÔbÙØ"×&Ñ& |Ô4ô
 :¸,ÐHeÓfˆMÜ#×,Ò,¨]Ó;ˆMô
 ×× M×$8Ñ$8¼G×<LÒ<LÈSÓ<QÓ$QÜ×3Ò3°L×AÑAà,8×,?Ñ,?×,FÑ,F×,MÑ,M×,TÑ,TÐ)Ü$+×$4Ò$4°\×5MÑ5MÐNcÓ5dÓ$e�Mä�L‰LÐ:¼CÀÓ<MÌsÐS`ÓOaÔbØ×Ñœs =Ó1´3°|Ó3DÀhÐOÔPô �}�}âØ×%Ñ%¬×)9Ò)9¸#Ó)>Ó>âÜÔ]Ñ@\Ó]×]Ñ]ä—‘ð<Ü=@ÀÓ=O÷ô
 —‘Ð_ÔadÐerÓasÔtØ×!Ñ!¤3 }×'9Ñ'9Ó#:¼CÀÓ<NÐPYÐ"Z×[ôw 'Jñ *4ñ^ .8õâ-7Ñ)ˆI ÀyÑ;Pó 	VŒ�‰×ÑœŸ™×)Ñ)¨(Ó3Ó4°yÈHÐ6UÒUÙ-7ð ò ô ÉJÕpÊJÑ+H¨9ÀÐfoÑZoŸYÉJÓpÓqÐä-AÑ)ˆÐ)ä×$Ò$ _×5Ñ5Ùô !Ÿg™g×.Ñ.¬r¯w©w×/?Ñ/?ÀÓ/PÓQÐØ,×0Ñ0Ð1DÀdÓKÐØÑ'ä×)Ò)¨/×:Ñ:ÙÜ�N‰NØLÈoÐ_oöô ——‘ä#*×#3Ò#3Ð4HÈÑ4KÓ#LÐ Ü")§,¢,Ð/CÀAÑ/FÓ"GÐà#×*Ñ*¬g×.>Ò.>¸sÓ.CÓCâØ$Ð(9Ó9âô ÔbÑEaÓb×bÑbÜ—‘ð\Ü]`ÐauÓ]vôò ô �K‰KØoÜÐ(Ó)ôð ×ÑÐ2´CÐ8LÓ4MÈyÐYÔZØ×!Ñ!Ð"5×6ñg .Bðj Ðùôwùô qs   Ì0U'Í AU'ÎU.Î"U.c                 óö   • [         R                  (       a:  [        U 5      R                  5       R	                  S5      (       a  / $ [        X5      $ [         R                  (       a  [        X5      $ [        X5      $ )a  
Analyze the given binary file (shared library or executable), and obtain the list of shared libraries it imports
(i.e., link-time dependencies).

Returns set of tuples (name, fullpath). The name component is the referenced name, and on macOS, may not be just
a base name. If the library's full path cannot be resolved, fullpath element is None.

Additional list of search paths may be specified via `search_paths`, to be used as a fall-back when the
platform-specific resolution mechanism fails to resolve a library fullpath.
z	.manifest)	r   rH   rB   ÚlowerÚendswithÚ_get_imports_pefilerD   Ú_get_imports_macholibÚ_get_imports_ldd)ÚfilenamerR   s     r   r@   r@     sX   € ô ‡}‡}Üˆx‹=×ÑÓ ×)Ñ)¨+×6Ñ6ØˆIÜ" 8Ó:Ð:Ü	×	×	Ü$ XÓ<Ð<ä Ó7Ð7r   c                 óÈ  • SSK n[        5       nUR                  U SS9nUR                  UR                  S   UR                  S   /SSS9  [        US/ 5       H/  nUR                  R                  S	5      nUR                  U5        M1     [        US
S5      nU(       ae  UR                   HU  nUR                  c  M  UR                  R                  S	5      n	U	R                  S5      S   n
UR                  U
S-   5        MW     UR                  5         [        R                  R                  U 5      /U=(       d    / -   nU Vs1 s H  o»[!        X±5      4iM     nnU$ s  snf )zg
Windows-specific helper for `get_imports`, which uses the `pefile` library to walk through PE header.
r   NT©Ú	fast_loadÚIMAGE_DIRECTORY_ENTRY_IMPORTÚIMAGE_DIRECTORY_ENTRY_EXPORT)ÚdirectoriesÚforwarded_exports_onlyÚimport_dllnames_onlyÚDIRECTORY_ENTRY_IMPORTúutf-8ÚDIRECTORY_ENTRY_EXPORTr0   z.dll)Úpefiler   ÚPEÚparse_data_directoriesÚDIRECTORY_ENTRYÚgetattrÚdllÚdecoder    ÚsymbolsÚ	forwarderÚsplitÚcloserJ   r$   ÚdirnameÚresolve_library_path)rm   rR   ry   ÚoutputÚpeÚentryÚdll_strÚexported_symbolsÚsymbolr�   r~   Úlibs               r   rj   rj   *  sT  € ó ä‹U€Fð 
�‰�8 tˆÐ	,€BØ×Ñà×"Ñ"Ð#AÑBØ×"Ñ"Ð#AÑBð
ð  $Ø!ð ñ ô ˜Ð5°rÖ:ˆØ—)‘)×"Ñ" 7Ó+ˆØ�
‰
�7Öñ ;ô ˜rÐ#;¸TÓBÐÞØ&×.Ô.ˆFØ×ÑÓ+à"×,Ñ,×3Ñ3°GÓ<�	à—o‘o cÓ*¨1Ñ-�Ø—
‘
˜3 ™<Ö(ñ /ð ‡H�H„Jô —G‘G—O‘O HÓ-Ð.°,×2DÀ"ÑE€LÙHNÓOÊÀÔ(¨Ó;Ó<É€FÐOà€Mùò Ps   ÅEc                 ór	  • [        5       n[        R                  (       a  [        R                  " S5      nOš[        R
                  (       a  [        R                  " S5      nOn[        R                  (       a  [        R                  " S5      nOB[        R                  (       a  [        R                  " S5      nO[        R                  " S5      n[        R                  " S[        R                  R                  U 5      /[        R                  [        R                  [        R                  SS9n/ nUR                  R!                  5        Hk  nU(       d  M  UR#                  S5      (       a  UR%                  S	5      (       a  M:  UR#                  S
5      (       a  MR  SU;   a  MZ  UR'                  U5        Mm     U(       a&  [(        R+                  SU SR-                  U5      5        UR.                  R!                  5        GH®  nSnSnUR1                  U5      n	U	(       GaÓ  [        R                  (       a~  U	R3                  S5      n
U
(       a5  U
n[        R                  R5                  U5      U	R3                  S5      -   nGOU	R3                  S5      n[        R                  R5                  U5      nOÑ[        R
                  (       a"  U	R3                  S5      U	R3                  S5      p‡OšU	R3                  S5      U	R3                  S5      p‡U=(       d    [        R                  R5                  U5      n[        R                  (       a<  [        R6                  " S[        R                  R5                  U5      5      (       a  GM…  USS S;   a  GM‘  [        R8                  (       a'  UR;                  5       R#                  S5      (       a  GMÍ  [        R                  R=                  U5      (       d  SnORUR%                  S5      (       a9  UR?                  S5      n[A        U5      S:w  a  GM-  US   RC                  5       nSnOGMF  U(       d)  [E        [        R                  R5                  U5      U5      nU(       a  [        R                  RG                  U5      nURI                  Xx45        GM±     U$ )z‘
Helper for `get_imports`, which uses `ldd` to analyze shared libraries. Used on Linux and other POSIX-like platforms
(with exception of macOS).
zR^\s*(((?P<libarchive>(.*\.a))(?P<objectmember>\(.*\)))|((?P<libshared>(.*\.so))))$z^\s+(.*)\s+=>\s+(.*)$z$^\s*(?:(.*?)\s+=>\s+)?(.*?)\s+\(.*\)z\s*(.*?)\s+=>\s+(.*?)\s+\(.*\)Úlddrw   )ÚstdinÚstderrÚstdoutÚencodingzError relocating z symbol not foundz7ldd: warning: you do not have execution permission for znot a dynamic executablezldd warnings for %r:
%sÚ
NÚ
libarchiveÚobjectmemberÚ	libsharedr;   é   z'ld(64)?(-linux|-musl)?(-.+)?\.so(\..+)?é
   )z
linux-gatez
linux-vdsoz/cygdrive/c/windows/systemz	not foundz=>r   )%r   r   Úis_aixÚreÚcompileÚis_hpuxÚis_solarÚis_linuxÚ
subprocessÚrunrJ   r$   ÚrealpathÚDEVNULLÚPIPEr�   Ú
splitlinesÚ
startswithri   r   r>   rO   Újoinr‘   ÚsearchÚgrouprL   Ú	fullmatchÚ	is_cygwinrh   Úexistsr‚   r   ÚstripÚ%_resolve_library_path_in_search_pathsÚnormpathr    )rm   rR   r†   ÚLDD_PATTERNÚpÚldd_warningsÚliner)   rŒ   Úmr”   Útokenss               r   rl   rl   Y  s[  € ô ‹U€Fô ‡}‡}ô —j’jÐ!vÓw‰Ü	��ô
 —j’jÐ!9Ó:‰Ü	��ô —j’jÐ!9Ó:‰Ü	��ô
 —j’jÐ!HÓI‰ä—j’jÐ!BÓCˆô 	�ŠØ	”—‘× Ñ  Ó*Ð+Ü× Ñ Ü�‰Ü�‰Øñ	€Að €LØ—‘×#Ñ#Ö%ˆÞÙð �_‰_Ð0×1Ñ1°d·m±mÐDW×6XÑ6XÙð �_‰_ÐV×WÑWÙð (¨4Ó/Ùà×Ñ˜DÖ!ñ% &ö& Ü�‰Ð1°8¸T¿Y¹YÀ|Ó=TÔUà—‘×#Ñ#×%ˆØˆØˆà×Ñ˜tÓ$ˆßÜ�}�}ØŸW™W \Ó2�
Þð %�CÜŸ7™7×+Ñ+¨CÓ0°1·7±7¸>Ó3JÑJ’Dð Ÿ'™' +Ó.�CÜŸ7™7×+Ñ+¨CÓ0‘DÜ——ØŸG™G A›J¨¯©°«
‘càŸG™G A›J¨¯©°«
�cØ×4œrŸw™w×/Ñ/°Ó4�Ü—?—?ô —|’|Ð$NÔPR×PWÑPW×P`ÑP`ÐadÓPe×fÑfÚ Ø�C�RˆyÐ8Ó8ò ä××à—9‘9“;×)Ñ)Ð*F×GÑGÚô —7‘7—>‘> #×&Ñ&Ø�øØ�]‰]˜;×'Ñ'à—Z‘Z Ó%ˆFÜ�6‹{˜aÓÚØ˜!‘9—?‘?Ó$ˆDØ‰Cò ö Ü7Ü—‘× Ñ  Ó&ØóˆCö Ü—'‘'×"Ñ" 3Ó'ˆCð 	�
‰
�D�;×ñC &ðF €Mr   c                 ót  ^ ^^^^^^^• SSK Jm  SSKJm  SSKJm   SSK Jm  [        5       n[        R                  R                  [        R                  R                  T 5      5      n[        R                  R                  [        R                  5      n[        R                  R                  U5      nS mUU 4S jm[        R                   UUU4S	 j5       n[        R                   UU4S
 j5       nU" T 5      u  p‰X—" U5      -  n	U	R#                  [        R                  R%                  [&        R(                  S5      5        [+        [,        R/                  U	5      5      n	UU4S jmU4S jn
U GH¯  nSnUR1                  S5      (       Ga  [        R                  R$                  " UR3                  [        R4                  5      SS 6 nU	 H¾  n[        R                  R%                  Xí5      nUR1                  S5      (       a
  U
" XóU5      nOK[        R                  R7                  U5      (       d  [        R                  R%                  X?5        T" U5      nU(       d  M–  [        R                  R9                  U5      (       d  M¼  Un  O+   O(UR1                  S5      (       a
  U
" X³U5      nOT" U5      nU(       d)  [;        [        R                  R=                  U5      U5      nU(       a  [        R                  R?                  U5      nURA                  X¼45        GM²     U$ ! [         a    Sm GNf = f)zt
macOS-specific helper for `get_imports`, which uses `macholib` to analyze library load commands in Mach-O headers.
r   )Ú	dyld_find)ÚLC_RPATH)ÚMachO)Ú _dyld_shared_cache_contains_pathNc                 ó–   • [        5       nU R                   H.  nUR                  5        H  u  p4nUR                  U5        M     M0     U$ r
   )r   ÚheadersÚwalkRelocatablesr    )r³   Úreferenced_libsÚheaderÚidxr)   rŒ   s         r   Ú_get_referenced_libsÚ3_get_imports_macholib.<locals>._get_referenced_libsü  sD   € ä›%ˆØ—i”iˆFØ"(×"9Ñ"9Ö";‘�˜3Ø×#Ñ# CÖ(ó #<ñ  ð Ðr   c                 ó|  >• / nU R                    H¨  nUR                   H•  nUS   R                  nUT:X  d  M  US   R                  S5      nUR	                  S5      nUR                  S5      (       a/  UR                  S5      (       d  [        R                  SUT5        M„  UR                  U5        M—     Mª     U$ )Nr   r—   rw   Ú Ú@©z@executable_pathz@loader_pathz<Unsupported rpath format %r found in binary %r - ignoring...)	r»   ÚcommandsÚcmdr   Úrstripr¥   r>   rO   r   )r³   Ú	run_pathsr¾   ÚcommandÚcmd_typeÚrpathr·   rm   s         €€r   Ú_get_run_pathsÚ-_get_imports_macholib.<locals>._get_run_paths  s¯   ø€ ð ˆ	Ø—i”iˆFØ!Ÿ?œ?�ð
 # 1™:Ÿ>™>�Ø˜xÕ'Ø# A™J×-Ñ-¨gÓ6�Eà!ŸL™L¨Ó0�Eð ×'Ñ'¨×,Ñ,°U×5EÑ5EÐFj×5kÑ5kÜŸ™Ð'eÐglÐnvÔwÙ Ø×$Ñ$ UÖ+ó +ñ  ð" Ðr   c                 ó4   >• T" U 5      nT" U5      T" U5      4$ r
   © )rm   r³   r¸   rÀ   rÍ   s     €€€r   Ú!get_run_paths_and_referenced_libsÚ@_get_imports_macholib.<locals>.get_run_paths_and_referenced_libs  s#   ø€ ñ �(‹OˆÙ# AÓ&©°qÓ(9Ð9Ð9r   c                 ó    >• T" T" U 5      5      $ r
   rÐ   )rm   r¸   rÍ   s    €€r   Úget_run_pathsÚ,_get_imports_macholib.<locals>.get_run_paths!  s   ø€ ñ ™e H›oÓ.Ð.r   rŒ   c                 óð   >• [         R                  R                  U 5      (       a9  Tb  T" U 5      (       a  U $ [         R                  R                  U 5      (       a  U $ g  T" U 5      $ ! [         a     g f = fr
   )rJ   r$   ÚisabsÚisfileÚ
ValueError)rŒ   r¹   r¶   s    €€r   Ú_resolve_using_pathÚ2_get_imports_macholib.<locals>._resolve_using_path=  sk   ø€ ô �7‰7�=‰=˜×ÑØ/Ñ;Ñ@`Ðad×@eÑ@eØ�
Ü�w‰w�~‰~˜c×"Ñ"Ø�
Øð	Ù˜S“>Ð!øÜó 	Ùð	ús   Á A( Á(
A5Á4A5c                 ó4  >• U R                  S5      (       a  U [        S5      S  n O$U R                  S5      (       a  U [        S5      S  n T" [        R                  R	                  X5      5      nUb  U$ T" [        R                  R	                  X 5      5      $ )Nz@loader_path/z@executable_path/)r¥   r   rJ   r$   r¦   )rŒ   Úbin_pathÚpython_bin_pathÚresolved_librÚ   s       €r   Ú_resolve_using_loader_pathÚ9_get_imports_macholib.<locals>._resolve_using_loader_pathO  sˆ   ø€ ð �>‰>˜/×*Ñ*Ø”c˜/Ó*Ð+Ð,‰CØ�^‰^Ð/×0Ñ0Ø”cÐ-Ó.Ð/Ð0ˆCñ +¬2¯7©7¯<©<¸Ó+FÓGˆØÑ#ØÐñ #¤2§7¡7§<¡<°Ó#EÓFÐFr   z@rpathr;   rÅ   )!Úmacholib.dyldr¶   Úmacholib.mach_or·   Úmacholib.MachOr¸   r¹   ÚImportErrorr   rJ   r$   r„   r¡   r   Ú
executableÚ	functoolsÚ	lru_cacher   r¦   r   r   ÚlistÚdictÚfromkeysr¥   r‚   Úsepr×   r«   r­   rL   r®   r    )rm   rR   r†   rÝ   Ú
python_binrÞ   rÑ   rÔ   r½   rÉ   rà   Úreferenced_librß   rŒ   Úrun_pathÚlib_pathr·   r¸   r¹   rÀ   rÍ   rÚ   r¶   s   `               @@@@@@@r   rk   rk   æ  s€  ÿ€ õ (Ý(Ý$ð0ÝBô ‹U€Fô
 �w‰w�‰œrŸw™w×/Ñ/°Ó9Ó:€HÜ—‘×!Ñ!¤#§.¡.Ó1€JÜ—g‘g—o‘o jÓ1€Oòöô. ×Ñö:ó ð:ô
 ×Ñõ/ó ð/ñ
 "CÀ8Ó!LÑ€Oð �˜zÓ*Ñ*€Ið ×Ñ”R—W‘W—\‘\¤&×"4Ñ"4°eÓ<Ô=ô ”T—]‘] 9Ó-Ó.€Iöõ$Gô6 *ˆØˆð ×$Ñ$ X×.Ò.Ü—'‘'—,’, × 4Ñ 4´R·V±VÓ <¸Q¸RÐ @ÐAˆCó &�äŸ7™7Ÿ<™<¨Ó6�à×&Ñ&Ð'K×LÑLá9¸(ÈoÓ^‘Hô Ÿ7™7Ÿ=™=¨×2Ñ2ÜŸ™Ÿ™ XÔ8Ù2°8Ó<�Hç�8¤§¡§¡¨x× 8Ó 8Ø#+�LÙò &ð" ×(Ñ(Ð)M×NÑNÙ9¸.ÐTcÓd‘á2°>ÓB�ö Ü@Ü—‘× Ñ  Ó0ØóˆLö ÜŸ7™7×+Ñ+¨LÓ9ˆLð
 	�
‰
�NÐ1×2ñY *ð\ €MøôQ ó 0Ø+/Ó(ð0ús   œL' Ì'L7Ì6L7c                 óþ  • [         R                  R                  U 5      (       a  U $ [        R                  (       a  [        U 5      nU(       a  U$ [        X5      $ [        R                  (       ak  [        X5      nU(       a  U$ [        R                  " SS5      R                  [         R                  5       Vs/ s H  o3(       d  M  UPM     nn[        X5      $ [        R                  R                  U 5      $ s  snf )aP  
Given a library name, attempt to resolve full path to that library. The search for library is done via
platform-specific mechanism and fall back to optionally-provided list of search paths. Returns None if library
cannot be resolved. If give library name is already an absolute path, the given path is returned without any
processing.
ÚPATHÚ )rJ   r$   r×   r   Úis_unixÚ_resolve_library_path_unixr­   rH   Úgetenvr‚   ÚpathsepÚctypesÚutilÚfind_library)r)   rR   Úfullpathr$   Úwin_search_pathss        r   r…   r…   ž  sµ   € ô 
‡w�w‡}�}�T×ÑØˆä‡~‡~ä-¨dÓ3ˆÞØˆOä4°TÓHÐHÜ	��ä8¸ÓLˆÞØˆOô .4¯]ª]¸6À2Ó-F×-LÑ-LÌRÏZÉZÔ-XÓaÒ-X TÓ\`ŸDÑ-XÐÐaÜ4°TÓLÐLä�{‰{×'Ñ'¨Ó-Ð-ùò bs   Â:
C:ÃC:c                 ó‚  • U=(       d    /  HŸ  n[         R                  R                  X 5      n[         R                  R                  U5      (       d  MH  [        R
                  (       a#   [        R                  " U5      nU[        :w  a  M€  [         R                  R                  U5      s  $    g! [         a     M±  f = f)z_
Low-level helper for resolving given library name to full path in given list of search paths.
N)rJ   r$   r¦   rØ   r   rH   r   Úget_pe_file_machine_typeÚ	ExceptionÚ_exe_machine_typer®   )r)   rR   Úsearch_pathrû   Údll_machine_types        r   r­   r­   Æ  s™   € ð $×) rÒ)ˆÜ—7‘7—<‘< Ó2ˆÜ�w‰w�~‰~˜h×'Ñ'Ùô �=�=ðÜ#+×#DÒ#DÀXÓ#NÐ ð  Ô#4Ó4Ùä�w‰w×Ñ Ó)Ò)ñ *ð" øô ó âðús   Á*B0Â0
B>Â=B>c           	      ó”  • [         R                  (       d   S5       eU R                  S5      (       d  SU ;   a  [        nO[        n[         R
                  (       a  [         R                  " SS5      nOD[         R                  (       a  [         R                  " SS5      nO[         R                  " SS5      nU" U [        SUR                  [        R                  5      5      5      nUca  [        R                  " 5         [        R                  R                  U 5      nU(       a&  [        R                   R#                  U5      (       d   eUGcù  S	S
/n[         R$                  S:X  a  UR'                  SS/5        OUR'                  SS/5        [         R(                  S:X  a9  [         R$                  S:X  a  UR'                  S/5        OUR'                  S/5        [*        R,                  " S5      nU(       aO  [        R                   R/                  U5      nUR1                  [        R                   R3                  S
U5      5        O[4        R7                  S5        [        R                   R9                  S5      (       a  UR1                  S5        [         R
                  (       a  UR1                  S5        Oˆ[         R:                  (       a8  [         R$                  S:X  a  UR1                  S5        OMUR1                  S5        O;[         R<                  (       d  [         R>                  (       a  UR1                  S5        U" X5      nU$ )z•
UNIX-specific helper for resolving library path.

Emulates the algorithm used by dlopen. `name` must include the prefix, e.g., ``libpython2.4.so``.
zCCurrent implementation for Unix only (Linux, Solaris, AIX, FreeBSD)z.soz.so.ÚLIBPATHró   ÚDYLD_LIBRARY_PATHÚLD_LIBRARY_PATHNz/libz/usr/libÚ32bitz/lib32z
/usr/lib32z/lib64z
/usr/lib64Úintelz/usr/lib/i386-linux-gnuz/usr/lib/x86_64-linux-gnuÚmultiarchsubdirz!Multiarch directory not detected.z#/data/data/com.termux/files/usr/libz/opt/freeware/libz/usr/local/lib/hpux32z/usr/local/lib/hpux64z/usr/local/lib) r   rô   ri   r­   Ú_which_libraryr™   rö   rD   Úfilterr‚   rJ   r÷   r   Úload_ldconfig_cacheÚLDCONFIG_CACHErM   r$   rØ   ÚarchitectureÚextendÚmachineÚ	sysconfigÚget_config_varrL   r   r¦   r>   r?   Úisdirrœ   Ú
is_freebsdÚ
is_openbsd)r)   Úlib_search_funcÚlprŒ   r%   Úarch_subdirs         r   rõ   rõ   Þ  sC  € ô �>�>Ð`Ð`Ó`ˆ>à‡}�}�U×Ñ˜v¨›~ô @‰ô )ˆô ‡}‡}Ü�]Š]˜9 bÓ)‰Ü	×	×	Ü�]Š]Ð.°Ó3‰ä�]Š]Ð,¨bÓ1ˆÙ
˜$¤ t¨R¯X©X´b·j±jÓ-AÓ BÓ
C€Cð �{Ü×!Ò!Ô#Ü×"Ñ"×&Ñ& tÓ,ˆÞÜ—7‘7—>‘> #×&Ñ&Ð&Ð&ð ‚{à˜Ð$ˆä×Ñ 'Ó)Ø�L‰L˜( LÐ1Õ2à�L‰L˜( LÐ1Ô2ä�>‰>˜WÓ$Ü×"Ñ" gÓ-Ø—‘Ð7Ð8Õ9à—‘Ð9Ð:Ô;ô
  ×.Ò.Ð/@ÓAˆÞÜŸ'™'×*Ñ*¨;Ó7ˆKØ�L‰LœŸ™Ÿ™ j°+Ó>Õ?ä�L‰LÐ<Ô=ô �7‰7�=‰=Ð>×?Ñ?Ø�L‰LÐ>Ô?ä�=�=Ø�L‰LÐ,Õ-Ü�^�^Ü×"Ñ" gÓ-Ø—‘Ð4Õ5à—‘Ð4Õ5Ü××¤&×"3×"3Ø�L‰LÐ)Ô*Ù˜dÓ*ˆà€Jr   c                 ó
  • [        U 5      n[        [        R                  R                  U5       HP  n[        R
                  " U5       H3  nU" U5      (       d  M  [        R                  R                  X45      s  s  $    MR     g)a  
Search for a shared library in a list of directories.

Args:
    name:
        The library name including the `lib` prefix but excluding any `.so` suffix.
    dirs:
        An iterable of folders to search in.
Returns:
    The path to the library if found or None otherwise.

N)Ú_library_matcherr  rJ   r$   r«   Úlistdirr¦   )r)   ÚdirsÚmatcherr$   Ú_paths        r   r
  r
  ,  sV   € ô ˜tÓ$€GÜ”r—w‘w—~‘~ tÖ,ˆÜ—Z’Z Ö%ˆEÙ�u�~‹~Ü—w‘w—|‘| DÓ0Ô0ó &ò -r   c                 óH   • [         R                  " U S-   5      R                  $ )zn
Create a callable that matches libraries if **name** is a valid library prefix for input library full names.
z[0-9]*\.)rš   r›   r4   )r)   s    r   r  r  @  s   € ô �:Š:�d˜[Ñ(Ó)×/Ñ/Ð/r   c                  óL  • [         R                  (       a#  SSKn U R                  [        R
                  5      $ [        R                  " S5      =(       d-    [         R                  =(       a    [        R                  " S5      nU(       a  [        R                  " S5      nO›[         R                  (       a[  [        R                  SS u  p4[         R                  (       a  SOSn[         R                  (       a  S	U S
U U S3nO7S	U S
U U S3nO+SSKJn  [         R                  (       a  SOSnU" SU S
35      e[         R                  (       d  [         R                  (       a8  [        R                   R#                  U5      R%                  S5      (       a  USS n[        R                   R#                  [        R                   R'                  U5      5      nU(       am  [)        [         R*                  5      n	U	 HN  u  p«Uc  M
  [        R                   R#                  [        R                   R'                  U5      5      U:X  d  ML  Us  $    S nU" U[         R,                  [        R                   R/                  [         R,                  S5      5      nU(       a  U$ [1        U5      nU(       a  U$ SSKJn  SU< S3n[         R2                  (       aJ  [        R                   R5                  S5      (       a&  S[        R                  R6                   3nUSU S3-  nU" U5      e)a®  
Find Python shared library that belongs to the current interpreter.

Return  full path to Python dynamic library or None when not found.

PyInstaller needs to collect the Python shared library, so that bootloader can load it, import Python C API
symbols, and use them to set up the embedded Python interpreter.

The name of the shared library is typically fixed (`python3.X.dll` on Windows, libpython3.X.so on Unix systems,
and `libpython3.X.dylib` on macOS for shared library builds and `Python.framework/Python` for framework build).
Its location can usually be inferred from the Python interpreter executable, when the latter is dynamically
linked against the shared library.

However, some situations require extra handling due to various quirks; for example, Debian-based linux
distributions statically link the Python interpreter executable against the Python library, while also providing
a shared library variant for external users.
r   NÚPy_ENABLE_SHAREDÚPYTHONFRAMEWORKÚ
INSTSONAMEr—   Útró   Ú	libpythonr0   z.dylibz.so.1.0)ÚPythonLibraryNotFoundErrorz?either the `--enable-shared` or the `--enable-framework` optionzthe `--enable-shared` optionz~Python was built without a shared library, which is required by PyInstaller. If you built Python from source, rebuild it with z.dll.aéþÿÿÿc                 ó.  • U H�  n[         R                  R                  X 5      n[         R                  R                  U5      (       d  MH  [         R                  R	                  U5      n[         R                  R                  U5      (       d  M�  Us  $    g r
   )rJ   r$   r¦   r«   r¡   )r)   ÚlibdirsÚlibdirÚ	full_paths       r   Ú_find_lib_in_libdirsÚ5get_python_library_path.<locals>._find_lib_in_libdirs¥  sk   € ÛˆFÜŸ™Ÿ™ VÓ2ˆIÜ—7‘7—>‘> )×,Ñ,Ùô Ÿ™×(Ñ(¨Ó3ˆIÜ—7‘7—>‘> )×,Ñ,ÙØÒñ ð r   rŒ   zERROR: Python shared library (z) was not found!z/etc/debian_versionzlibpython3.zw If you are using system python on Debian/Ubuntu, you might need to install a separate package by running `apt install z`.)r   rH   Ú_winapiÚGetModuleFileNamer   Ú	dllhandler  r  rD   Úis_condaÚversion_infoÚis_nogilÚPyInstaller.exceptionsr&  rª   rJ   r$   rK   ri   rL   r@   Úpython_executabler   r¦   r…   rž   rØ   Úminor)r.  Ú	is_sharedÚexpected_nameÚpy_majorÚpy_minorÚ	py_suffixr&  Ú
option_strÚexpected_basenameÚimported_librariesÚ_rð   r,  Úpython_libnameÚmessageÚpkg_names                   r   Úget_python_library_pathrC  J  s˜  € ô, ‡}‡}ÛØ×(Ñ(¬¯©Ó7Ð7ô 	× Ò Ð!3Ó4÷ 	Kô 
×	Ñ	×	Iœi×6Ò6Ð7HÓIð ö Ü!×0Ò0°Ó>‰Ü	��ô !×-Ñ-¨b¨qÐ1ÑˆÜ!Ÿ?Ÿ?‘C°ˆ	Ü××à'¨ z°°8°*¸Y¸KÀvÐN‰Mð (¨ z°°8°*¸Y¸KÀwÐO‰Mõ 	Fô ××ñ NØ%Cð 	ñ )ð@Ø@J¸|È1ðNó
ð 	
ô 	��œ×)×)¬r¯w©w×/?Ñ/?ÀÓ/N×/WÑ/WÐX`×/aÑ/aØ% c rÐ*ˆô Ÿ™×(Ñ(¬¯©×)9Ñ)9¸-Ó)HÓIÐö
 Ü(¬×)AÑ)AÓBÐÛ-‰KˆAØÑÙÜ�w‰w×Ñ¤§¡× 0Ñ 0°Ó :Ó;Ð?PÕPà’ñ .òñ" *ØÜ×ÑÜ
�‰�‰”V×'Ñ'¨Ó/ó€Nö
 ØÐô *Ð*;Ó<€NÞØÐõ Bà.¨}Ñ.?Ð?OÐP€GÜ‡‡œ2Ÿ7™7Ÿ>™>Ð*?×@Ñ@à ¤×!1Ñ!1×!7Ñ!7Ð 8Ð9ˆØðØ$˜: Rð)ñ	
ˆñ
 % WÓ
-Ð-r   c                 ób   • [         R                  R                  U 5      (       d  g[        U 5      $ )a#  
Classify the given file as either BINARY or a DATA, using appropriate platform-specific method. Returns 'BINARY'
or 'DATA' string depending on the determined file type, or None if classification cannot be performed (non-existing
file, missing tool, and other errors during classification).
N)rJ   r$   rØ   Ú_classify_binary_vs_data©rm   s    r   Úclassify_binary_vs_datarG  Ø  s'   € ô �7‰7�>‰>˜(×#Ñ#Øô $ HÓ-Ð-r   c                 óx  •  [        U S5       nUR                  S5      nS S S 5        WS:w  a  gSSU /n [        R                  " U[        R
                  [        R
                  [        R                  SS9nUR                  S	:X  a  S
$ S$ ! , (       d  f       Nq= f! [         a     g f = f! [         a     g f = f)NÚrbé   s   ELFÚDATAÚobjdumpz-aÚutf8)r‘   r�   r�   r’   r   r1   )ÚopenÚreadrÿ   rŸ   r    r£   r¢   Ú
returncode)rm   ÚfpÚsigÚcmd_argsr°   s        r   rE  rE  é  sµ   € ð	Ü�h Ô%¨Ø—g‘g˜a“j�÷ &ð
 �*ÓØð
 ˜t XÐ.ˆð		Ü—’ØÜ!—‘Ü!—‘Ü ×(Ñ(ØñˆAð Ÿ<™<¨1Ó,ˆxÐ8°&Ð8÷/ &Õ%ûäó 	Ùð	ûô$ ó 	Ùð	ús?   ‚B ŽB B µAB, Â
BÂB ÂB Â
B)Â(B)Â,
B9Â8B9c                 óD  • SS K n [        U S5       nUR                  S5      nS S S 5        WS:w  a  g UR	                  U SS9 n S S S 5        g! , (       d  f       N1= f! [         a     g f = f! , (       d  f       g= f! UR
                   a     g[         a     g f = f)	Nr   rI  r—   s   MZrK  Tro   r1   )ry   rN  rO  rÿ   rz   ÚPEFormatError)rm   ry   rQ  rR  r‡   s        r   rE  rE    s¡   € Ûð	Ü�h Ô%¨Ø—g‘g˜a“j�÷ &ð
 �%‹<Øð	Ø—‘˜8¨t�Ñ4¸Ø÷ 5à÷ &Õ%ûäó 	Ùð	ú÷ 5Ô4àûØ×#Ñ#ó 	ÙÜó 	Øàð	úsb   †A  ’A¤A  ´B ÁA0ÁB Á
AÁA  ÁA  Á 
A-Á,A-Á0
A>Á:B Á>B ÂBÂ	BÂBc                 ód   • SS K n UR                  R                  U 5      ng! [         a     gf = f)Nr   r1   rK  )rä   r¸   rÿ   )rm   ÚmacholibÚmachos      r   rE  rE  "  s6   € ãð	Ø—N‘N×(Ñ(¨Ó2ˆEØøÜó 	ààð		ús   †" ¢
/®/c                 ó   • g r
   rÐ   rF  s    r   rE  rE  1  s   € àr   )NNr
   )0Ú__doc__Úctypes.utilrø   rç   rJ   r   rš   r   r  rŸ   ÚPyInstallerr   r   ÚloggingÚPyInstaller.dependr   r   ÚPyInstaller.utils.win32r   rD   ÚPyInstaller.utils.osxÚosxrF   Ú	getLoggerÚ__name__r>   r   rH   rþ   r5  r&   r-   rf   r@   rj   rl   rk   r…   ÚfindLibraryÚfindSystemLibraryr­   rõ   r
  r  rC  rG  rž   rE  rÐ   r   r   Ú<module>rf     s  ðñó Û Û 	Û Û 	Û 
Û Û å Ý &ß +Ý ,à	××ß,Ð,à	×	Ò	˜8Ó	$€àÐ Ø	‡=‡=Ø ×9Ò9¸&×:RÑ:RÓSÐò
7òtôaôN8ò*,ò^JòZrôpðH #€Ø(Ð ôò0Kò\1ò(0òH.ò\.ð 
‡?‡?ó9ð8 ‡]‡]óð2 ××óór   