correct virtualenv creation for linux
authorymh <ymh.work@gmail.com>
Fri, 20 Feb 2015 14:57:31 +0100
changeset 450 5bf2dffe3685
parent 449 be971bcd048d
child 451 4c3f4d677bc5
correct virtualenv creation for linux
virtualenv/res/lib/lib_create_env.py
virtualenv/web/create_python_env.py
--- a/virtualenv/res/lib/lib_create_env.py	Thu Feb 19 15:36:51 2015 +0100
+++ b/virtualenv/res/lib/lib_create_env.py	Fri Feb 20 14:57:31 2015 +0100
@@ -216,7 +216,12 @@
 install_raptor2 = gen_install_comp_lib('raptor2', 'RAPTOR2', [], redland_base_env)
 install_rasqal = gen_install_comp_lib('rasqal', "RASQAL", [], redland_base_env)
 install_redland = gen_install_comp_lib('redland', 'REDLAND', [], dict(redland_base_env.items() + {'CFLAGS':'-I%(home_dir)s/include'}.items()))
-install_redland_bindings = gen_install_comp_lib('redland-bindings', "REDLAND_BINDINGS", ['--with-python=%(home_dir)s/bin/python', '--with-python-ldflags=-L'+os.path.abspath(os.path.join(os.path.dirname(os.__file__),'..'))+' -lpython'+".".join(map(str,sys.version_info[0:2]))+' -Wl,-dylib'], redland_base_env)
+python_ld_flags = '-L'+os.path.abspath(os.path.join(os.path.dirname(os.__file__),'..'))+' -lpython'+".".join(map(str,sys.version_info[0:2]))
+if sys.platform == 'darwin':
+    python_ld_flags += ' -Wl,-dylib'
+elif 'linux' in sys.platform:
+    python_ld_flags += '-nostartfiles -Wl,-shared'
+install_redland_bindings = gen_install_comp_lib('redland-bindings', "REDLAND_BINDINGS", ['--with-python=%(home_dir)s/bin/python', '--with-python-ldflags='+python_ld_flags], redland_base_env)
 
 def install_pystemmer(option_str, extra_env, res_source_key, home_dir, lib_dir, tmp_dir, src_dir, res_env, logger, call_subprocess, filter_python_develop):
     print "install PYSTEMMER from " + res_env.URLS['PYSTEMMER'][res_source_key]
--- a/virtualenv/web/create_python_env.py	Thu Feb 19 15:36:51 2015 +0100
+++ b/virtualenv/web/create_python_env.py	Fri Feb 20 14:57:31 2015 +0100
@@ -2,6 +2,8 @@
 Call this like ``python create_python_env.py``; it will
 refresh the project-boot.py script
 
+WARNING: after activation of the virtualenv i LINUX, please set the LD_LIBRARY_PATH env var to <path_to_venv>/lib
+
 -prerequisite:
 
 - virtualenv