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
U
W±dä=ãD@s€dZddlZddlmZdddgZddlZddlZddlmZ    ddl
m Z e      e ¡Zdd    d
d hZd d ddddddddddddhZeƒZddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]hDZd^d_d`hZdadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxhZdydzd{d|d}d~dd€dd‚h
Ze jr‚eeOZeeOZn"e jr”eeOZne jr¤eeOZGdƒd„„d„ƒZGd…d†„d†ƒZeƒZeƒZe jrødd‡lm Z Gdˆd‰„d‰ƒZ!e!eƒZne jrGdŠd‹„d‹ƒZ"e"eƒZeƒZ#dŒd„Z$dgZ%e j&r<e% 'dŽ¡e j(rXe% 'dO¡e% 'dN¡Gdd„dƒZ)e)ƒZ*d‘d’„Z+d“d”„Z,dS)•z&
Manipulating with dynamic libraries.
éN)ÚwinutilsÚ exclude_listÚ include_listÚinclude_library)ÚcompatÚrunZrun_dZrunwZrunw_dz advapi32\.dllz ws2_32\.dllz
gdi32\.dllz oleaut32\.dllz shell32\.dllz
ole32\.dllz coredll\.dllz crypt32\.dllÚkernel32z kernel32\.dllz msvcrt\.dllz rpcrt4\.dllz user32\.dllz python\%s\%sz atl100\.dllz msvcr100\.dllz msvcp100\.dllz mfc100\.dllz mfc100u\.dllzmfcmifc80\.dllz mfcm100\.dllz mfcm100u\.dllz atl110\.dllz msvcp110\.dllz msvcr110\.dllzvccorlib110\.dllz vcamp110\.dllz mfc110\.dllz mfc110u\.dllz mfcm110\.dllz mfcm110u\.dllzmfc110chs\.dllzmfc110cht\.dllzmfc110enu\.dllzmfc110esn\.dllzmfc110deu\.dllzmfc110fra\.dllzmfc110ita\.dllzmfc110jpn\.dllzmfc110kor\.dllzmfc110rus\.dllz vcomp110\.dllz msdia110\.dllz msvcp120\.dllz msvcr120\.dllzvccorlib120\.dllz vcamp120\.dllz mfc120\.dllz mfc120u\.dllz mfcm120\.dllz mfcm120u\.dllzmfc120chs\.dllzmfc120cht\.dllzmfc120deu\.dllzmfc120enu\.dllzmfc120esn\.dllzmfc120fra\.dllzmfc120ita\.dllzmfc120jpn\.dllzmfc120kor\.dllzmfc120rus\.dllz vcomp120\.dllz msdia120\.dllzcasablanca120.winrt\.dllzzumosdk120.winrt\.dllzcasablanca120\.dllzapi-ms-win-core.*zapi-ms-win-crt.*z ucrtbase\.dllzconcrt140\.dllz msvcp140\.dllzmsvcp140_1\.dllzmsvcp140_2\.dllzmsvcp140_atomic_wait\.dllzmsvcp140_codecvt_ids\.dllzvccorlib140\.dllzvcruntime140\.dllzvcruntime140_1\.dllz vcamp140\.dllz vcomp140\.dllz msdia140\.dllz.py(?:thon(?:com(?:loader)?)?|wintypes)\d+\.dllz.*\.soz    .*\.dylibz#Microsoft\.Windows\.Common-Controlszlibc\.so(\..*)?zlibdl\.so(\..*)?zlibm\.so(\..*)?zlibpthread\.so(\..*)?zlibrt\.so(\..*)?zlibthread_db\.so(\..*)?zld-linux\.so(\..*)?zlibBrokenLocale\.so(\..*)?zlibanl\.so(\..*)?zlibcidn\.so(\..*)?zlibcrypt\.so(\..*)?zlibnsl\.so(\..*)?zlibnss_compat.*\.so(\..*)?zlibnss_dns.*\.so(\..*)?zlibnss_files.*\.so(\..*)?zlibnss_hesiod.*\.so(\..*)?zlibnss_nis.*\.so(\..*)?zlibnss_nisplus.*\.so(\..*)?zlibresolv\.so(\..*)?zlibutil\.so(\..*)?z5libE?(Open)?GLX?(ESv1_CM|ESv2)?(dispatch)?\.so(\..*)?zlibdrm\.so(\..*)?zlibxcb\.so(\..*)?zlibxcb-dri.*\.so(\..*)?z    libbz2\.azlibc\.azlibC\.az libcrypt\.azlibdl\.az
libintl\.azlibpthreads\.az    librt\\.az    librtl\.azlibz\.ac@seZdZdd„Zdd„ZdS)Ú ExcludeListcCst d t¡tj¡|_dS©Nú|)ÚreÚcompileÚjoinÚ    _excludesÚIÚregex©Úself©rúOd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\PyInstaller/depend/dylib.pyÚ__init__õszExcludeList.__init__cCs tr|j tj |¡¡SdSdS©NF)rrÚmatchÚosÚpathÚbasename©rÚlibnamerrrÚsearchøszExcludeList.searchN©Ú__name__Ú
__module__Ú __qualname__rrrrrrr    ôsr    c@seZdZdd„Zdd„ZdS)Ú IncludeListcCst d t¡tj¡|_dSr
)r r rÚ    _includesrrrrrrrszIncludeList.__init__cCs tr|j tj |¡¡SdSdSr)r$rrrrrrrrrrszIncludeList.searchNrrrrrr#sr#©Úutilc@seZdZdd„Zdd„ZdS)ÚMacExcludeListcCs
||_dS©N)Ú _exclude_list©rZglobal_exclude_listrrrrszMacExcludeList.__init__cCs"|j |¡}|r|St |¡SdSr()r)rr&Úin_system_path)rrÚresultrrrrs zMacExcludeList.searchNrrrrrr'sr'c@seZdZdd„Zdd„ZdS)ÚWinExcludeListcCs ||_tj t ¡ ¡¡|_dSr()r)rrÚnormpathrZget_windows_dirÚlowerÚ _windows_dirr*rrrr%szWinExcludeList.__init__cCsD| ¡}|j |¡}|r|Stj tj |¡ ¡¡}| |j¡SdSr()    r/r)rrrr.ÚrealpathÚ
startswithr0)rrr,Úfnrrrr*s  zWinExcludeList.searchNrrrrrr-$sr-cCsRtrt |¡rt |¡sdStjrNt |¡rN|tkrJt d|¡t     |¡dSdS)zR
    Check if the dynamic library should be included with application or not.
    FzExcluding Wine built-in DLL: %sT)
rrrrZ is_win_wineZ is_wine_dllÚ_seen_wine_dllsÚloggerÚwarningÚadd©rrrrr;s  
z(lib)?shiboken.*Zlddc@seZdZdd„Zdd„ZdS)Ú MissingLibWarningSuppressionListcCst d t¡tj¡|_dSr
)r r rÚ_warning_suppressionsrrrrrrrjsz)MissingLibWarningSuppressionList.__init__cCs tr|j tj |¡¡SdSdSr)r:rrrrrrrrrrmsz'MissingLibWarningSuppressionList.searchNrrrrrr9isr9cCs t |¡ S)zk
    Check if a missing-library warning should be displayed for the given library name (or full path).
    )Ú$missing_lib_warning_suppression_listrr8rrrÚwarn_missing_libxsr<c    sîddlm‰ddlm}tj |¡tkr,dSd‰tj |¡rdt    tj |¡ 
tj ¡ƒ}|tj tj ‰‡‡fdd„}||ƒ}|  |¡zPt|jdƒ:}|jD]}| d¡| |¡qš| dd    ¡| ¡W5QRXWntk
rèYnXdS)
aw
    On Mac OS set relative paths to dynamic library dependencies of `libname`.
 
    Relative paths allow to avoid using environment variable DYLD_LIBRARY_PATH. There are known some issues with
    DYLD_LIBRARY_PATH. Relative paths is more flexible mechanism.
 
    Current location of dependent libraries is derived from the location of the library path (paths start with
    '@loader_path').
 
    'distname'  path of the library relative to dist directory of frozen executable. We need this to determine the level
                of directory level for @loader_path of binaries not found in dist directory.
 
                For example, Qt5 plugins are not in the same directory as Qt*.dylib files. Without using
                '@loader_path/../..' for Qt plugins, Mac OS would not be able to resolve shared library dependencies,
                and Qt plugins will not be loaded.
    rr%)ÚMachONÚcsHˆ ˆ¡rdSddg}t‡fdd„|Dƒƒr0dStj dˆtj ˆ¡¡S)zT
        For system libraries is still used absolute path. It is unchanged.
        Nz"/Library/Frameworks/Tcl.framework/z!/Library/Frameworks/Tk.framework/csg|] }|ˆk‘qSrr)Ú.0Úx©ÚpthrrÚ
<listcomp>²szCmac_set_relative_dylib_deps.<locals>.match_func.<locals>.<listcomp>z @loader_path)r+Úanyrrrr)rBZ _exemptions©Ú
parent_dirr&rArÚ
match_func¡s
þz/mac_set_relative_dylib_deps.<locals>.match_funczrb+é)Úmacholibr&Zmacholib.MachOr=rrrÚ_BOOTLOADER_FNAMESÚdirnameÚlenÚsplitÚsepÚpardirZrewriteLoadCommandsÚopenÚfilenameÚheadersÚseekÚwriteÚflushÚ    Exception)rÚdistnamer=Z parent_levelrGÚdllÚfÚheaderrrErÚmac_set_relative_dylib_depss(   
 
 
  r[)-Ú__doc__Úos.pathrZPyInstaller.utils.win32rÚ__all__r ZPyInstaller.logÚlogÚloggingZ PyInstallerrÚ    getLoggerr r5rJrÚsetr$Z _win_includesZ _win_excludesZ_unix_excludesZ _aix_excludesZis_winZis_aixZis_unixr    r#rrZ    is_darwinrIr&r'r-r4rr:Zis_linuxÚappendZ    is_win_10r9r;r<r[rrrrÚ<module> sJ 
 
 ê
    ‹zú
ä ö 
 
 
!ü