zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
U
W±d­ã@s€dZddlZddlZddlZddlZddlZddlZddlZddl    Z    ddl
m Z ddl
m Z ddlmZmZddlmZe  e¡ZeƒZe jr²ddlmZddlZddlmZmZd7d    d
„Zd d „Zd d„Z e !dd¡Z"dd„Z#da$dd„Z%dd„Z&dd„Z'd8dd„Z(dd„Z)d9dd„Z*dd „Z+d:d!d"„Z,d;d#d$„Z-d%d&„Z.d'd(„Z/d)d*„Z0d+d,„Z1d-d.„Z2d/d0„Z3d1d2„Z4d3d4„Z5d5d6„Z6dS)<z1
Find external dependencies of binary libraries.
éN)Úcompat)Úlog)ÚdylibÚutils)Úwinutils)Úget_python_lib)Ú winmanifestÚ winresourcecCsÂg}tjr<tj tƒd¡g}tjr<| tj tjddd¡¡t    j|t
  ¡t  dd¡  tj¡}|dk    rŠt|tƒr‚| d|¡n||}|D].}tj ||¡}tj |¡rŽt|ƒrŽ|SqŽdS)z÷
    Return the full path name of MOD.
 
    * MOD is the basename of a dll or pyd.
    * XTRAPATH is a path or list of paths to search first.
 
    Return the full path name of MOD. Will search the full Windows search path, as well as sys.path
    Zpywin32_system32ÚLibz site-packagesÚPATHÚNr)rÚis_winÚosÚpathÚjoinrZis_venvÚappendÚ base_prefixÚsysrZget_system_pathÚgetenvÚsplitÚpathsepÚ
isinstanceÚstrÚinsertÚexistsÚ matchDLLArch)ÚmodÚxtrapathZ pywin32_pathsZepathÚpÚnpth©r úSd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\PyInstaller/depend/bindepend.pyÚ getfullnameof+s,    ÿÿÿÿ
 
r"c    Cs¶tƒ}tj|dd}|jtjdtjdgdddt|dgƒD]}t |j¡}|     |¡q@t|ddƒ}|rª|j
D]6}|j dk    rrt |j ¡}|  d    ¡d
}|     |d ¡qr|  ¡|S) z¢
    Find the binary dependencies of PTH.
 
    This implementation walks through the PE header and uses library pefile for that and supports 32/64bit Windows
    T©Z    fast_loadZIMAGE_DIRECTORY_ENTRY_IMPORTZIMAGE_DIRECTORY_ENTRY_EXPORT)Ú directoriesZforwarded_exports_onlyZimport_dllnames_onlyZDIRECTORY_ENTRY_IMPORTZDIRECTORY_ENTRY_EXPORTNÚ.rz.dll)ÚsetÚpefileÚPEZparse_data_directoriesZDIRECTORY_ENTRYÚgetattrrZconvert_dll_name_to_strÚdllÚaddÚsymbolsÚ    forwarderrÚclose)    ÚpthÚdllsÚpeÚentryZdll_strZ exportSymbolsÚsymr-r*r r r!Ú_getImports_peJs*þú    
 
 r4cCsHg}|D]:}|\}}}tj |¡s2t|ƒdd}| |||f¡q|S)z
    Ensure all binary modules in zipped eggs get extracted and included with the frozen executable.
 
    return  modified table of content
    r)rrÚisfileÚcheck_extract_from_eggr)ZtocZnew_tocÚitemÚmodnamer/Útypr r r!Ú_extract_from_eggts
 r:ÚBindingRedirectz7name language arch oldVersion newVersion publicKeyTokencCs:t|j|jk|j|jk|j|jk|j|jk|j|jkgƒS©N)ÚallÚnameÚversionÚ
oldVersionÚlanguageÚprocessorArchitectureÚarchÚpublicKeyToken)ÚmanifestÚredirectr r r!Úmatch_binding_redirectŠs
 
 
 
 
ûrGc
Csštjs
dSzVtdkr8tj}tj|dd}|jja| ¡|}tj|dd}|jjtk}| ¡Wn4tj    k
r”}zt
d||fƒ‚W5d}~XYnX|S)zù
    Return True if the DLL given by filename matches the CPU type/architecture of the Python process running
    PyInstaller.
 
    Always returns True on non-Windows platforms.
 
    :param filename:
    :type filename:
    :return:
    :rtype:
    TNr#z2Cannot get architecture from file: %s
  Reason: %s) rr Ú_exe_machine_typeÚpython_executabler'r(Z FILE_HEADERZMachiner.Ú PEFormatErrorÚ
SystemExit)ÚfilenameZ
pefilenameZexe_per1Z
match_archÚexcr r r!r—s   "rcCs”ddl}| ¡}| | ¡¡t tj¡ ¡t tj    ¡ ¡h}g}|D]6}|sPqFt |¡ ¡}| 
¡shqF||krrqF| |¡qFt |dd„dd}|S)a‹
    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.
    rNcSs
t|jƒSr<)ÚlenÚparents)Úxr r r!Ú<lambda>åóz>_get_paths_for_parent_directory_preservation.<locals>.<lambda>T)ÚkeyÚreverse) ÚsiteÚgetsitepackagesrÚgetusersitepackagesÚpathlibÚPathrrÚresolveÚprefixÚis_dirÚsorted)rUZ
orig_pathsZexcluded_pathsÚpathsrr r r!Ú,_get_paths_for_parent_directory_preservation¸s$þ r_cCsRtjr*|j}|j ¡dkr*|j|kr*|jS|D]}||jkr.| |¡Sq.|jS)NZ    pythonwin)rr Úparentr>ÚlowerrOÚ relative_to)Z src_filenameÚparent_dir_preservation_pathsÚ
parent_dirZparent_dir_preservation_pathr r r!Ú_select_destination_directoryês
recCsäg}tjrtƒ}t|ƒ}|D]Â\}}}| ¡tkr4qt d|¡t | ¡¡tjrzt    |||ƒD]\}}    | 
||    df¡q`t ||ƒD]X\}
} |
 ¡tks„|  ¡tkr¦q„t |  ¡¡t   | ¡} t| |ƒ} | 
t| ƒ| df¡q„q|S)aš
    Expand LTOC to include all the closure of binary dependencies.
 
    `LTOC` is a logical table of contents, ie, a seq of tuples (name, path). Return LTOC expanded by all the binary
    dependencies of the entries in LTOC, except those listed in the module global EXCLUDES
 
    `manifest` may be a winmanifest.Manifest instance for a program manifest, so that all dependent assemblies of
    python.exe can be added to the built exe.
 
    `redirects` may be a list. Any assembly redirects found via policy files will be added to the list as
    BindingRedirect objects so they can later be used to modify any manifests that reference the redirected assembly.
    z Analyzing %sÚBINARY)rr r_r:ÚupperÚseenÚloggerÚdebugr+ÚgetAssemblyFilesrÚ selectImportsrXrYrer)ZlTOCrrEÚ    redirectsrcÚnmr/r9ÚftocnmÚfnÚlibrZsrc_pathZdst_pathr r r!Ú Dependenciess(  
 
rrcCsÀt d¡}|dk    r|Stjdkr,tj d¡Sd}dd|fd|fd    |fd
d |fg}|D]^\}}d }|D](}|tjkrˆtj |t |¡¡}qdqTqd|r tj ||¡}tj |d ¡SqTtdƒ‚dS)a 
    Determine the default cache location
 
    This returns the ``PYTHON_EGG_CACHE`` environment variable, if set. Otherwise, on Windows, it returns a
    'Python-Eggs' subdirectory of the 'Application Data' directory.  On all other systems, it's '~/.python-eggs'.
    ÚPYTHON_EGG_CACHENÚntz~/.python-eggszApplication Data))ÚAPPDATAN)Ú USERPROFILE)Ú    HOMEDRIVEÚHOMEPATH)rx))ÚHOMEN)ZWINDIRr z Python-Eggsz4Please set the PYTHON_EGG_CACHE environment variable)    rrrr>rÚ
expanduserÚenvironrÚ RuntimeError)Z    egg_cacheZapp_dataZ    app_homesÚkeysÚsubdirÚdirnamerSr r r!Úpkg_resources_get_default_cache1s.
 
 ú     
r€c Cs g}tjjr | tjjtjj¡}| tjj¡}t|ƒD]Z\}}| ¡ d¡r6tjj     |d|d…¡}tj 
|¡r6zt   |¡}Wn4t j k
r¶}ztd||fƒ‚W5d}~XYnX|dkrÔtj     tƒ|d¡}||dd…rd     ||dd…¡g}    n| ¡}    |    D]|}
tj     ||
¡}tj 
|¡svtj |¡} tj | ¡sPt | ¡t|dƒ} |  | |
¡¡W5QRX| |||
f¡q |Sq6|ddfgS)aŽ
    Check if path points to a file inside a python egg file, extract the file from the egg to a cache directory (
    following pkg_resources convention) and return [(extracted path, egg file path, relative path inside egg file)].
 
    Otherwise, just return [(original path, None, None)]. If path points to an egg file directly, return a list with
    all files from the egg formatted like above.
 
    Example:
    >>> check_extract_from_egg(r'C:\Python26\Lib\site-packages\my.egg\mymodule\my.pyd')
    [(r'C:\Users\UserName\AppData\Roaming\Python-Eggs\my.egg-tmp\mymodule\my.pyd',
    r'C:\Python26\Lib\site-packages\my.egg', r'mymodule/my.pyd')]
    z.eggNéz Error: %s %sz-tmpú/Úwb)rrÚaltsepÚreplaceÚseprÚ    enumerateraÚendswithrr5ÚzipfileÚZipFileÚ
BadZipFilerKr€ÚnamelistrÚisdirÚmakedirsÚopenÚwriteÚreadr) r/ZtodirÚrvÚ
componentsÚir>ZeggpthZeggÚeÚmembersÚmemberrÚfr r r!r6Ys8  " 
 
r6c     Cs¬| ¡ d¡rgS|d}tj |¡rTt|dƒ}tjdd| ¡iii}W5QRXn`zt     |¡}WnPt
j j k
r²}z.|j dt
jkr t d|¡gWY¢S‚W5d}~XYnXg}tj|kr¨t|tjƒr¨|tjD]È}|tj|D]´}zHt ¡}d |ttjƒt|ƒt|ƒg¡|_| |tj||d¡Wn*tk
rftj d    |||dd
YqðX|jr˜t d |¡t d  d d„|jDƒ¡¡| |j¡qðqÞ|S)a
    On Windows return the dependent Side-by-Side (SxS) assemblies of a binary as a list of Manifest objects.
 
    Dependent assemblies are required only by binaries compiled with MSVC 9.0. Python 2.7 and 3.2 are compiled with
    MSVC 9.0 and thus depend on Microsoft Redistributable runtime libraries 9.0.
 
    Python 3.3+ is compiled with version 10.0 and does not use SxS assemblies.
 
    FIXME: Can this be removed since we now only support Python 3.5+?
    FIXME: IS there some test-case covering this?
    ú    .manifestÚrbrrz0Cannot get manifest resource from non-PE file %sNú:Fz-Cannot parse manifest resource %s, %s from %s©Úexc_infozDependent assemblies of %s:ú, cSsg|] }| ¡‘qSr )Úgetid)Ú.0Úassemblyr r r!Ú
<listcomp>¸sz!getAssemblies.<locals>.<listcomp>)rarˆrrr5rrZ RT_MANIFESTr‘ZGetManifestResourcesr    Z
pywintypesÚerrorÚargsZERROR_BAD_EXE_FORMATriÚinforNZManifestrrrLÚ parse_stringÚ    ExceptionÚdependentAssembliesrjÚextend)    r/Z
manifestnmÚfdÚresrMr’r>rArEr r r!Ú getAssemblies‰sB   "  ü r¬c Csjg}|rtdd„|jDƒƒ}t|ƒD]}| ¡ ¡tkr<q$|rr|j|krrt d|j|¡|j     |¡| 
|j¡t   |j¡st  d| ¡¡q$|jr¨t  d| ¡¡q$ddlm}| d¡rÈ| ¡}ng}t|ƒs8|jd    d
}t|ƒr8|d k    r8|j}| ¡}    t d |j||    ¡|     t|j|j|j|j||    d ¡|rt 
| ¡ ¡¡|D]¾}
tj |
¡\} } |  ¡dkr‚|j| } n tj |
¡} | }|jdkr°tj |  ¡|¡}dd„| ||
fDƒ\} }}
|
 ¡tkrTt  d|¡t 
|  ¡¡t 
|
 ¡¡|     ||
f¡nqTq$t !d| ¡¡q$g}|D]0}|d "d¡}|d "d¡}|     ||f¡q0|}|S)aF
    Find all assemblies that are dependencies of the given binary and return the files that make up the assemblies as
    (name, fullpath) tuples.
 
    If a WinManifest object is passed as `manifest`, also updates that manifest to reference the returned assemblies.
    This is done only to update the built app's .exe with the dependencies of python.exe
 
    If a list is passed as `redirects`, and binding redirects in policy files are applied when searching for
    assemblies, BindingRedirect objects are appended to this list.
 
    Return a list of pairs (name, fullpath)
    css|] }|jVqdSr<©r>)r Údepr r r!Ú    <genexpr>Ìsz#getAssemblyFiles.<locals>.<genexpr>zFAdding %s to dependent assemblies of final executable
  required by %szSkipping assembly %szSkipping optional assembly %sr)ÚCONFZwin_no_prefer_redirectsF)Zignore_policiesNz#Adding redirect %s version %s -> %s)r>rArCrDr@Z
newVersionr™)Nr Ú*ZneutralcSsg|]}| t ¡¡‘qSr )ÚencoderÚgetfilesystemencoding)r r7r r r!r¢sz$getAssemblyFiles.<locals>.<listcomp>z    Adding %szAssembly %s not foundÚasciir)#r&r¨r¬rŸrgrhr>rir¥rr+rÚinclude_libraryrjÚoptionalZPyInstaller.configr°ÚgetÚ
find_filesrNr?Zget_policy_redirectr;rArBrDrrÚsplitextraÚbasenamerZ getlanguager£Údecode)r/rErmr’Z    _depNamesr¡r°ÚfilesZ old_versionZ new_versionrpÚfnameZfextrnroZnew_rvr7ÚaÚbr r r!rk½sz     
 
 
 úÿ     rkcCs0g}|dkrtj |¡g}n t|tƒs*t‚tj |¡g|}t|ƒ}|D]â}| ¡tkrZqHt    j
sr|}tj  |¡}n
t ||ƒ}|r†|}n|}t  |¡sÖ| d¡dkrÖ| d¡dkrÖ| ¡tkrHt d|tj  |¡¡qHn|r| ¡tkr*t d|tj  |¡|¡| ||f¡qHt  |¡rHt d||¡qH|S)zs
    Return the dependencies of a binary that should be included.
 
    Return a list of pairs (name, fullpath)
    NÚ    libpythonrzPython.frameworkzSkipping %s dependency of %sz"Adding %s dependency of %s from %sz"lib not found: %s dependency of %s)rrrrÚlistÚAssertionErrorÚ
getImportsrgrhrr rºr"rrµÚfindrirjrÚwarn_missing_libÚwarning)r/rr’r0rqrZ candidatelibr r r!rls8 
 
 
rlc
Csútƒ}tjrt d¡}n.tjr*t d¡}ntjr<t d¡}n
t d¡}tjd|gtj    tj    dd}|j
  ¡D]0}|svqjn|  d¡rŒ|  d¡rŒqjt|tj
d    qj|j  ¡D]L}| |¡}|r¬tjr| d
¡}|rî|}tj |¡| d ¡}n| d ¡}tj |¡}n6tjr&| d ¡| d¡}}n| d ¡| d¡}}|dd…dkrPq¦tjrj| ¡  d¡rjq¦tj |¡rŽ||krª| |¡nt |¡rôt d|||¡q¦|  d¡r¦| d¡}    t|    ƒdkrÐq¦|    d  ¡}t |¡r¦t d||¡q¦|S)zk
    Find the binary dependencies of PTH.
 
    This implementation is for ldd platforms (mostly unix).
    zR^\s*(((?P<libarchive>(.*\.a))(?P<objectmember>\(.*\)))|((?P<libshared>(.*\.so))))$z^\s+(.*)\s+=>\s+(.*)$z\s*(.*?)\s+=>\s+(.*?)\s+\(.*\)ZlddT)ÚstderrÚstdoutÚuniversal_newlineszError relocating z symbol not found)ÚfileÚ
libarchiveZ objectmemberZ    libsharedréNé
)z
linux-gatez
linux-vdsoz/cygdrive/c/windows/systemz(Cannot find %s in path %s (needed by %s)z    not foundz=>rzCannot find %s (needed by %s))!r&rÚis_aixÚreÚcompileÚis_hpuxÚis_solarÚ
subprocessÚrunÚPIPErÇÚ
splitlinesÚ
startswithrˆÚprintrrÈÚsearchÚgrouprrrºZ    is_cygwinrarr+rrÅrirÆrrNÚstrip)
r/ÚrsltZ
lddPatternrÚlineÚmrËrqr>Útokensr r r!Ú_getImports_lddIs\   
 
 
 
 
 
 
 
ràc Csªddlm}ddlm}ddlm}ddlm}tƒ}tƒ}||ƒ}|j    D]*}| 
¡D]\}    }
} | |krV|  | ¡qVqJtƒ} |j    D]}|j D]„} | dj }||krü| d d¡}| d¡}tj |¡}t d    |d
|¡}tj tj ||¡¡}|  |g¡qŒd |krŒ|  d g¡qŒq‚|   tj tjd ¡¡tj tj |¡¡}tj tj tj¡¡}|D]J} |  d¡r|  dd¡} d}| D]`}tj |¡sžtj ||¡}tj  tj || ¡¡r~tj tj || ¡¡}|  |¡qàq~|s¢t! "| ¡r¢t# $d| |¡n |  d¡r|  dd¡} z|| |d} |  | ¡Wnlt%k
r z|| |d} |  | ¡Wn:t%k
rš|| ƒs–t! "| ¡r–t# $d| |¡YnXYnXqX|S)zr
    Find the binary dependencies of PTH.
 
    This implementation is for Mac OS X and uses library macholib.
    r)Ú    dyld_find)ÚLC_RPATH)ÚMachO)Úin_system_pathrÌzutf-8úz*^@(executable_path|loader_path|rpath)(/|$)z\2z
.frameworkz    ../../../rqz@rpathr%Nz"Cannot find path %s (needed by %s)z @loader_pathz@executable_path)Úexecutable_path)&Z macholib.dyldráZmacholib.mach_orâZmacholib.MachOrãZ macholib.utilrär&ÚheadersZwalkRelocatablesr+ÚcommandsÚcmdr»ÚrstriprrrrÏÚsubÚnormpathrÚupdaterrÚabspathrÚ
executabler×r…ÚisabsrrrÅrirÆÚ
ValueError)r/rárârãrärÜrhrÞÚheaderÚidxr>rqZ    run_pathsÚcommandZcmd_typeZrpathræZ    exec_pathZpython_bin_pathZ    final_libÚrun_pathr r r!Ú_getImports_macholib¢sj    
 
 
 
 
 
 
 
    röc
Cstjrv| ¡ d¡rgSz
t|ƒWStk
rr}z2t d|¡tjd|t|t    j
ƒ dgWY¢Sd}~XYqŒXntj r„t |ƒSt |ƒSdS)zM
    Forwards to the correct getImports implementation for the platform.
    r™z+Cannot get binary dependencies for file: %sz   Reason: %srœN)rr rarˆr4r§rirÆrr'rJÚ    is_darwinrörà)r/Ú    exceptionr r r!rÃ
s
 rÃcCs$tjstdƒ‚tjr"t dd¡}n tjr6t dd¡}n t dd¡}t|td| t    j
¡ƒƒ}|dkrŠt   ¡t j  |¡}|rŠt    j |¡sŠt‚|dkrØddg}tjd    kr¶| d
d g¡n| d d g¡tjdkròtjd    kræ| dg¡n | dg¡zHddl}| d¡}|r.t    j |¡}| t    j d|¡¡n
t d¡Wn tk
rZt d¡YnXt    j d¡rt| d¡tjrˆ| d¡nFtjr´tjd    kr¨| d¡n
| d¡ntjsÄtjrÎ| d¡t||ƒ}|dkrædStjsþtjsþtjr|St    j  |¡}t    j |t!|ƒ¡SdS)z‘
    Look for a library in the system.
 
    Emulate the algorithm used by dlopen. `name` must include the prefix, e.g., ``libpython2.4.so``.
    zCCurrent implementation for Unix only (Linux, Solaris, AIX, FreeBSD)ZLIBPATHr ZDYLD_LIBRARY_PATHZLD_LIBRARY_PATHNz/libz/usr/libÚ32bitz/lib32z
/usr/lib32z/lib64z
/usr/lib64Úintelz/usr/lib/i386-linux-gnuz/usr/lib/x86_64-linux-gnurZmultiarchsubdirz!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Úis_unixrÂrÎrr÷Ú_which_libraryÚfilterrrrrZload_ldconfig_cacheZLDCONFIG_CACHEr·rr5Ú architecturer©ÚmachineÚ    sysconfigÚget_config_varrºrrrirjÚ ImportErrorrrÑZ
is_freebsdZ
is_openbsdrÚ _get_so_name)r>Úlprqr^rZ arch_subdirÚdirr r r!Ú findLibrary s^  
 
 
 
 
 
 
 
 
 rcCsNt|ƒ}ttjj|ƒD]2}t |¡D]"}||ƒr$tj ||¡Sq$qdS)a9
    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ýrrrÚlistdirr)r>ÚdirsZmatcherrÚ_pathr r r!rüws
rücCst |d¡jS)zv
    Create a callable that matches libraries if **name** is a valid library prefix for input library full names.
    z[0-9]*\.)rÏrÐÚmatchr­r r r!r‹srcCs>dd|g}d}tjr"dd|g}d}t |tj|Ž¡}| d¡S)zq
    Return the soname of a library.
 
    Soname is useful when there are multiple symplinks to one library.
    Zobjdumpz-pz\s+SONAME\s+([^\s]+)Zelfdumpz-dz\s+SONAME\s+[^\s]+\s+([^\s]+)r)rrÒrÏrÙZ exec_commandrÚ)rLréÚpatternrÞr r r!r’s
 
rcCs6dd„}tjr |tjƒ}|r |Sttjƒ}|D]F}tjD]:}tj |¡|kr8tj    rftj 
|¡sft |ƒ}|Sq8q.tj    ržd|krždt j dd…}t |ƒStjrÂ|tj tjd¡ƒ}|rè|Sn&tjrètjD]}t|ƒ}|rÎ|SqÎtjsötjr|tjtj tjd¡ƒ}|r|Sdd     tj¡f}t|ƒ‚dS)
aO
    Find dynamic Python library that will be bundled with frozen executable.
 
    NOTE: This is a fallback option when the Python executable is likely statically linked with the Python library and
          we need to search more for it. For example, this is the case on Debian/Ubuntu.
 
    Return  full path to Python dynamic library or None when not found.
 
    We need to know name of the Python dynamic library for the bootloader. Bootloader has to know what library to
    load and not try to guess.
 
    Some linux distributions (e.g. debian-based) statically link the Python executable to the libpython,
    so bindepend does not include it in its output. In this situation let's try to find it.
 
    Custom Mac OS builds could possibly also have non-framework style libraries, so this method also checks for that
    variant as well.
    cWsZ|D]P}tjD]D}tj ||¡}tj |¡s.qtj |¡}tj |¡sHq|SqdSr<)rÚ PYDYLIB_NAMESrrrrÚrealpath)ZlibdirsZlibdirr>Ú    full_pathr r r!Ú_find_lib_in_libdirs´s
   z5get_python_library_path.<locals>._find_lib_in_libdirsz VERSION.dllzpython%d%d.dllNrÌrqaôPython library not found: %s
    This means your Python installation does not come with proper shared library files.
    This usually happens due to missing development package, or unsuitable build parameters of the Python installation.
 
    * On Debian/Ubuntu, you need to install Python development packages:
      * apt-get install python3-dev
      * apt-get install python-dev
    * If you are building Python by yourself, rebuild with `--enable-shared` (or, `--enable-framework` on macOS).
    rž)rZis_ms_app_storerrÃrIr rrrºr rðr"rÚ version_infoZis_condarrûrr÷Zis_linuxÚIOError)rZpython_libnamer0rLr>ÚpydllÚmsgr r r!Úget_python_library_path¢sF
 
 
 
 
    þ ø    rcCs<tj |¡r|Stjrt|ƒStjr,t|ƒStj     
|¡SdS)z“
    Given a library name, try to resolve the path to that library.
 
    If the path is already an absolute path, return it without searching.
    N) rrrðrrûrr r"ÚctypesÚutilÚ find_libraryr­r r r!ÚfindSystemLibrary    s r)N)NNN)N)NN)N)7Ú__doc__Ú collectionsÚ ctypes.utilrrrXrÏrr‰rÓZ PyInstallerrrÚloggingZPyInstaller.dependrrZPyInstaller.utils.win32rÚ    getLoggerÚ__name__rir&rhr Údistutils.sysconfigrr'rr    r"r4r:Ú
namedtupler;rGrHrr_rerrr€r6r¬rkrlràrörÃrrürrrrr r r r!Ú<module> sT   
 
* 
!2
0(
04
[
1YhWg