ó
à™xTc           @   sé  d  Z  d d l m Z d d l Td d l Z d d l j Z d d l Z d d l	 Z	 d Z
 d Z d Z d Z d	 Z d
 Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z  d Z! d Z" d Z# d Z$ d  Z% d! Z& d" Z' d# Z( d$ Z) d% Z* d& Z+ d' Z, d( Z- d) Z. d* Z/ d+ Z0 i dH d. 6dI d0 6dJ d2 6Z1 i d3 d4 6d5 d6 6d7 d8 6d9 d: 6d; d< 6d= d> 6d? d@ 6dA dB 6Z2 dC e3 f dD „  ƒ  YZ4 d e6 e6 e6 dE „ Z7 d e6 e8 dF „ Z9 e	 j: e8 dG „ Z; d S(K   s²   
Listing of current dependencies for CCTBX and related applications (including
LABELIT, xia2, DIALS, and Phenix with GUI).  Not all of these can be downloaded
via the web (yet).
iÿÿÿÿ(   t   division(   t   *Ns%   http://cci.lbl.gov/cctbx_dependenciess   http://www.ccp4.ac.uk/xias   Python-2.7.6_cci.tar.gzs   numpy-1.8.1.tar.gzs   Imaging-1.1.7.tar.gzs   reportlab-2.6.tar.gzs   zlib-1.2.7.tar.gzs   scipy-0.14.0.tar.gzs   PyRTF-0.45.tar.gzs   biopython-1.64.tar.gzs   Sphinx-1.2.2.tar.gzs   numpydoc-0.5.tar.gzs   ipython-2.1.0.tar.gzs   hdf5-1.8.8.tar.bz2s   h5py-2.0.1-edit.tar.gzs   libpng-1.2.32.tar.gzs   freetype-2.4.2.tar.gzs   gettext-0.18.2.tar.gzs   glib-2.12.11.tar.gzs   expat-1.95.8.tar.gzs   fontconfig-2.3.95.tar.gzs   render-0.8.tar.gzs   xrender-0.8.3.tar.gzs   xft-2.1.2.tar.gzs   pixman-0.19.2.tar.gzs   cairo-1.8.10.tar.gzs   pango-1.16.1.tar.gzs   atk-1.9.1.tar.gzs   tiff-v3.6.1.tar.gzs   gtk+-2.10.11.tar.gzs   clearlooks-0.5.tar.gzs   gtk_themes.tar.gzs   fonts.tar.gzs   wxPython-src-3.0.1.0.tar.gzs   wxPython-src-2.8.12.1.tar.gzs   wxwebkit.tar.gzs   matplotlib-1.3.1.tar.gzs   py2app-0.7.3.tar.gzs   PyOpenGL-3.1.0.tar.gzs   http://cci.lbl.gov/hots   boost_hot.tar.gzt   boosts   scons_hot.tar.gzt   sconss   annlib_hot.tar.gzt   annlibsA   http://svn.code.sf.net/p/cbflib/code-0/trunk/CBFlib_bleeding_edget   cbflibs#   http://cci.lbl.gov/svn/ccp4io/trunkt   ccp4ios+   http://cci.lbl.gov/svn/ccp4io_adaptbx/trunkt   ccp4io_adaptbxs+   http://cci.lbl.gov/svn/annlib_adaptbx/trunkt   annlib_adaptbxs*   http://cci.lbl.gov/svn/gui_resources/trunkt   gui_resourcess"   http://cci.lbl.gov/svn/tntbx/trunkt   tntbxs#   http://cci.lbl.gov/svn/ksdssp/trunkt   ksdssps#   http://cci.lbl.gov/svn/muscle/trunkt   musclet   fetch_packagesc           B   s/   e  Z d  Z d e e d „ Z d d d „ Z RS(   s–   
  Download manager for the packages defined by this module - this is used by
  install_base_packages.py but also for setting up installer bundles.
  c         C   s1   | |  _  | |  _ | |  _ | |  _ | |  _ d  S(   N(   t   dest_dirt   logt   pkg_dirst   no_downloadt
   copy_files(   t   selfR   R   R   R   R   (    (    sL   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/package_defs.pyt   __init__[   s
    				c   	      C   s  | d  k r t } n  | d  k r* | } n  t j |  j ƒ |  j d | IJ|  j d  k	 r÷ t |  j ƒ d k r÷ x… |  j D]w } t j	 | | ƒ } t j
 | ƒ ry |  j d | IJ|  j ré t | t j	 |  j | ƒ ƒ t j	 |  j | ƒ S| Sqy qy Wn  t j
 | ƒ r*|  j d | IJt j	 |  j | ƒ S|  j rFt d | ƒ ‚ n  d | | f } |  j j d | ƒ t | d ƒ } t j | ƒ j ƒ  } t | ƒ d k s¬t | ƒ ‚ |  j j d	 t | ƒ d
 ƒ |  j j ƒ  | j | ƒ | j ƒ  t j	 |  j | ƒ Sd  S(   Ns     getting package %s...i    s       using %ss       using ./%ss.   Package '%s' not found on local filesystems.  s   %s/%ss       downloading from %s : t   wbs   %d KB
i   (   t   Nonet   BASE_CCI_PKG_URLt   ost   chdirR   R   R   t   lent   opt   joint   existsR   t	   copy_fileR   t   RuntimeErrort   writet   opent   urllib2t   urlopent   readt   AssertionErrort   flusht   close(	   R   t   pkg_namet   pkg_urlt   output_filet   pkg_dirt   static_filet   full_urlt   ft   data(    (    sL   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/package_defs.pyt   __call__c   s>    		$		
N(   t   __name__t
   __module__t   __doc__R   t   FalseR   R0   (    (    (    sL   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/package_defs.pyR   V   s   c         C   s÷   t  d |  d | d | d | ƒ } x9 t t t t t t t t t	 t
 t g D] } | | ƒ qI W| rÃ x] t t t t t t t t t t t t t t t t t t t t t  t! g D] } | | ƒ q¬ Wn  | ró x' t" t# t$ g D] } | | t% ƒ qÙ Wn  d S(   sj   
  Download or copy all dependencies into a local directory (prepping for
  source installer bundling).
  R   R   R   R   N(&   R   t
   PYTHON_PKGt	   NUMPY_PKGt   IMAGING_PKGt   REPORTLAB_PKGt   ZLIB_PKGt	   SCIPY_PKGt	   PYRTF_PKGt   BIOPYTHON_PKGt
   SPHINX_PKGt   NUMPYDOC_PKGt   IPYTHON_PKGt
   LIBPNG_PKGt   FREETYPE_PKGt   GETTEXT_PKGt   GLIB_PKGt	   EXPAT_PKGt   FONTCONFIG_PKGt
   RENDER_PKGt   XRENDER_PKGt   XFT_PKGt
   PIXMAN_PKGt	   CAIRO_PKGt	   PANGO_PKGt   ATK_PKGt   TIFF_PKGt   GTK_PKGt   GTK_ENGINE_PKGt   GTK_THEME_PKGt   FONT_PKGt   WXPYTHON_DEV_PKGt   WXPYTHON_PKGt   MATPLOTLIB_PKGt
   PY2APP_PKGt   HDF5_PKGt   H5PY_PKGt   PYOPENGL_PKGt   BASE_XIA_PKG_URL(   R   R   R   R   t   gui_packagest   dials_packagest   fetch_packageR(   (    (    sL   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/package_defs.pyt   fetch_all_dependencies†   s*    
	c         C   s£   t  j |  ƒ r4 | r% t j |  ƒ q4 t d ƒ ‚ n  | d k rM t |  } n  | rp t d | |  f t j	 ƒ n t d | |  f t j	 ƒ t  j
 |  ƒ sŸ t ‚ d S(   s^   
  Download an SVN repository, with or without metadata required for ongoing
  development.
  s   Directory '%s' already exists.s   svn co %s %ss   svn export %s %sN(   R   R   t   shutilt   rmtreet   OSErrorR   t   optional_repositoriest   callt   syst   stdoutt   isdirR%   (   R(   R)   t   working_copyt   delete_if_present(    (    sL   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/package_defs.pyt   fetch_repository¨   s    c         C   sÉ   t  j |  ƒ r t j |  ƒ n  |  t k r“ t |  \ } } |  d } t d t j ƒ  d | ƒ j d | d | d | ƒ t	 | | ƒ t j
 | ƒ n2 |  t k rÅ t |  } t d |  d | d | ƒ n  d  S(   Ns   .tar.gzR   R   R(   R)   R*   Rf   (   R   Re   R^   R_   t   dependency_tarballsR   R   t   getcwdR0   t   untart   removet   subversion_repositoriesRh   (   t   module_nameR   Rf   R)   R(   t   tarfile(    (    sL   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/package_defs.pyt   fetch_remote_package»   s&    

(   s   http://cci.lbl.gov/hots   boost_hot.tar.gz(   s   http://cci.lbl.gov/hots   scons_hot.tar.gz(   s   http://cci.lbl.gov/hots   annlib_hot.tar.gz(<   R3   t
   __future__R    t   installer_utilsR"   t   os.patht   pathR   R   Rc   R   RY   R5   R6   R7   R8   R9   R:   R;   R<   R=   R>   R?   RV   RW   R@   RA   RB   RC   RD   RE   RF   RG   RH   RI   RJ   RK   RL   RM   RN   RO   RP   RQ   RR   RS   t
   WEBKIT_PKGRT   RU   RX   Ri   Rm   t   objectR   R   t   TrueR]   R4   Rh   Rd   Rp   (    (    (    sL   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/auto_build/package_defs.pyt   <module>   s„   


2