ó
ß™xTc           @   sê   d  Z  d d l m Z d d l Td d l Td d l m Z d d l j Z	 d d l
 Z
 e	 j e	 j e	 j e ƒ ƒ ƒ Z e e
 j k r™ e
 j j e ƒ n  d e f d „  ƒ  YZ e
 j d „ Z e d	 k ræ e d
 e
 j d e
 j ƒ n  d S(   sK  
Automated build of CCTBX dependencies for Linux and Mac platforms.
This script will download and install the current Python distribution provided
by LBL, plus any packages required for various CCTBX-dependent apps to
function.  In the future this will be used as the core of the CCI nightly build
system and the Phenix installer.
iÿÿÿÿ(   t   division(   t   *(   t   OptionParserNt	   installerc           B   s1  e  Z e Z e Z e Z e Z e j d  „ Z	 d „  Z
 d d „ Z d d d d „ Z d d „ Z d „  Z d d „ Z d „  Z d d	 „ Z d d d
 „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d d d d „ Z e d „ Z d d „ Z d „  Z d „  Z d „  Z d „  Z  d „  Z! d „  Z" d „  Z# RS(   c         C   s  t  ƒ  | |  _ | d IJt j t j t j t ƒ ƒ ƒ } t ƒ  } | j d d d d d d d d	 t j ƒ  ƒ| j d
 d d d d d d d	 t j	 t j ƒ  d ƒ ƒ| j d d d d d d d d d d d	 d ƒ| j d d d d d d d d d	 t
 ƒ| j d d d d d d d d	 d  ƒ| j d d d d d d d  d	 t
 ƒ| j d! d d" d d d d# d	 |  j ƒ| j d$ d d% d d d d& d	 |  j ƒ| j d' d d( d d d d) d	 |  j ƒ| j d* d d+ d d d d, d	 |  j ƒ| j d- d. d d/ d d d d0 d	 t
 ƒ| j d1 d d2 d d d d3 d	 t
 ƒ| j d4 d d5 d d d d6 ƒ| j d7 d d8 d d d d9 d	 t
 ƒ| j d: d d; d d d d< d	 t
 ƒ| j d= d> d d? d d d d@ d	 t
 ƒ| j dA d dB d d d dC d	 t
 ƒ| j dD d dE d d d	 t
 d dF ƒ| j dG d d d dH ƒ| j | ƒ \ } } | j |  _ | j |  _ | j |  _ t j	 |  j dI ƒ |  _ | j r¤t j j |  j ƒ r¤| dJ IJd  S| dK IJxM |  j |  j |  j g D]3 } t j | ƒ sÇ| dL | IJt j | ƒ qÇqÇW| j |  _ | j |  _ | |  _ t
 |  _ d  |  _ g  |  _ g  |  _  t! j" j# dM ƒ |  _$ t! j" dN k |  _% t j& j' dO dP ƒ |  _( t j& j' dQ dP ƒ |  _) t* dR |  j dS | d | j dB | j+ ƒ |  _, |  j- ƒ  t! j" dN k r| dT IJt. t j	 |  j dU ƒ dS | ƒn  d  S(V   Ns  
  ****************************************************************************
                 Automated CCTBX dependencies build script
                 report problems to cctbx-dev@cci.lbl.gov
  ****************************************************************************
s   --build_dirt   destt	   build_dirt   actiont   storet   helps   Build directoryt   defaults	   --tmp_dirt   tmp_dirs   Temporary directoryt	   build_tmps   -ps   --nproct   nproct   typet   ints   Number of processorsi   s   -vs	   --verboset   verboset
   store_trues   Verbose outputs	   --pkg_dirt   pkg_dirst   appends   Directory with source packagess   --basict   basics    Only install basic prerequisitess	   --labelitt   labelits   Build LABELIT dependenciess   --xia2t   xia2s   Build xia2 dependenciess   --dialst   dialss   Build DIALS dependenciess   --guit	   build_guis   Build GUI dependenciess   -as   --allt	   build_alls"   Build all recommended dependenciess   --scipyt   build_scipys'   Build SciPy (requires Fortran compiler)s   --sphinxt   build_sphinxs8   Build Sphinx (and numpydoc) for generating documentations	   --ipythont   build_ipythons   Build IPythons
   --pyopenglt   build_pyopengls   Build PyOpenGLs   -gs   --debugt   debugs   Build in debugging modes   --no-downloadt   no_downloads&   Use only local packages (no downloads)s   --python-sharedt   python_shareds-   Compile Python as shared library (Linux only)s   --skip-if-existss:   Exit if build_dir/base exists; used with automated builds.t   bases@   Base directory already exists and --skip-if-exists set; exiting.s   Setting up directories...s     creating %st   linuxt   darwint   CPPFLAGSt    t   LDFLAGSt   dest_dirt   logs,   Regenerating symlinks with relative paths...t   bin(/   t   check_python_versionR'   t   opt   dirnamet   __file__R   t
   add_optiont   ost   getcwdt   joint   Falset   Nonet   build_labelit_dependenciest   build_xia2_dependenciest   build_dials_dependenciest   build_gui_dependenciest
   parse_argsR
   R   R   t   base_dirt   skip_if_existst   patht   existst   isdirt   makedirsR   R   t   optionst   have_freetypet
   python_exet   include_dirst   lib_dirst   syst   platformt
   startswitht   flag_is_linuxt   flag_is_mact   environt   gett   cppflags_startt   ldflags_startt   fetch_packagesR   t   fetch_packaget   build_cctbx_dependenciest   regenerate_relative_symlinks(   t   selft   argsR'   t   dist_dirt   parserR>   t   dir_name(    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyt   __init__   s     	!	


							

c      	   C   s¨  |  j  d IJ|  j ƒ  t j |  j ƒ |  j } t rC |  j ƒ  n  t j	 |  j
 ƒ sd t |  j
 ƒ ‚ | j s	x$ d d d g D] } d t j | <q} W|  j d t d t d d	 d
 d	 ƒ |  j d t d t d d d
 d ƒ | j r	|  j d t d t d d d
 d ƒ q	n  | j s$| j s$| j r‡t j d k rX|  j d t d t d d d
 d ƒ n  |  j ƒ  |  j d t d t d d d
 d ƒ n  | j s«| j s«| j s«| j r¸|  j ƒ  n  | j sÊ| j rë|  j ƒ  |  j  ƒ  |  j! ƒ  n  | j" r;|  j d t d t# d d d
 d ƒ |  j d t d t$ d d d
 d  ƒ n  | j& ri|  j d t d t' d d d
 d ƒ n  | j( r—|  j d t d t) d d d
 d ƒ n  |  j  d IJd  S(   Ns#   *** Building dependencies first ***t   BLASt   ATLASt   LAPACKR2   t   pkg_urlt   pkg_namet   pkg_name_labelt   numpyt   confirm_import_modulet	   BioPythont   Biot   SciPyt   scipyR"   t   py2appt	   reportlabt   Sphinxt   sphinxt   numpydoct   IPythont   PyOpenGLt   OpenGLs   Dependencies finished building.(*   R'   t	   print_sepR.   t   chdirR
   R>   t   Truet   build_pythonR*   R;   R@   t   AssertionErrorR   RH   t   build_python_module_simplet   BASE_CCI_PKG_URLt	   NUMPY_PKGt   BIOPYTHON_PKGR   t	   SCIPY_PKGR   R   R   RC   RD   t
   PY2APP_PKGt   build_imagingt   REPORTLAB_PKGR   R   t
   build_hdf5t   build_wxpython_dependenciest   build_wxpythont
   build_miscR   t
   SPHINX_PKGt   NUMPYDOC_PKGR2   R   t   IPYTHON_PKGR   t   PYOPENGL_PKG(   RP   R>   t   env_var(    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyRN   {   sŒ    
	!						

	
	

			
		
		
c         C   s(   | d  k r |  j } n  t | d | ƒS(   NR'   (   R2   R'   t   call(   RP   RQ   R'   (    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyR€   Æ   s     c         C   sl   |  j  d d j t | ƒ ƒ d | ƒ|  j  d |  j d j t | ƒ ƒ f d | ƒ|  j  d d | ƒd  S(   Ns   ./configure %st    R'   s   make -j %d %ss   make install(   R€   R0   t   listR   (   RP   t   config_argsR'   t	   make_args(    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyt   configure_and_buildÊ   s    &/c         C   s7   | d  k r |  j } n  | d | IJt j | ƒ d  S(   Ns   cd "%s"(   R2   R'   R.   Rk   (   RP   RT   R'   (    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyRk   Ï   s     c         C   s?   t  | d ƒ } | j d ƒ | j ƒ  t j | ƒ s; t ‚ d  S(   Nt   wR$   (   t   opent   writet   closeR*   t   isfileRn   (   RP   t	   file_namet   f(    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyt
   touch_fileÔ   s    
t   -c         C   s/   |  j  d IJ|  j  | d IJ|  j  d IJd  S(   NR$   iP   (   R'   (   RP   t   char(    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyRj   Ú   s    c         C   sX   t  j |  j ƒ t j |  j | d ƒ } |  j d | IJ|  j d | IJt | d ƒ S(   Nt   _install_logs   Installing %s...s     log file is %sR†   (   R.   Rk   R
   R*   R0   R'   R‡   (   RP   RZ   t   install_log(    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyt   start_building_packageß   s
    c         C   s$  t  | t ƒ r9 t  | t ƒ s$ t ‚ | g } | g } n  t | ƒ t | ƒ k sW t ‚ | } | d  k r† | d 7} t j | | ƒ n  t | ƒ } | d  k r§ | } n  t | d ƒ } xS | j ƒ  D]E } x/ t	 | | ƒ D] \ }	 }
 | j
 |	 |
 ƒ } qÙ W| j | ƒ qÃ W| j ƒ  | j ƒ  d  S(   Ns   .distR†   (   t
   isinstancet   strRn   t   lenR2   R.   t   renameR‡   t	   readlinest   zipt   replaceRˆ   R‰   (   RP   t   src_filet   targett   replace_witht   output_filet   in_filet   src_int   src_outt   linet
   target_strt   replacement_str(    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyt	   patch_srcæ   s&    	
	
c         C   sS   | d  k r |  j } n  |  j d | d | ƒ } t | d | ƒ} t j | ƒ d  S(   NRZ   RY   R'   (   R2   R'   RM   t   untarR.   Rk   (   RP   RZ   RY   R'   t   pkgt   pkg_dir(    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyt   fetch_untar_and_chdirû   s
     c         C   s»  |  j  d ƒ } t j |  j ƒ |  j t ƒ } t | ƒ } |  j | d | ƒt j d k r#d |  j	 d |  j	 g } |  j
 d d j | ƒ d | ƒ|  j
 d |  j d | ƒd	 } |  j
 d
 | d | ƒ|  j d d | ƒ|  j
 d d | ƒ|  j | d | ƒ|  j
 d |  j	 d | ƒnB d |  j	 g } |  j j rO| j d ƒ n  |  j d | d | ƒ | j ƒ  t j t j |  j	 d d ƒ ƒ |  _ |  j ƒ  |  j d d ƒ |  j ƒ  d  S(   Nt   PythonR'   R"   s   --prefix="%s"s   --enable-framework="%s"s   ./configure %sR�   s
   make -j %ds;   bininstall libinstall libainstall inclinstall sharedinstalls   make %st   Macs:   make install_Python install_pythonw install_versionedtoolssu   make frameworkinstallstructure frameworkinstallmaclib         frameworkinstallunixtools FRAMEWORKUNIXTOOLSPREFIX="%s"s   --enable-sharedRƒ   R(   t   pythont   socket(   R’   R.   Rk   R
   RM   t
   PYTHON_PKGR¥   RC   RD   R8   R€   R0   R   R>   R   R   R…   R‰   R*   t   abspathR@   t   update_pathst   verify_python_moduleRj   (   RP   R'   t   python_tarballt
   python_dirt   configure_argst   targets(    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyRm     s8    
 
$
c         C   s1  d |  j  t j d t j d <t j |  j  d ƒ g } t j d k r™ | j d |  j  ƒ d t j k r€ | j t j d ƒ n  d j | ƒ t j d <n< d t j k r¿ | j t j d ƒ n  d j | ƒ t j d <t j |  j  d	 ƒ } t j | ƒ s	t j	 | ƒ n  |  j
 j | ƒ |  j j | d
 ƒ d  S(   Ns   %s/bin:t   PATHt   libR"   s-   %s/base/Python.framework/Versions/Current/libt   DYLD_LIBRARY_PATHt   :t   LD_LIBRARY_PATHt   includei    (   R8   R.   RH   R*   R0   RC   RD   R   R<   t   mkdirRA   RB   (   RP   t	   lib_pathst   inc_dir(    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyR¯   #  s     	c         C   sŠ   g  |  j  D] } d | ^ q
 } g  |  j D] } d | ^ q* } d d j | ƒ |  j f t j d <d d j | ƒ |  j f t j d <d  S(   Ns   -I%ss   -L%ss   %s %sR�   R#   R%   (   RA   RB   R0   RJ   R.   RH   RK   (   RP   t   pt	   inc_pathsR¼   (    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyt   set_cppflags_ldflags_tmp6  s
      c         C   s$   |  j  t j d <|  j t j d <d  S(   NR#   R%   (   RJ   R.   RH   RK   (   RP   (    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyt   restore_cppflags_ldflags?  s    c         C   sO   t  j |  j ƒ |  j j d | ƒ |  j d |  j | f ƒ |  j d IJd  S(   Ns     verifying %s installation...s   %s -c 'import %s's    OK(   R.   Rk   R
   R'   Rˆ   R€   R@   (   RP   R[   t   module_name(    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyR°   C  s    c   
      C   s  |  j  | ƒ } |  j d | d | d | ƒ } | d  k	 rT | | ƒ sT t | ƒ ‚ n  d }	 |  j j ro d }	 n  |  j d |  j |	 f d | ƒ|  j d |  j d | ƒ| d  k	 rÐ | | ƒ sÐ t | ƒ ‚ n  t j	 |  j
 ƒ | d  k	 rÿ |  j | | ƒ n  |  j ƒ  d  S(   NRZ   RY   R'   R$   s   --debugs   %s setup.py build %ss   %s setup.py install(   R’   R¨   R2   Rn   R>   R   R€   R@   R.   Rk   R
   R°   Rj   (
   RP   RY   RZ   R[   t   callback_before_buildt   callback_after_buildR]   t   pkg_logR¦   t
   debug_flag(    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyRo   I  s"    		c            sZ   ˆ  j  ƒ  ‡  f d †  } d  } | r. | } n  ˆ  j d t d t d d d | d d ƒ d  S(	   Nc            sn   |  d IJˆ  j  d d d d d d ƒ t d d	 ƒ } | j d
 t j ˆ  j d ƒ t j ˆ  j d ƒ f ƒ t S(   Ns!     patching libImaging/ZipEncode.cRš   s   libImaging/ZipEncode.cR›   t   Z_DEFAULT_COMPRESSIONRœ   t   Z_BEST_SPEEDs   setup_site.pyR†   s   FREETYPE_ROOT = "%s", "%s"
R¶   Rº   (   R¤   R‡   Rˆ   R*   R0   R8   Rl   (   t   outt	   site_file(   RP   (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyt   patch_imaging_srcd  s    
	,RY   RZ   R[   t   ImagingRÃ   R]   t   Image(   t   build_freetypeR2   Ro   Rp   t   IMAGING_PKG(   RP   R¤   RË   t   callback(    (   RP   sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyRu   b  s    

		c         C   s[   |  j  | ƒ } |  j d | d | d | ƒ } |  j d d |  j g d | ƒ |  j ƒ  d  S(   NRZ   RY   R'   Rƒ   s   --prefix="%s"(   R’   R¨   R…   R8   Rj   (   RP   RZ   R[   RY   RÅ   R¦   (    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyt   build_compiled_package_simplex  s    		c         C   sæ   |  j  d ƒ } |  j d t d t d | ƒ | d IJ|  j d d |  j g d | ƒ | d IJt j |  j ƒ |  j d t d t	 d | ƒ |  j
 d	 |  j |  j f d | ƒ|  j
 d
 |  j d | ƒ|  j d d ƒ |  j ƒ  d  S(   Nt   HDF5RZ   RY   R'   s   Building base HDF5 library...Rƒ   s   --prefix="%s"s   Building h5py...s   %s setup.py build --hdf5="%s"s   %s setup.py installt   h5py(   R’   R¨   t   HDF5_PKGt   BASE_XIA_PKG_URLR…   R8   R.   Rk   R
   t   H5PY_PKGR€   R@   R°   Rj   (   RP   RÅ   (    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyRw   „  s     
	
c         C   s[   |  j  s t ‚ |  j d t d t d d ƒ |  j j t j |  j	 d d ƒ ƒ t
 |  _  d  S(   NRY   RZ   R[   t   FreetypeRº   t	   freetype2(   R?   Rn   RÑ   Rp   t   FREETYPE_PKGRA   R   R*   R0   R8   Rl   (   RP   (    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyRÎ   ˜  s    	
c         C   sÄ   |  j  s |  j ƒ  n  |  j d t d t d d ƒ t j d k r¶ t j |  j	 d ƒ } xg t
 j | ƒ D]I } d | j ƒ  k rf | j d ƒ rf t j | | ƒ } t
 j | ƒ qf qf Wn
 |  j ƒ  d  S(	   NRY   RZ   R[   t   libpngR"   R¶   t   pngs   .dylib(   R?   RÎ   RÑ   Rp   t
   LIBPNG_PKGRC   RD   R*   R0   R8   R.   t   listdirt   lowert   endswitht   removet!   build_wxpython_dependencies_linux(   RP   t   lib_dirR‹   t	   full_path(    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyRx   ¢  s    		!c      
      s[  t  j ˆ j d d ƒ } t  j | ƒ s7 t j | ƒ n  | g t j j d g  ƒ } d j | ƒ t j d <d ˆ j } ˆ j d ƒ } ˆ j	 d t
 d | ƒ t j d	 ƒ ˆ j ƒ  | d
 d d d g } ˆ j d | d | ƒ ˆ j ƒ  ˆ j d ƒ } ˆ j	 d t d | ƒ t  j ˆ j d d ƒ ‰ t  j ˆ j d d ƒ ‰  ‡  ‡ ‡ f d †  } | ƒ  g  } ˆ j j rz| j d ƒ n  ˆ j d | g d | d | ƒ t j ˆ ƒ t j ˆ  ƒ ˆ j ƒ  ˆ j d ƒ }	 ˆ j	 d t d |	 ƒ ˆ j d | g d |	 ƒ d d g }
 x: |
 D]2 } ˆ j d | t  j ˆ j d ƒ f d |	 ƒqWˆ j ƒ  ˆ j d ƒ } ˆ j	 d t d | ƒ t  j t  j ˆ j d d ƒ ƒ s¶t j t  j ˆ j d d ƒ ƒ n  t  j t  j ˆ j d d ƒ ƒ sùt j t  j ˆ j d d ƒ ƒ n  | d d  t  j ˆ j d ƒ d! t  j ˆ j d ƒ d" t  j ˆ j d d ƒ d# t  j ˆ j d d ƒ d$ t  j ˆ j d% ƒ d& g } ˆ j d | d | ƒ ˆ j ƒ  xE t t t t g d' d( d) g ƒ D]" \ } } ˆ j d | d* | ƒ q¾Wˆ j d+ ƒ } ˆ j	 d t d | ƒ ˆ j d | d, g d | d | ƒ ˆ j ƒ  xE t t t t g d- d. d/ g ƒ D]" \ } } ˆ j d | d* | ƒ qWWˆ j d0 ƒ } ˆ j	 d t  d | ƒ d1 t j d2 <t  j ˆ j d3 ƒ t j d4 <| d5 d6 d7 g } ˆ j d | d | d | ƒ ˆ j ƒ  | ƒ  ˆ j d8 ƒ } ˆ j	 d t! d | ƒ | d9 d: g } ˆ j d; d< j | ƒ d | ƒˆ j d= ˆ j" d | ƒˆ j d> d | ƒt j ˆ ƒ t j ˆ  ƒ ˆ j ƒ  ˆ j d t# d* d? ƒ ˆ j d ƒ } t  j ˆ j d ƒ } t  j | ƒ st j | ƒ n  ˆ j$ d t% ƒ } t j | ƒ t& | d | d@ t' ƒˆ j ƒ  t j ˆ j( ƒ d  S(A   NR¶   t	   pkgconfigt   PKG_CONFIG_PATHR¸   s   --prefix="%s"t   gettextRZ   R'   s   gettext-runtimes   --disable-javas   --disable-csharps   --disable-intl-javas   --disable-gcjRƒ   t   glibR(   t   msgfmtt   xgettextc              s@   ˆ j  ˆ ƒ ˆ j  ˆ  ƒ ˆ j d ˆ ƒ ˆ j d ˆ  ƒ d  S(   Ns   chmod 744 "%s"(   R�   R€   (    (   t   gettext_bint
   msgfmt_binRP   (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyt   touch_bin_filesÈ  s    s	   CFLAGS=-gR„   t   expats   ./lib/expat_external.hs   ./lib/expat.hs(   ./conftools/install-sh -c -m 644 %s "%s"Rº   t
   fontconfigt   sharet   fontst   etcs   --disable-docss   --with-expat-includes="%s"s   --with-expat-lib="%s"s   --with-add-fonts="%s"s   --with-confdir="%s"s   --with-docdir="%s"t   docs&   --with-freetype-config=freetype-configt   rendert   Xrendert   XftR[   t   pixmans   --disable-gtkt   cairot   pangot   atkt   tiffs   bsd-source-catt	   MANSCHEMEt   mant   DIR_MANs   --noninteractives   --with-LIBGL=nos   --with-LIBIMAGE=nos   gtk+s   --disable-cupss   --without-libjpegs   ./configure %sR�   s3   make -j %d SRC_SUBDIRS='gdk-pixbuf gdk gtk modules's5   make install SRC_SUBDIRS='gdk-pixbuf gdk gtk modules's
   gtk-engineR   ()   R*   R0   R8   R<   R.   R=   RH   RI   R’   R¨   t   GETTEXT_PKGRk   RÀ   R…   Rj   t   GLIB_PKGR>   R   R   Rà   t	   EXPAT_PKGR€   t   FONTCONFIG_PKGR˜   t
   RENDER_PKGt   XRENDER_PKGt   XFT_PKGRÑ   t
   PIXMAN_PKGt	   CAIRO_PKGt	   PANGO_PKGt   ATK_PKGt   TIFF_PKGt   GTK_PKGR   t   GTK_ENGINE_PKGRM   t   FONT_PKGR¥   Rl   R
   (   RP   t   pkg_config_dirt   pkg_config_pathst
   prefix_argRÅ   t   gettext_conf_argst   glib_logRì   R„   t	   expat_logt   header_filest   headert   fc_logt   fc_config_argsR¦   t   namet   pix_logt   tiff_logRƒ   t   gtk_logt   gtk_config_argst	   fonts_logt	   share_dir(    (   Rê   Rë   RP   sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyRá   ³  sÎ    
	
 		
$
!"!"	
	
			
	 	

c   
      C   sB  |  j  d ƒ } t } t } |  j rR t ƒ  d k rR |  j d IJt } t } qR n  |  j | ƒ } t	 | d | ƒ} t
 j | ƒ d d d |  j g } |  j j rÑ | j d d	 g ƒ |  j rä | j d
 ƒ qä n | j d d g ƒ | r| j d d d d g ƒ d t
 j d <n^ |  j r2| j d d g ƒ n? |  j rq| j d d |  j d t j |  j d ƒ d g ƒ n  |  j ƒ  |  j d IJx | D] } |  j d | IJq�W|  j d d j | ƒ d | ƒ|  j d |  j d | ƒ| s|  j d |  j d | ƒn  |  j d d | ƒd  d! d" d# g } | rUd$ t
 j d% <| j d& d' g ƒ n | j d( d) g ƒ |  j d d | ƒd* }	 |  j j r–d+ }	 n  |  j d, IJx | D] } |  j d | IJqªW|  j d- |  j d j | ƒ |	 f d | ƒ|  j d. |  j d j | ƒ f d | ƒ|  j ƒ  |  j d d/ ƒ |  j ƒ  d  S(0   Nt   wxPythoni
   s/     running OS 10.6 or later, switching to wx 3.0R'   s   --disable-mediactrls   --with-opengls   --prefix="%s"s   --disable-optimizes   --enable-debugs   --disable-debug_gdbs   --enable-optimizes   --disable-debugreports   --with-osx_cocoas   --enable-monolithics   --with-macosx-version-min=10.6s   --enable-unicodes5   -DMAC_OS_X_VERSION_MIN_REQUIRED=MAC_OS_X_VERSION_10_6t   CXXFLAGSs
   --with-macs
   --with-gtks   --with-gtk-prefix="%s"s   --with-gtk-exec-prefix="%s"R¶   s   --enable-graphics_ctxs"     building wxWidgets with options:s       %ss   ./configure %sR�   s
   make -j %ds   make -j %d -C contrib/src/stcs   make installs   BUILD_GLCANVAS=1s   BUILD_STC=0s   BUILD_GIZMOS=0s   BUILD_DLLWIDGET=0s   -arch x86_64t   CFLAGSs   WXPORT=osx_cocoas	   UNICODE=1s   BUILD_OGL=0s	   UNICODE=0R$   s   --debugs!     building wxPython with options:s   %s setup.py %s build %ss   %s setup.py %s installt   wx(   R’   t   WXPYTHON_PKGR1   RG   t   detect_osx_versionR'   t   WXPYTHON_DEV_PKGRl   RM   R¥   R.   Rk   R8   R>   R   t   extendRF   R   RH   R*   R0   RÀ   R€   R   R@   RÁ   R°   Rj   (
   RP   RÅ   RZ   t   cocoaR¦   R§   t   config_optst   optt   wxpy_build_optsRÆ   (    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyRy   ,  s|    				

 		
c            sq   ˆ  j  d t d t d d d d ƒ ˆ  j ƒ  ‡  f d †  } ˆ  j  d t d t d d d | d d	 ƒ ˆ  j ƒ  d  S(
   NRY   RZ   R[   t   PyRTFR]   c            s=   |  d IJˆ  j  d d d d d d d	 d
 d ˆ  j f ƒ t S(   Ns     patching setup.cfgRš   s   setup.cfg.templateR�   s	   setup.cfgR›   s   #backend = Aggs   #basedirlist = /usrRœ   s   backend = WXAggs   basedirlist = /usr, %s(   s   #backend = Aggs   #basedirlist = /usr(   R¤   R8   Rl   (   RÉ   (   RP   (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyt   patch_matplotlib_src�  s    
t
   MatplotlibRÃ   t
   matplotlib(   Ro   Rp   t	   PYRTF_PKGRÀ   t   MATPLOTLIB_PKGRÁ   (   RP   R+  (    (   RP   sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyRz   x  s    	
	c         C   s   t  ƒ  ‚ d  S(   N(   t   NotImplementedError(   RP   (    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyt   write_dispatcher_include’  s    N(    (    ($   t   __name__t
   __module__R1   R4   R6   R3   R5   RC   t   stdoutRU   RN   R2   R€   R…   Rk   R�   Rj   R’   R¤   R¨   Rm   R¯   RÀ   RÁ   R°   Ro   Rl   Ru   RÑ   Rw   RÎ   Rx   Rá   Ry   Rz   R1  (    (    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyR      s>   ^	K			"					
			
		y	L	c         C   s†   y t  d d g d |  ƒWn t k
 r. d SXy t  d d g d |  ƒWn t k
 r] d SXt j d ƒ r‚ t j d ƒ r‚ d	 Sd  S(
   Ns
   pkg-configs	   --versionR'   s±   
ERROR The GUI components require pkg-config to build
Please install pkg-config to compile these components or use the --no-gui
option to disable compilation of GUI components.
t   bashsŸ   
ERROR: The GUI requires bash to be available to build
Please install bash to compile these components, or use the --no-gui option
to disable GUI compilation.
s   /usr/include/X11/X.hs   /usr/X11R6/include/X11/X.hsµ   
ERROR: The X-windows headers appear to be missing
Please install the X11 development packages to compile the GUI components,
or use the --no-gui option to disable GUI compilation.
(   R€   t   RuntimeErrorR*   R;   R2   (   R'   (    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyt!   check_wxpython_build_dependencies•  s    t   __main__RQ   R'   (   t   __doc__t
   __future__R    t   installer_utilst   package_defst   optparseR   t   os.pathR:   R*   RC   R®   R+   R,   t   libtbx_pathR   t   objectR   t   stderrR7  R2  t   argvR4  (    (    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/install_base_packages.pyt   <module>   s   

!ÿ ÿ �