annotate tool_dependencies.xml @ 17:d30e6a97dfbf draft default tip

add dependency on zlib
author jankanis
date Wed, 28 May 2014 10:44:03 -0400
parents 7719329e5b98
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
1 <?xml version="1.0"?>
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
2 <tool_dependency>
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
3 <package name="openssl" version="1.0.1g">
16
7719329e5b98 Depend on iuc versions of libraries
jankanis
parents: 15
diff changeset
4 <repository changeset_revision="3b19041c651c" name="package_openssl_1_0" owner="iuc" prior_installation_required="True" toolshed="http://toolshed.g2.bx.psu.edu" />
0
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
5 </package>
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
6
17
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
7 <package name="zlib" version="1.2.8">
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
8 <repository changeset_revision="31f1e69aae89" name="package_zlib_1_2_8" owner="iuc" prior_installation_required="True" toolshed="http://toolshed.g2.bx.psu.edu" />
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
9 </package>
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
10
6
321cacd4ae43 Add dependencies and settings for sqlite and gdbm, so that python can build its packages for those.
jankanis
parents: 5
diff changeset
11 <package name="sqlite" version="3.8.3">
7
34e257e3aceb add prior_installation_required
jankanis
parents: 6
diff changeset
12 <repository changeset_revision="706b1f3b1fc0" name="package_sqlite_3_8_3" owner="iuc" prior_installation_required="True" toolshed="http://toolshed.g2.bx.psu.edu" />
6
321cacd4ae43 Add dependencies and settings for sqlite and gdbm, so that python can build its packages for those.
jankanis
parents: 5
diff changeset
13 </package>
321cacd4ae43 Add dependencies and settings for sqlite and gdbm, so that python can build its packages for those.
jankanis
parents: 5
diff changeset
14
321cacd4ae43 Add dependencies and settings for sqlite and gdbm, so that python can build its packages for those.
jankanis
parents: 5
diff changeset
15 <package name="gdbm" version="1.11">
16
7719329e5b98 Depend on iuc versions of libraries
jankanis
parents: 15
diff changeset
16 <repository changeset_revision="ad3c23208758" name="package_gdbm_1_11" owner="iuc" prior_installation_required="True" toolshed="http://toolshed.g2.bx.psu.edu" />
6
321cacd4ae43 Add dependencies and settings for sqlite and gdbm, so that python can build its packages for those.
jankanis
parents: 5
diff changeset
17 </package>
321cacd4ae43 Add dependencies and settings for sqlite and gdbm, so that python can build its packages for those.
jankanis
parents: 5
diff changeset
18
321cacd4ae43 Add dependencies and settings for sqlite and gdbm, so that python can build its packages for those.
jankanis
parents: 5
diff changeset
19
0
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
20 <package name="python3" version="3.4.1">
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
21 <install version="1.0">
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
22 <actions>
1
09faf0ae581b Fix some whitespace
jankanis
parents: 0
diff changeset
23 <action type="download_by_url">https://www.python.org/ftp/python/3.4.1/Python-3.4.1.tgz</action>
9
d3ea5f1b4d79 Another attempt at getting the environment settings right.
jankanis
parents: 8
diff changeset
24
0
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
25 <action type="set_environment_for_install">
17
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
26 <repository changeset_revision="31f1e69aae89" name="package_zlib_1_2_8" owner="iuc" toolshed="http://toolshed.g2.bx.psu.edu">
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
27 <package name="zlib" version="1.2.8" />
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
28 </repository>
16
7719329e5b98 Depend on iuc versions of libraries
jankanis
parents: 15
diff changeset
29 <repository changeset_revision="3b19041c651c" name="package_openssl_1_0" owner="iuc" toolshed="http://toolshed.g2.bx.psu.edu">
0
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
30 <package name="openssl" version="1.0.1g" />
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
31 </repository>
7
34e257e3aceb add prior_installation_required
jankanis
parents: 6
diff changeset
32 <repository changeset_revision="706b1f3b1fc0" name="package_sqlite_3_8_3" owner="iuc" toolshed="http://toolshed.g2.bx.psu.edu">
6
321cacd4ae43 Add dependencies and settings for sqlite and gdbm, so that python can build its packages for those.
jankanis
parents: 5
diff changeset
33 <package name="sqlite" version="3.8.3" />
321cacd4ae43 Add dependencies and settings for sqlite and gdbm, so that python can build its packages for those.
jankanis
parents: 5
diff changeset
34 </repository>
16
7719329e5b98 Depend on iuc versions of libraries
jankanis
parents: 15
diff changeset
35 <repository changeset_revision="ad3c23208758" name="package_gdbm_1_11" owner="iuc" toolshed="http://toolshed.g2.bx.psu.edu">
6
321cacd4ae43 Add dependencies and settings for sqlite and gdbm, so that python can build its packages for those.
jankanis
parents: 5
diff changeset
36 <package name="gdbm" version="1.11" />
321cacd4ae43 Add dependencies and settings for sqlite and gdbm, so that python can build its packages for those.
jankanis
parents: 5
diff changeset
37 </repository>
0
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
38 </action>
6
321cacd4ae43 Add dependencies and settings for sqlite and gdbm, so that python can build its packages for those.
jankanis
parents: 5
diff changeset
39
9
d3ea5f1b4d79 Another attempt at getting the environment settings right.
jankanis
parents: 8
diff changeset
40 <action type="shell_command">
12
4091cf3b81e5 Uploaded
jankanis
parents: 11
diff changeset
41 # The python build system doesn't check CPATH / C(PLUS)_INCLUDE_PATH which is set by the depended-upon
4091cf3b81e5 Uploaded
jankanis
parents: 11
diff changeset
42 # tool definitions for these sources, but it does check CPPFLAGS / LDFLAGS
15
5972e67030fd enable dbm module, update docs
jankanis
parents: 14
diff changeset
43 # Currently not whitespace-safe, I haven't found a way yet to quote the *FLAGS values so that they are
16
7719329e5b98 Depend on iuc versions of libraries
jankanis
parents: 15
diff changeset
44 # correctly recognized by both the python build process and the compiler. But as galaxy itself isn't
15
5972e67030fd enable dbm module, update docs
jankanis
parents: 14
diff changeset
45 # whitespace-safe either it doesn't really matter (currently).
12
4091cf3b81e5 Uploaded
jankanis
parents: 11
diff changeset
46 oldifs="$IFS"
16
7719329e5b98 Depend on iuc versions of libraries
jankanis
parents: 15
diff changeset
47 IFS=":"
12
4091cf3b81e5 Uploaded
jankanis
parents: 11
diff changeset
48 for p in $CPLUS_INCLUDE_PATH
4091cf3b81e5 Uploaded
jankanis
parents: 11
diff changeset
49 do
4091cf3b81e5 Uploaded
jankanis
parents: 11
diff changeset
50 CPPFLAGS="$CPPFLAGS -I$p"
4091cf3b81e5 Uploaded
jankanis
parents: 11
diff changeset
51 done
4091cf3b81e5 Uploaded
jankanis
parents: 11
diff changeset
52 for p in $LD_LIBRARY_PATH
4091cf3b81e5 Uploaded
jankanis
parents: 11
diff changeset
53 do
13
9dbfc4fcef0a Fix LDFLAGS. This version is not yet safe against paths containing whitespace.
jankanis
parents: 12
diff changeset
54 LDFLAGS="$LDFLAGS -L$p"
12
4091cf3b81e5 Uploaded
jankanis
parents: 11
diff changeset
55 done
4091cf3b81e5 Uploaded
jankanis
parents: 11
diff changeset
56 IFS="$oldifs"
4091cf3b81e5 Uploaded
jankanis
parents: 11
diff changeset
57 export CPPFLAGS
4091cf3b81e5 Uploaded
jankanis
parents: 11
diff changeset
58 export LDFLAGS
4091cf3b81e5 Uploaded
jankanis
parents: 11
diff changeset
59
4091cf3b81e5 Uploaded
jankanis
parents: 11
diff changeset
60 # Clear variables that may be used in Galaxy's extenal python 2 environment
4091cf3b81e5 Uploaded
jankanis
parents: 11
diff changeset
61 unset PYTHONPATH
4091cf3b81e5 Uploaded
jankanis
parents: 11
diff changeset
62 unset PYTHONHOME
4091cf3b81e5 Uploaded
jankanis
parents: 11
diff changeset
63
4091cf3b81e5 Uploaded
jankanis
parents: 11
diff changeset
64 ./configure --prefix="$INSTALL_DIR" --with-ensurepip --enable-loadable-sqlite-extensions \
4091cf3b81e5 Uploaded
jankanis
parents: 11
diff changeset
65 &amp;&amp; make \
4091cf3b81e5 Uploaded
jankanis
parents: 11
diff changeset
66 &amp;&amp; make install
4091cf3b81e5 Uploaded
jankanis
parents: 11
diff changeset
67 </action>
6
321cacd4ae43 Add dependencies and settings for sqlite and gdbm, so that python can build its packages for those.
jankanis
parents: 5
diff changeset
68
1
09faf0ae581b Fix some whitespace
jankanis
parents: 0
diff changeset
69 <action type="set_environment">
09faf0ae581b Fix some whitespace
jankanis
parents: 0
diff changeset
70 <environment_variable action="prepend_to" name="PATH">$INSTALL_DIR/bin</environment_variable>
17
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
71 <environment_variable action="prepend_to" name="LD_LIBRARY_PATH">$ENV[LD_LIBRARY_PATH]</environment_variable>
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
72 <!-- clear PYTHONPATH, otherwise we will get Galaxy's Python 2 libraries in the Python 3 path. -->
1
09faf0ae581b Fix some whitespace
jankanis
parents: 0
diff changeset
73 <environment_variable action="set_to" name="PYTHONPATH" />
09faf0ae581b Fix some whitespace
jankanis
parents: 0
diff changeset
74 <environment_variable action="set_to" name="PYTHONHOME">$INSTALL_DIR</environment_variable>
4
9491d3c0dbe6 Add --with-ensurepip
jankanis
parents: 3
diff changeset
75 <environment_variable action="prepend_to" name="PKG_CONFIG_PATH">$INSTALL_DIR/lib/pkgconfig</environment_variable>
1
09faf0ae581b Fix some whitespace
jankanis
parents: 0
diff changeset
76 </action>
0
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
77 </actions>
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
78 </install>
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
79
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
80 <readme>
15
5972e67030fd enable dbm module, update docs
jankanis
parents: 14
diff changeset
81 Python 3.4.1
0
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
82
16
7719329e5b98 Depend on iuc versions of libraries
jankanis
parents: 15
diff changeset
83 The Python programming language version 3.
7719329e5b98 Depend on iuc versions of libraries
jankanis
parents: 15
diff changeset
84
7719329e5b98 Depend on iuc versions of libraries
jankanis
parents: 15
diff changeset
85 http://www.python.org
7719329e5b98 Depend on iuc versions of libraries
jankanis
parents: 15
diff changeset
86
7719329e5b98 Depend on iuc versions of libraries
jankanis
parents: 15
diff changeset
87
7719329e5b98 Depend on iuc versions of libraries
jankanis
parents: 15
diff changeset
88 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.
14
59b33d253163 re-export LD_LIBRARY_PATH so that the required libraries can also be found at runtime
jankanis
parents: 13
diff changeset
89
17
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
90 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:
0
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
91
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
92 &lt;action type="set_environment_for_install"&gt;
1
09faf0ae581b Fix some whitespace
jankanis
parents: 0
diff changeset
93 &lt;repository name="python3" owner="jankanis"&gt;
0
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
94 &lt;package name="python3" version="3.4.1" /&gt;
1
09faf0ae581b Fix some whitespace
jankanis
parents: 0
diff changeset
95 &lt;/repository&gt;
17
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
96 &lt;!-- other install time dependencies --&gt;
0
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
97 &lt;/action&gt;
15
5972e67030fd enable dbm module, update docs
jankanis
parents: 14
diff changeset
98
0
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
99 &lt;action type="shell_command"&gt;
17
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
100 # Unset any saved environment settings from parent virtual
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
101 # environments, e.g. for python 2 or if Galaxy itself is running
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
102 # from within a virtual environment.
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
103 unset _OLD_VIRTUAL_PATH; unset _OLD_VIRTUAL_PYTHONHOME
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
104 # Create virtual environment MY_TOOL_venv
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
105 pyvenv MY_TOOL_venv
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
106 # install python packages
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
107 MY_TOOL_venv/bin/pip3 install {{NEEDED_PYTHON_PACKAGES}}
0
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
108 &lt;/action&gt;
15
5972e67030fd enable dbm module, update docs
jankanis
parents: 14
diff changeset
109
0
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
110 &lt;action type="set_environment"&gt;
17
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
111
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
112 &lt;!-- Setting the PYTHONPATH correctly can be a bit tricky, because you must
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
113 make sure that the runtime PYTHONPATH from galaxy itself is not
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
114 included, as it probably points to python 2 code that can crash a
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
115 program if python 3 tries to load it.
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
116
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
117 If you only use a single virtual environment that is created
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
118 specifically for a tool you are creating, you can just use a set_to
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
119 like below.
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
120
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
121 If you create a virtual environment installation that is meant to be
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
122 reused by other packages, the virtual environment should probably
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
123 prepend its site-packages to the PYTHONPATH since a tool could be
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
124 using python modules from several virtual environments. But in such a
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
125 scenario the tool that uses these virtual environments should also
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
126 depend directly on the python3 package, and this dependency should be
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
127 listed before any virtual environment dependencies. This ensures that
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
128 the python3 environment settings that clear PYTHONPATH are sourced
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
129 first so galaxy's runtime PYTHONPATH is excluded. Virtual environments
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
130 can then prepend their PYTHONPATHs to each other. --&gt;
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
131 &lt;environment_variable name="PYTHONPATH" action="set_to"&gt;$INSTALL_DIR/MY_TOOL_venv/lib/python3.4/site-packages&lt;/environment_variable&gt;
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
132 &lt;!-- All that is really needed to use a specific virtual environment is that the
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
133 python interpreter in that environment is used, so add it to PATH --&gt;
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
134 &lt;environment_variable name="PATH" action="prepend_to"&gt;$INSTALL_DIR/MY_TOOL_venv/bin&lt;/environment_variable&gt;
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
135 &lt;!-- Clear incoming PYTHONHOME just like the venv's 'activate' command does --&gt;
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
136 &lt;environment_variable name="PYTHONHOME" action="set_to"&gt;&lt;/environment_variable&gt;
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
137 &lt;!-- To find shared libraries for python built-in modules such as libssl or libsqlite3
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
138 we need to re-export LD_LIBRARY_PATH --&gt;
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
139 &lt;environment_variable name="LD_LIBRARY_PATH" action="prepend_to"&gt;$ENV[LD_LIBRARY_PATH]&lt;/environment_variable&gt;
0
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
140 &lt;/action&gt;
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
141
17
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
142
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
143 Then, in your MY_TOOL.xml add the following requirement:
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
144
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
145 &lt;requirements&gt;
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
146 &lt;requirement name="package" version="XXX"&gt;MY_TOOL_venv&lt;/requirement&gt;
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
147 &lt;/requirements&gt;
d30e6a97dfbf add dependency on zlib
jankanis
parents: 16
diff changeset
148
0
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
149 </readme>
16
7719329e5b98 Depend on iuc versions of libraries
jankanis
parents: 15
diff changeset
150
0
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
151 </package>
e9407b729a69 Uploaded
jankanis
parents:
diff changeset
152 </tool_dependency>