changeset 0:7de6ae338d6c draft default tip

Uploaded
author jankanis
date Mon, 02 Jun 2014 10:27:48 -0400
parents
children
files tool_dependencies.xml
diffstat 1 files changed, 180 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_dependencies.xml	Mon Jun 02 10:27:48 2014 -0400
@@ -0,0 +1,180 @@
+<?xml version="1.0"?>
+<tool_dependency>
+  <package name="zlib" version="1.2.8">
+    <repository changeset_revision="12711c8cada7" name="package_zlib_1_2_8" owner="iuc" prior_installation_required="True" toolshed="http://testtoolshed.g2.bx.psu.edu" />
+  </package>
+
+  <package name="readline" version="6.2">
+    <repository changeset_revision="246f31787ca1" name="package_readline_6_2" owner="iuc" prior_installation_required="True" toolshed="http://testtoolshed.g2.bx.psu.edu" />
+  </package>
+
+  <package name="bzlib" version="1.0.6">
+    <repository changeset_revision="2dec91192fc7" name="package_bzlib_1_0" owner="iuc" prior_installation_required="True" toolshed="http://testtoolshed.g2.bx.psu.edu" />
+  </package>
+
+  <package name="xz" version="5.0.5">
+    <repository changeset_revision="b6876995a7e8" name="package_xz_5_0_5" owner="iuc" prior_installation_required="True" toolshed="http://testtoolshed.g2.bx.psu.edu" />
+  </package>
+
+  <package name="openssl" version="1.0.1g">
+    <repository changeset_revision="1c0d2868aa06" name="package_openssl_1_0" owner="iuc" prior_installation_required="True" toolshed="http://testtoolshed.g2.bx.psu.edu" />
+  </package>
+
+  <package name="sqlite" version="3.8.3">
+    <repository changeset_revision="e3729818491f" name="package_sqlite_3_8_3" owner="iuc" prior_installation_required="True" toolshed="http://testtoolshed.g2.bx.psu.edu" />
+  </package>
+
+  <package name="gdbm" version="1.11">
+    <repository changeset_revision="7367119a4afc" name="package_gdbm_1_11" owner="iuc" prior_installation_required="True" toolshed="http://testtoolshed.g2.bx.psu.edu" />
+  </package>
+
+  <package name="ncurses" version="5.9">
+    <repository changeset_revision="f62fa47b852d" name="package_ncurses_5_9" owner="iuc" prior_installation_required="True" toolshed="http://testtoolshed.g2.bx.psu.edu" />
+  </package>
+
+  
+  <package name="python3" version="3.4.1">
+    <install version="1.0">
+      <actions>
+        <action type="download_by_url">https://www.python.org/ftp/python/3.4.1/Python-3.4.1.tgz</action>
+
+        <action type="set_environment_for_install">
+          <repository changeset_revision="12711c8cada7" name="package_zlib_1_2_8" owner="iuc" toolshed="http://testtoolshed.g2.bx.psu.edu">
+            <package name="zlib" version="1.2.8" />
+          </repository>
+          <repository changeset_revision="246f31787ca1" name="package_readline_6_2" owner="iuc" toolshed="http://testtoolshed.g2.bx.psu.edu">
+            <package name="readline" version="6.2" />
+          </repository>
+          <repository changeset_revision="2dec91192fc7" name="package_bzlib_1_0" owner="iuc" toolshed="http://testtoolshed.g2.bx.psu.edu">
+            <package name="bzlib" version="1.0.6" />
+          </repository>
+          <repository changeset_revision="b6876995a7e8" name="package_xz_5_0_5" owner="iuc" toolshed="http://testtoolshed.g2.bx.psu.edu">
+            <package name="xz" version="5.0.5" />
+          </repository>
+          <repository changeset_revision="1c0d2868aa06" name="package_openssl_1_0" owner="iuc" toolshed="http://testtoolshed.g2.bx.psu.edu">
+            <package name="openssl" version="1.0.1g" />
+          </repository>
+          <repository changeset_revision="e3729818491f" name="package_sqlite_3_8_3" owner="iuc" toolshed="http://testtoolshed.g2.bx.psu.edu">
+            <package name="sqlite" version="3.8.3" />
+          </repository>
+          <repository changeset_revision="7367119a4afc" name="package_gdbm_1_11" owner="iuc" toolshed="http://testtoolshed.g2.bx.psu.edu">
+            <package name="gdbm" version="1.11" />
+          </repository>
+          <repository changeset_revision="f62fa47b852d" name="package_ncurses_5_9" owner="iuc" toolshed="http://testtoolshed.g2.bx.psu.edu">
+            <package name="ncurses" version="5.9" />
+          </repository>
+        </action>
+
+        <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, I haven't found a way yet to quote the *FLAGS values so that they are
+          # correctly recognized by both 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
+          do
+              CPPFLAGS="$CPPFLAGS -I$p"
+          done
+          for p in $LD_LIBRARY_PATH
+          do
+              LDFLAGS="$LDFLAGS -L$p"
+          done
+          IFS="$oldifs"
+          export CPPFLAGS
+          export LDFLAGS
+
+          # Clear variables that may be used in Galaxy's extenal python 2 environment
+          unset PYTHONPATH
+          unset PYTHONHOME
+
+          ./configure --prefix="$INSTALL_DIR" --with-ensurepip --enable-loadable-sqlite-extensions \
+          &amp;&amp; make \
+          &amp;&amp; make install
+        </action>
+
+        <action type="set_environment">
+          <environment_variable action="prepend_to" name="PATH">$INSTALL_DIR/bin</environment_variable>
+          <environment_variable action="prepend_to" name="LD_LIBRARY_PATH">$ENV[LD_LIBRARY_PATH]</environment_variable>
+          <!-- clear PYTHONPATH, otherwise we will get Galaxy's Python 2 libraries in the Python 3 path. -->
+          <environment_variable action="set_to" name="PYTHONPATH" />
+          <environment_variable action="set_to" name="PYTHONHOME">$INSTALL_DIR</environment_variable>
+          <environment_variable action="prepend_to" name="PKG_CONFIG_PATH">$INSTALL_DIR/lib/pkgconfig</environment_variable>
+        </action>
+      </actions>
+    </install>
+
+    <readme>
+      Python 3.4.1
+
+      The Python programming language version 3.
+
+      http://www.python.org
+
+
+      This build of python is configured with --enable-loadable-sqlite-extensions, 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, e.g. for a package MY_TOOL_venv:
+
+      &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
+        # Create virtual environment MY_TOOL_venv
+        pyvenv MY_TOOL_venv
+        # install python packages
+        MY_TOOL_venv/bin/pip3 install {{NEEDED_PYTHON_PACKAGES}}
+      &lt;/action&gt;
+
+      &lt;action type="set_environment"&gt;
+
+	&lt;!-- Setting the PYTHONPATH correctly can be a bit tricky, because you must
+             make sure that the runtime PYTHONPATH from galaxy itself is not
+             included, as it probably points to python 2 code that can crash a
+             program if python 3 tries to load it.
+
+             If you only use a single virtual environment that is created
+             specifically for a tool you are creating, you can just use a set_to
+             like below.
+
+             If you create a virtual environment installation that is meant to be
+             reused by other packages, the virtual environment should probably
+             prepend its site-packages to the PYTHONPATH since a tool could be
+             using python modules from several virtual environments. But in such a
+             scenario the tool that uses these virtual environments should also
+             depend directly on the python3 package, and this dependency should be
+             listed before any virtual environment dependencies. This ensures that
+             the python3 environment settings that clear PYTHONPATH are sourced
+             first so galaxy's runtime PYTHONPATH is excluded. Virtual environments
+             can then prepend their PYTHONPATHs to each other. --&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;
+
+
+      Then, in your MY_TOOL.xml add the following requirement:
+
+      &lt;requirements&gt;
+        &lt;requirement name="package" version="XXX"&gt;MY_TOOL_venv&lt;/requirement&gt;
+      &lt;/requirements&gt;
+      
+    </readme>
+
+  </package>
+</tool_dependency>