ó
• –Qc           @   s§  d  Z  d d d g Z d d l Z d d l Z d d l m Z m Z m Z m Z d d l	 j
 Z e j e ƒ Z e d d d	 d
 g ƒ Z i  Z i  Z i d d 6Z i d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d  6d d! 6d d" 6Z i
 d d# 6d d$ 6d d% 6d d& 6d d' 6d d( 6d d) 6d d* 6d d+ 6d d, 6Z e rýe Z d d- l m Z d. e j e j e j ƒ Z e j e j ƒ  ƒ Z d e d/ e e f <d e d0 e <n e re Z n e re Z n  d1 e f d2 „  ƒ  YZ d3 e f d4 „  ƒ  YZ e ƒ  Z  e ƒ  Z! e r‘d d5 l" m# Z# d6 e f d7 „  ƒ  YZ$ e$ ƒ  Z  n  d8 „  Z% d9 „  Z& d S(:   s&   
Manipulating with dynamic libraries.
t   exclude_listt   include_listt   include_libraryiÿÿÿÿN(   t   is_wint   is_unixt   is_aixt	   is_darwint   runt   run_dt   runwt   runw_di   s%   ^Microsoft\.Windows\.Common-Controls$s   /libc\.so\..*s   /libdl\.so\..*s   /libm\.so\..*s   /libpthread\.so\..*s   /librt\.so\..*s   /libthread_db\.so\..*s   /libdb-.*\.sos   /ld-linux\.so\..*s   /libBrokenLocale\.so\..*s   /libanl\.so\..*s   /libcidn\.so\..*s   /libcrypt\.so\..*s   /libnsl\.so\..*s   /libnss_compat.*\.so\..*s   /libnss_dns.*\.so\..*s   /libnss_files.*\.so\..*s   /libnss_hesiod.*\.so\..*s   /libnss_nis.*\.so\..*s   /libnss_nisplus.*\.so\..*s   /libresolv\.so\..*s   /libutil\.so\..*s
   /libGL\..*s
   /libbz2\.as   /libc\.as   /libC\.as   /libcrypt\.as	   /libdl\.as   /libintl\.as   /libpthreads\.as
   /librt\\.as
   /librtl\.as   /libz\.a(   t   winutilss   [%s]s   ^%s%ss1   %spy(?:thon(?:com(?:loader)?)?|wintypes)\d+\.dll$t   ExcludeListc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s+   t  j d j t j ƒ  ƒ t  j ƒ |  _ d  S(   Nt   |(   t   ret   compilet   joint	   _excludest   keyst   It   regex(   t   self(    (    s[   C:\Users\Salopaasi\My Documents\pyinstaller-pyinstaller-275d4c9\PyInstaller\depend\dylib.pyt   __init__l   s    c         C   s   t  r |  j j | ƒ St Sd  S(   N(   R   R   t   searcht   False(   R   t   libname(    (    s[   C:\Users\Salopaasi\My Documents\pyinstaller-pyinstaller-275d4c9\PyInstaller\depend\dylib.pyR   o   s    (   t   __name__t
   __module__R   R   (    (    (    s[   C:\Users\Salopaasi\My Documents\pyinstaller-pyinstaller-275d4c9\PyInstaller\depend\dylib.pyR   k   s   	t   IncludeListc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s+   t  j d j t j ƒ  ƒ t  j ƒ |  _ d  S(   NR   (   R   R   R   t	   _includesR   R   R   (   R   (    (    s[   C:\Users\Salopaasi\My Documents\pyinstaller-pyinstaller-275d4c9\PyInstaller\depend\dylib.pyR   x   s    c         C   s   t  r |  j j | ƒ St Sd  S(   N(   R   R   R   R   (   R   R   (    (    s[   C:\Users\Salopaasi\My Documents\pyinstaller-pyinstaller-275d4c9\PyInstaller\depend\dylib.pyR   {   s    (   R   R   R   R   (    (    (    s[   C:\Users\Salopaasi\My Documents\pyinstaller-pyinstaller-275d4c9\PyInstaller\depend\dylib.pyR   w   s   	(   t   utilt   MacExcludeListc           B   s   e  Z d  „  Z RS(   c         C   s   t  j | ƒ S(   N(   R   t   in_system_path(   R   R   (    (    s[   C:\Users\Salopaasi\My Documents\pyinstaller-pyinstaller-275d4c9\PyInstaller\depend\dylib.pyR   Œ   s    (   R   R   R   (    (    (    s[   C:\Users\Salopaasi\My Documents\pyinstaller-pyinstaller-275d4c9\PyInstaller\depend\dylib.pyR   ‹   s   c         C   s8   t  r0 t  j |  ƒ r) t j |  ƒ r) t St Sn t Sd S(   sP   
    Check if a dynamic library should be included with application or not.
    N(   R    R   R   R   t   True(   R   (    (    s[   C:\Users\Salopaasi\My Documents\pyinstaller-pyinstaller-275d4c9\PyInstaller\depend\dylib.pyR   ’   s
    c            s:  d d l  m ‰  d d l m } t j j |  ƒ t k r< d Sd ‰ t j j | ƒ r t	 t j j | ƒ j
 t j ƒ ƒ } | t j t j ‰ n  ‡  ‡ f d †  } | |  ƒ } | j | ƒ yh t | j d ƒ } x+ | j D]  } | j d ƒ | j | ƒ qÙ W| j d d	 ƒ | j ƒ  | j ƒ  Wn t k
 r5n Xd S(
   s™  
    On Mac OS X 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 dependend 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.

                E.g. qt4 plugins are not in the same directory as Qt*.dylib
                files. Without using '@loader_path/../..' for qt plugins
                Mac OS X would not be able to resolve shared library
                dependencies and qt plugins will not be loaded.
    iÿÿÿÿ(   R   (   t   MachONt    c            s5   ˆ  j  |  ƒ s1 t j j d ˆ t j j |  ƒ ƒ Sd S(   sT   
        For system libraries is still used absolute path. It is unchanged.
        s   @loader_pathN(   R    t   ost   pathR   t   basename(   t   pth(   R   t
   parent_dir(    s[   C:\Users\Salopaasi\My Documents\pyinstaller-pyinstaller-275d4c9\PyInstaller\depend\dylib.pyt
   match_funcÌ   s    s   rb+i    i   (   t   PyInstaller.lib.macholibR   t   PyInstaller.lib.macholib.MachOR"   R$   R%   R&   t   _BOOTLOADER_FNAMESt   dirnamet   lent   splitt   sept   pardirt   rewriteLoadCommandst   opent   filenamet   headerst   seekt   writet   flusht   closet	   Exception(   R   t   distnameR"   t   parent_levelR)   t   dllt   ft   header(    (   R   R(   s[   C:\Users\Salopaasi\My Documents\pyinstaller-pyinstaller-275d4c9\PyInstaller\depend\dylib.pyt   mac_set_relative_dylib_deps¥   s*    $
('   t   __doc__t   __all__R$   R   t   PyInstaller.compatR   R   R   R   t   PyInstaller.logt   logt   loggingt	   getLoggerR   t   loggert   setR,   R   R   t   _win_excludest   _unix_excludest   _aix_excludest   PyInstaller.utilsR   t   escapeR0   t   altsept   get_windows_dirt   windirt   objectR   R   R    R   R*   R   R   R   R@   (    (    (    s[   C:\Users\Salopaasi\My Documents\pyinstaller-pyinstaller-275d4c9\PyInstaller\depend\dylib.pyt   <module>   s„   "


					