virtualenv/web/res/res_create_env.py
changeset 243 1f2840354865
parent 229 8d01de23b56b
child 271 8f77cf71ab02
equal deleted inserted replaced
242:5c3f8477efcc 243:1f2840354865
     1 from lib_create_env import (lib_generate_install_methods, install_pylucene, 
       
     2     install_psycopg2, install_pystemmer, install_libyaml)
       
     3 import platform
     1 import platform
     4 
     2 
       
     3 from lib_create_env import lib_generate_install_methods
     5 
     4 
     6 system_str = platform.system()
     5 system_str = platform.system()
     7 
     6 
       
     7 INSTALLS = [ #(key,method, option_str, dict_extra_env)
       
     8     'LXML',
       
     9     'PSYCOPG2',
       
    10     'PIL', 
       
    11     'DJANGO',
       
    12     'DJANGO-EXTENSIONS',
       
    13     'SOUTH',
       
    14     'HTTPLIB2',
       
    15     'HAYSTACK',
       
    16     'WHOOSH',
       
    17     'WIKITOOLS',
       
    18     'ISODATE',
       
    19     'RDFLIB',
       
    20     'SPARQLWRAPPER',
       
    21     'PYYAML',
       
    22 ]
       
    23 
     8 if system_str == 'Windows':
    24 if system_str == 'Windows':
     9     INSTALLS = [
    25     INSTALLS.append('PYSTEMMER')
    10     ('JCC','easy_install',None,None),
       
    11     ('PSYCOPG2',install_psycopg2,None,None),
       
    12     ('PYLUCENE','easy_install',None,None),
       
    13     ('PYYAML','easy_install',None,None),
       
    14     ('PYSTEMMER',install_pystemmer,None,None),
       
    15     ]
       
    16 else:
       
    17     INSTALLS = [
       
    18     ('PYLUCENE',install_pylucene,None,None),
       
    19     ('PSYCOPG2', 'pip', None, None),
       
    20 #    ('LIBYAML', install_libyaml, None, None)
       
    21     ('PYYAML', 'pip', None, None),
       
    22     ]
       
    23 
    26 
    24 if system_str == 'Linux':
    27 if system_str == "Linux":
    25     INSTALLS.extend([
    28     INSTALLS.insert(2, 'DISTRIBUTE')
    26     ('DISTRIBUTE', 'pip', None, None),
       
    27     ])
       
    28 
    29 
    29 INSTALLS.extend([ #(key,method, option_str, dict_extra_env)
    30 OPTIONS_TO_ADD = ['clear', 'type_install=local', 'unzip_setuptools']
    30     ('PIL', 'easy_install', None, None), 
    31 if system_str != 'Linux':
    31     ('DJANGO','pip', None, None),
    32     OPTIONS_TO_ADD.append('use_distribute')
    32     ('DJANGO-EXTENSIONS', 'easy_install', None, None),
       
    33     ('HTTPLIB2', 'pip', None, None),
       
    34     ('SOUTH', 'pip', None, None),
       
    35     ('WHOOSH', 'pip', None, None),
       
    36     ('HAYSTACK', 'pip', None, None),
       
    37     ('WIKITOOLS', 'pip', None, None),
       
    38     ('SPARQLWRAPPER', 'pip', None, None),
       
    39 ])
       
    40 
       
    41 if system_str == "Darwin":
       
    42     INSTALLS.extend([
       
    43     ('LXML', 'easy_install', None, {'STATIC_DEPS': 'true', 'LIBXML2_VERSION': '2.7.8', 'LIBXSLT_VERSION': '1.1.26', 'LIBICONV_VERSION': '1.13.1'}),
       
    44     ])
       
    45 else:
       
    46     INSTALLS.extend([
       
    47     ('LXML', 'easy_install', None, None),
       
    48     ])
       
    49 
       
    50 
    33 
    51 def generate_install_methods(path_locations, src_base, Logger, call_subprocess):    
    34 def generate_install_methods(path_locations, src_base, Logger, call_subprocess):    
    52     return lib_generate_install_methods(path_locations, src_base, Logger, call_subprocess, INSTALLS)
    35     return lib_generate_install_methods(path_locations, src_base, Logger, call_subprocess, INSTALLS, OPTIONS_TO_ADD)