1 import platform |
1 import platform |
2 |
2 |
3 from lib_create_env import lib_generate_install_methods, install_pylucene, install_psycopg2 |
3 from lib_create_env import lib_generate_install_methods, lib_add_options |
4 |
4 |
5 system_str = platform.system() |
5 system_str = platform.system() |
6 |
6 |
|
7 |
|
8 INSTALLS = [ #(key,method, option_str, dict_extra_env) |
|
9 'PYLUCENE', |
|
10 'PSYCOPG2', |
|
11 'SOUTH', |
|
12 'PIL', |
|
13 'DJANGO', |
|
14 'DJANGO-EXTENSIONS', |
|
15 'DJANGO-REGISTRATION', |
|
16 'DJANGO-TAGGING', |
|
17 'DJANGO-PISTON', |
|
18 'HTTPLIB2', |
|
19 'OAUTH2', |
|
20 'DJANGO-OAUTH-PLUS', |
|
21 'OPENID', |
|
22 'DJANGO_OPENID_CONSUMER', |
|
23 'SOCIAL_AUTH', |
|
24 'DJANGO_GUARDIAN', |
|
25 'SORL_THUMBNAIL', |
|
26 'LXML', |
|
27 ] |
|
28 |
7 if system_str == 'Windows': |
29 if system_str == 'Windows': |
8 INSTALLS = [ |
30 INSTALLS.insert(0, 'JCC') |
9 ('JCC','easy_install',None,None), |
|
10 ('PSYCOPG2',install_psycopg2,None,None), |
|
11 ('PYLUCENE','easy_install',None,None), |
|
12 ] |
|
13 else: |
|
14 INSTALLS = [ |
|
15 ('PYLUCENE',install_pylucene,None,None), |
|
16 ('PSYCOPG2', 'pip', None, None), |
|
17 ] |
|
18 |
31 |
19 if system_str == 'Linux': |
32 OPTIONS_TO_ADD = ['--no-site-packages','--clear', '--type-install=local'] |
20 INSTALLS.extend([ |
33 if system_str == "Linux": |
21 ('DISTRIBUTE', 'pip', None, None), |
34 OPTIONS_TO_ADD.append("--unzip-setuptools") |
22 ]) |
|
23 |
|
24 INSTALLS.extend([ #(key,method, option_str, dict_extra_env) |
|
25 ('SOUTH', 'pip', None, None), |
|
26 ('PIL', 'easy_install', None, None), |
|
27 ('DJANGO','pip', None, None), |
|
28 ('DJANGO-EXTENSIONS', 'pip', None, None), |
|
29 ('DJANGO-REGISTRATION', 'easy_install', '-Z', None), |
|
30 ('DJANGO-TAGGING', 'pip', None, None), |
|
31 ('DJANGO-PISTON', 'easy_install', None, None), |
|
32 ('HTTPLIB2', 'pip', None, None), |
|
33 ('OAUTH2', 'easy_install', None, None), |
|
34 ('DJANGO-OAUTH-PLUS', 'pip', None, None), |
|
35 ('OPENID', 'pip', None, None), |
|
36 ('DJANGO_OPENID_CONSUMER', 'pip', None, None), |
|
37 ('SOCIAL_AUTH', 'easy_install', None, None), |
|
38 ('DJANGO_GUARDIAN', 'pip', None, None), |
|
39 ('SORL_THUMBNAIL', 'pip', None, None), |
|
40 ]) |
|
41 |
|
42 if system_str == "Darwin": |
|
43 INSTALLS.extend([ |
|
44 ('LXML', 'easy_install', None, {'STATIC_DEPS': 'true', 'LIBXML2_VERSION': '2.7.8', 'LIBXSLT_VERSION': '1.1.26', 'LIBICONV_VERSION': '1.13.1'}), |
|
45 ]) |
|
46 else: |
|
47 INSTALLS.extend([ |
|
48 ('LXML', 'easy_install', None, None), |
|
49 ]) |
|
50 |
|
51 |
35 |
52 def generate_install_methods(path_locations, src_base, Logger, call_subprocess): |
36 def generate_install_methods(path_locations, src_base, Logger, call_subprocess): |
53 return lib_generate_install_methods(path_locations, src_base, Logger, call_subprocess, INSTALLS) |
37 return lib_generate_install_methods(path_locations, src_base, Logger, call_subprocess, INSTALLS) |
|
38 |
|
39 add_options = lambda : lib_add_options(OPTIONS_TO_ADD) |