comparison tool_dependencies.xml @ 0:7de6ae338d6c draft default tip

Uploaded
author jankanis
date Mon, 02 Jun 2014 10:27:48 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:7de6ae338d6c
1 <?xml version="1.0"?>
2 <tool_dependency>
3 <package name="zlib" version="1.2.8">
4 <repository changeset_revision="12711c8cada7" name="package_zlib_1_2_8" owner="iuc" prior_installation_required="True" toolshed="http://testtoolshed.g2.bx.psu.edu" />
5 </package>
6
7 <package name="readline" version="6.2">
8 <repository changeset_revision="246f31787ca1" name="package_readline_6_2" owner="iuc" prior_installation_required="True" toolshed="http://testtoolshed.g2.bx.psu.edu" />
9 </package>
10
11 <package name="bzlib" version="1.0.6">
12 <repository changeset_revision="2dec91192fc7" name="package_bzlib_1_0" owner="iuc" prior_installation_required="True" toolshed="http://testtoolshed.g2.bx.psu.edu" />
13 </package>
14
15 <package name="xz" version="5.0.5">
16 <repository changeset_revision="b6876995a7e8" name="package_xz_5_0_5" owner="iuc" prior_installation_required="True" toolshed="http://testtoolshed.g2.bx.psu.edu" />
17 </package>
18
19 <package name="openssl" version="1.0.1g">
20 <repository changeset_revision="1c0d2868aa06" name="package_openssl_1_0" owner="iuc" prior_installation_required="True" toolshed="http://testtoolshed.g2.bx.psu.edu" />
21 </package>
22
23 <package name="sqlite" version="3.8.3">
24 <repository changeset_revision="e3729818491f" name="package_sqlite_3_8_3" owner="iuc" prior_installation_required="True" toolshed="http://testtoolshed.g2.bx.psu.edu" />
25 </package>
26
27 <package name="gdbm" version="1.11">
28 <repository changeset_revision="7367119a4afc" name="package_gdbm_1_11" owner="iuc" prior_installation_required="True" toolshed="http://testtoolshed.g2.bx.psu.edu" />
29 </package>
30
31 <package name="ncurses" version="5.9">
32 <repository changeset_revision="f62fa47b852d" name="package_ncurses_5_9" owner="iuc" prior_installation_required="True" toolshed="http://testtoolshed.g2.bx.psu.edu" />
33 </package>
34
35
36 <package name="python3" version="3.4.1">
37 <install version="1.0">
38 <actions>
39 <action type="download_by_url">https://www.python.org/ftp/python/3.4.1/Python-3.4.1.tgz</action>
40
41 <action type="set_environment_for_install">
42 <repository changeset_revision="12711c8cada7" name="package_zlib_1_2_8" owner="iuc" toolshed="http://testtoolshed.g2.bx.psu.edu">
43 <package name="zlib" version="1.2.8" />
44 </repository>
45 <repository changeset_revision="246f31787ca1" name="package_readline_6_2" owner="iuc" toolshed="http://testtoolshed.g2.bx.psu.edu">
46 <package name="readline" version="6.2" />
47 </repository>
48 <repository changeset_revision="2dec91192fc7" name="package_bzlib_1_0" owner="iuc" toolshed="http://testtoolshed.g2.bx.psu.edu">
49 <package name="bzlib" version="1.0.6" />
50 </repository>
51 <repository changeset_revision="b6876995a7e8" name="package_xz_5_0_5" owner="iuc" toolshed="http://testtoolshed.g2.bx.psu.edu">
52 <package name="xz" version="5.0.5" />
53 </repository>
54 <repository changeset_revision="1c0d2868aa06" name="package_openssl_1_0" owner="iuc" toolshed="http://testtoolshed.g2.bx.psu.edu">
55 <package name="openssl" version="1.0.1g" />
56 </repository>
57 <repository changeset_revision="e3729818491f" name="package_sqlite_3_8_3" owner="iuc" toolshed="http://testtoolshed.g2.bx.psu.edu">
58 <package name="sqlite" version="3.8.3" />
59 </repository>
60 <repository changeset_revision="7367119a4afc" name="package_gdbm_1_11" owner="iuc" toolshed="http://testtoolshed.g2.bx.psu.edu">
61 <package name="gdbm" version="1.11" />
62 </repository>
63 <repository changeset_revision="f62fa47b852d" name="package_ncurses_5_9" owner="iuc" toolshed="http://testtoolshed.g2.bx.psu.edu">
64 <package name="ncurses" version="5.9" />
65 </repository>
66 </action>
67
68 <action type="shell_command">
69 # The python build system doesn't check CPATH / C(PLUS)_INCLUDE_PATH which is set by the depended-upon
70 # tool definitions for these sources, but it does check CPPFLAGS / LDFLAGS
71 # Currently not whitespace-safe, I haven't found a way yet to quote the *FLAGS values so that they are
72 # correctly recognized by both the python build process and the compiler. But as galaxy itself isn't
73 # whitespace-safe either it doesn't really matter (currently).
74 oldifs="$IFS"
75 IFS=":"
76 for p in $CPLUS_INCLUDE_PATH
77 do
78 CPPFLAGS="$CPPFLAGS -I$p"
79 done
80 for p in $LD_LIBRARY_PATH
81 do
82 LDFLAGS="$LDFLAGS -L$p"
83 done
84 IFS="$oldifs"
85 export CPPFLAGS
86 export LDFLAGS
87
88 # Clear variables that may be used in Galaxy's extenal python 2 environment
89 unset PYTHONPATH
90 unset PYTHONHOME
91
92 ./configure --prefix="$INSTALL_DIR" --with-ensurepip --enable-loadable-sqlite-extensions \
93 &amp;&amp; make \
94 &amp;&amp; make install
95 </action>
96
97 <action type="set_environment">
98 <environment_variable action="prepend_to" name="PATH">$INSTALL_DIR/bin</environment_variable>
99 <environment_variable action="prepend_to" name="LD_LIBRARY_PATH">$ENV[LD_LIBRARY_PATH]</environment_variable>
100 <!-- clear PYTHONPATH, otherwise we will get Galaxy's Python 2 libraries in the Python 3 path. -->
101 <environment_variable action="set_to" name="PYTHONPATH" />
102 <environment_variable action="set_to" name="PYTHONHOME">$INSTALL_DIR</environment_variable>
103 <environment_variable action="prepend_to" name="PKG_CONFIG_PATH">$INSTALL_DIR/lib/pkgconfig</environment_variable>
104 </action>
105 </actions>
106 </install>
107
108 <readme>
109 Python 3.4.1
110
111 The Python programming language version 3.
112
113 http://www.python.org
114
115
116 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.
117
118 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:
119
120 &lt;action type="set_environment_for_install"&gt;
121 &lt;repository name="python3" owner="jankanis"&gt;
122 &lt;package name="python3" version="3.4.1" /&gt;
123 &lt;/repository&gt;
124 &lt;!-- ... other install time dependencies ... --&gt;
125 &lt;/action&gt;
126
127 &lt;action type="shell_command"&gt;
128 # Unset any saved environment settings from parent virtual
129 # environments, e.g. for python 2 or if Galaxy itself is running
130 # from within a virtual environment.
131 unset _OLD_VIRTUAL_PATH; unset _OLD_VIRTUAL_PYTHONHOME
132 # Create virtual environment MY_TOOL_venv
133 pyvenv MY_TOOL_venv
134 # install python packages
135 MY_TOOL_venv/bin/pip3 install {{NEEDED_PYTHON_PACKAGES}}
136 &lt;/action&gt;
137
138 &lt;action type="set_environment"&gt;
139
140 &lt;!-- Setting the PYTHONPATH correctly can be a bit tricky, because you must
141 make sure that the runtime PYTHONPATH from galaxy itself is not
142 included, as it probably points to python 2 code that can crash a
143 program if python 3 tries to load it.
144
145 If you only use a single virtual environment that is created
146 specifically for a tool you are creating, you can just use a set_to
147 like below.
148
149 If you create a virtual environment installation that is meant to be
150 reused by other packages, the virtual environment should probably
151 prepend its site-packages to the PYTHONPATH since a tool could be
152 using python modules from several virtual environments. But in such a
153 scenario the tool that uses these virtual environments should also
154 depend directly on the python3 package, and this dependency should be
155 listed before any virtual environment dependencies. This ensures that
156 the python3 environment settings that clear PYTHONPATH are sourced
157 first so galaxy's runtime PYTHONPATH is excluded. Virtual environments
158 can then prepend their PYTHONPATHs to each other. --&gt;
159 &lt;environment_variable name="PYTHONPATH" action="set_to"&gt;$INSTALL_DIR/MY_TOOL_venv/lib/python3.4/site-packages&lt;/environment_variable&gt;
160 &lt;!-- All that is really needed to use a specific virtual environment is that the
161 python interpreter in that environment is used, so add it to PATH --&gt;
162 &lt;environment_variable name="PATH" action="prepend_to"&gt;$INSTALL_DIR/MY_TOOL_venv/bin&lt;/environment_variable&gt;
163 &lt;!-- Clear incoming PYTHONHOME just like the venv's 'activate' command does --&gt;
164 &lt;environment_variable name="PYTHONHOME" action="set_to"&gt;&lt;/environment_variable&gt;
165 &lt;!-- To find shared libraries for python built-in modules such as libssl or libsqlite3
166 we need to re-export LD_LIBRARY_PATH --&gt;
167 &lt;environment_variable name="LD_LIBRARY_PATH" action="prepend_to"&gt;$ENV[LD_LIBRARY_PATH]&lt;/environment_variable&gt;
168 &lt;/action&gt;
169
170
171 Then, in your MY_TOOL.xml add the following requirement:
172
173 &lt;requirements&gt;
174 &lt;requirement name="package" version="XXX"&gt;MY_TOOL_venv&lt;/requirement&gt;
175 &lt;/requirements&gt;
176
177 </readme>
178
179 </package>
180 </tool_dependency>