changeset 15:5972e67030fd draft

enable dbm module, update docs
author jankanis
date Tue, 27 May 2014 10:21:10 -0400
parents 59b33d253163
children 7719329e5b98
files tool_dependencies.xml
diffstat 1 files changed, 32 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/tool_dependencies.xml	Mon May 26 09:28:34 2014 -0400
+++ b/tool_dependencies.xml	Tue May 27 10:21:10 2014 -0400
@@ -9,7 +9,7 @@
   </package>
 
   <package name="gdbm" version="1.11">
-    <repository changeset_revision="15e7435c2663" name="package_gdbm_1_11" owner="iuc" prior_installation_required="True" toolshed="http://toolshed.g2.bx.psu.edu" />
+    <repository changeset_revision="22b9fdbed20d" name="package_gdbm_1_11" owner="jankanis" prior_installation_required="True" toolshed="http://toolshed.g2.bx.psu.edu" />
   </package>
 
   
@@ -25,7 +25,7 @@
           <repository changeset_revision="706b1f3b1fc0" name="package_sqlite_3_8_3" owner="iuc" toolshed="http://toolshed.g2.bx.psu.edu">
             <package name="sqlite" version="3.8.3" />
           </repository>
-          <repository changeset_revision="15e7435c2663" name="package_gdbm_1_11" owner="iuc" toolshed="http://toolshed.g2.bx.psu.edu">
+          <repository changeset_revision="22b9fdbed20d" name="package_gdbm_1_11" owner="jankanis" toolshed="http://toolshed.g2.bx.psu.edu">
             <package name="gdbm" version="1.11" />
           </repository>
         </action>
@@ -33,7 +33,9 @@
         <action type="shell_command">
           # The python build system doesn't check CPATH / C(PLUS)_INCLUDE_PATH which is set by the depended-upon
           # tool definitions for these sources, but it does check CPPFLAGS / LDFLAGS
-          # Currently not whitespace-safe, but galaxy itself isn't whitespace-safe either so it doesn't matter (yet)
+          # Currently not whitespace-safe, I haven't found a way yet to quote the *FLAGS values so that they are
+          # correctly recognized by the python build process and the compiler. But as galaxy itself isn't
+          # whitespace-safe either it doesn't really matter (currently).
           oldifs="$IFS"
           IFS=:
           for p in $CPLUS_INCLUDE_PATH
@@ -69,28 +71,44 @@
     </install>
 
     <readme>
-    Python 3.4.1
+      Python 3.4.1
 
-    This build of python is configured with --enable-loadable-sqlite-extensions and a --prefix, any other settings are default. This build does not include modules for lzma, Tkinter and dbm, but does include ssl, gdbm and sqlite. Adding the missing modules should not be very difficult but requires wrapping the external sources that these modules require inside galaxy. 
+      This build of python is configured with --enable-loadable-sqlite-extensions and a --prefix, any other settings are default. This build does not include modules for lzma and Tkinter, but does include ssl, (g)dbm and sqlite. Adding the missing modules should not be very difficult but requires wrapping the external sources that these modules require inside galaxy. 
 
-    Python as of version 3.3 includes a built-in virtual environment manager. To create a python 3 virtual env, include the following actions in your tool_dependencies.xml:
+      Python as of version 3.3 includes a built-in virtual environment manager. To create a python 3 virtual env, include the following actions in your tool_dependencies.xml:
 
       &lt;action type="set_environment_for_install"&gt;
         &lt;repository name="python3" owner="jankanis"&gt;
           &lt;package name="python3" version="3.4.1" /&gt;
         &lt;/repository&gt;
+	&lt;!-- other install time dependencies --&gt;
       &lt;/action&gt;
+
       &lt;action type="shell_command"&gt;
-        # Unset any saved environment settings from parent virtual
-        # environments, e.g. for python 2 or if Galaxy itself is running
-        # from within a virtual environment.
-        unset _OLD_VIRTUAL_PATH; unset _OLD_VIRTUAL_PYTHONHOME
-        pyvenv {{\$MY_PACKAGE_NAME}}
-        . {{\$MY_PACKAGE_NAME}}/bin/activate
-        pip3 install {{\$PYTHON-PACKAGE}}
+	# Unset any saved environment settings from parent virtual
+	# environments, e.g. for python 2 or if Galaxy itself is running
+	# from within a virtual environment.
+	unset _OLD_VIRTUAL_PATH; unset _OLD_VIRTUAL_PYTHONHOME
+	pyvenv MY_TOOL_venv
+	MY_TOOL_venv/bin/pip3 install {{NEEDED_PYTHON_PACKAGES}}
       &lt;/action&gt;
+
       &lt;action type="set_environment"&gt;
-        &lt;environment_variable name="PYTHONPATH" action="prepend_to"&gt;\$INSTALL_DIR/lib/python3.4/site-packages&lt;/environment_variable&gt;
+        &lt;!-- Remove any incoming PYTHONPATH elements from Galaxy's own python 2 environment.
+	     If you want to chain multiple virtual environments so that packages installed
+	     in all of them are visible, you need to arrange for PYTHONPATH to include the
+	     site-packages directories of all of them, so in that case just a plain 'set_to'
+	     would not be sufficient.
+	 --&gt;
+	&lt;environment_variable name="PYTHONPATH" action="set_to"&gt;$INSTALL_DIR/MY_TOOL_venv/lib/python3.4/site-packages&lt;/environment_variable&gt;
+	&lt;!-- All that is really needed to use a specific virtual environment is that the
+	     python interpreter in that environment is used, so add it to PATH --&gt;
+	&lt;environment_variable name="PATH" action="prepend_to"&gt;$INSTALL_DIR/MY_TOOL_venv/bin&lt;/environment_variable&gt;
+	&lt;!-- Clear incoming PYTHONHOME just like the venv's 'activate' command does --&gt;
+	&lt;environment_variable name="PYTHONHOME" action="set_to"&gt;&lt;/environment_variable&gt;
+	&lt;!-- To find shared libraries for python built-in modules such as libssl or libsqlite3
+	     we need to re-export LD_LIBRARY_PATH --&gt;
+	&lt;environment_variable name="LD_LIBRARY_PATH" action="prepend_to"&gt;$ENV[LD_LIBRARY_PATH]&lt;/environment_variable&gt;
       &lt;/action&gt;
 
     </readme>