annotate tool_dependencies.xml @ 5:83407422ec16 draft default tip

Uploaded
author wolma
date Sat, 11 Jun 2016 19:07:41 -0400
parents 5e5653b689ca
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3956f4688295 Uploaded
wolma
parents:
diff changeset
1 <?xml version="1.0"?>
3956f4688295 Uploaded
wolma
parents:
diff changeset
2 <tool_dependency>
3956f4688295 Uploaded
wolma
parents:
diff changeset
3 <package name="zlib" version="1.2.8">
3956f4688295 Uploaded
wolma
parents:
diff changeset
4 <repository changeset_revision="63a4a902cda2" name="package_zlib_1_2_8" owner="iuc" prior_installation_required="True" toolshed="https://toolshed.g2.bx.psu.edu" />
3956f4688295 Uploaded
wolma
parents:
diff changeset
5 </package>
3956f4688295 Uploaded
wolma
parents:
diff changeset
6
3956f4688295 Uploaded
wolma
parents:
diff changeset
7 <package name="sqlite" version="3.8.3">
3
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
8 <repository changeset_revision="c8a5c11cc921" name="package_sqlite_3_8_3" owner="iuc" prior_installation_required="True" toolshed="https://toolshed.g2.bx.psu.edu" />
0
3956f4688295 Uploaded
wolma
parents:
diff changeset
9 </package>
3956f4688295 Uploaded
wolma
parents:
diff changeset
10
3956f4688295 Uploaded
wolma
parents:
diff changeset
11 <package name="python3" version="3.4">
3
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
12 <install version="1.0">
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
13 <actions>
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
14 <action type="download_by_url">https://www.python.org/ftp/python/3.4.4/Python-3.4.4.tgz</action>
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
15
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
16 <action type="set_environment_for_install">
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
17 <repository changeset_revision="63a4a902cda2" name="package_zlib_1_2_8" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu">
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
18 <package name="zlib" version="1.2.8" />
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
19 </repository>
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
20 <repository changeset_revision="c8a5c11cc921" name="package_sqlite_3_8_3" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu">
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
21 <package name="sqlite" version="3.8.3" />
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
22 </repository>
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
23 </action>
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
24
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
25 <action type="shell_command">
0
3956f4688295 Uploaded
wolma
parents:
diff changeset
26 # The python build system doesn't check CPATH / C(PLUS)_INCLUDE_PATH which is set by the depended-upon
3956f4688295 Uploaded
wolma
parents:
diff changeset
27 # tool definitions for these sources, but it does check CPPFLAGS / LDFLAGS
3956f4688295 Uploaded
wolma
parents:
diff changeset
28 # Currently not whitespace-safe, I haven't found a way yet to quote the *FLAGS values so that they are
3956f4688295 Uploaded
wolma
parents:
diff changeset
29 # correctly recognized by both the python build process and the compiler. But as galaxy itself isn't
3956f4688295 Uploaded
wolma
parents:
diff changeset
30 # whitespace-safe either it doesn't really matter (currently).
3956f4688295 Uploaded
wolma
parents:
diff changeset
31 oldifs="$IFS"
3956f4688295 Uploaded
wolma
parents:
diff changeset
32 IFS=":"
3956f4688295 Uploaded
wolma
parents:
diff changeset
33 for p in $CPLUS_INCLUDE_PATH
3956f4688295 Uploaded
wolma
parents:
diff changeset
34 do
3956f4688295 Uploaded
wolma
parents:
diff changeset
35 CPPFLAGS="$CPPFLAGS -I$p"
3956f4688295 Uploaded
wolma
parents:
diff changeset
36 done
3956f4688295 Uploaded
wolma
parents:
diff changeset
37 for p in $LD_LIBRARY_PATH
3956f4688295 Uploaded
wolma
parents:
diff changeset
38 do
3956f4688295 Uploaded
wolma
parents:
diff changeset
39 LDFLAGS="$LDFLAGS -L$p"
3956f4688295 Uploaded
wolma
parents:
diff changeset
40 done
3956f4688295 Uploaded
wolma
parents:
diff changeset
41 IFS="$oldifs"
3956f4688295 Uploaded
wolma
parents:
diff changeset
42 export CPPFLAGS
3956f4688295 Uploaded
wolma
parents:
diff changeset
43 export LDFLAGS
3956f4688295 Uploaded
wolma
parents:
diff changeset
44
3956f4688295 Uploaded
wolma
parents:
diff changeset
45 # Clear variables that may be used in Galaxy's extenal python 2 environment
3956f4688295 Uploaded
wolma
parents:
diff changeset
46 unset PYTHONPATH
3956f4688295 Uploaded
wolma
parents:
diff changeset
47 unset PYTHONHOME
3956f4688295 Uploaded
wolma
parents:
diff changeset
48
4
5e5653b689ca Uploaded
wolma
parents: 3
diff changeset
49 echo "Python3 installation: preparing to install ..." \
5e5653b689ca Uploaded
wolma
parents: 3
diff changeset
50 &amp;&amp; ./configure -q --prefix="$INSTALL_DIR" --without-ensurepip \
5e5653b689ca Uploaded
wolma
parents: 3
diff changeset
51 &amp;&amp; echo "Python3 installation: entering build process ..." \
5e5653b689ca Uploaded
wolma
parents: 3
diff changeset
52 &amp;&amp; make -s \
5e5653b689ca Uploaded
wolma
parents: 3
diff changeset
53 &amp;&amp; echo "Python3 installation: installing ..." \
5e5653b689ca Uploaded
wolma
parents: 3
diff changeset
54 &amp;&amp; make -s install
3
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
55 </action>
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
56
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
57 <action type="set_environment">
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
58 <environment_variable action="prepend_to" name="PATH">$INSTALL_DIR/bin</environment_variable>
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
59 <environment_variable action="prepend_to" name="LD_LIBRARY_PATH">$ENV[ZLIB_ROOT_PATH]/lib</environment_variable>
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
60 <environment_variable action="prepend_to" name="LD_LIBRARY_PATH">$ENV[SQLITE_ROOT_DIR]/lib</environment_variable>
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
61 <!-- clear PYTHONPATH, otherwise we will get Galaxy's Python 2 libraries in the Python 3 path. -->
5
83407422ec16 Uploaded
wolma
parents: 4
diff changeset
62 <environment_variable action="set_to" name="PYTHONPATH">$INSTALL_DIR</environment_variable>
3
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
63 <environment_variable action="set_to" name="PYTHONHOME">$INSTALL_DIR</environment_variable>
5
83407422ec16 Uploaded
wolma
parents: 4
diff changeset
64 <environment_variable action="set_to" name="PYTHONNOUSERSITE">True</environment_variable>
83407422ec16 Uploaded
wolma
parents: 4
diff changeset
65 <environment_variable action="set_to" name="SITE_PACKAGES_RELPATH">lib/python3.4/site-packages</environment_variable>
3
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
66 <environment_variable action="prepend_to" name="PKG_CONFIG_PATH">$INSTALL_DIR/lib/pkgconfig</environment_variable>
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
67 </action>
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
68 </actions>
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
69 </install>
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
70
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
71 <readme>
0
3956f4688295 Uploaded
wolma
parents:
diff changeset
72 The Python programming language version 3.4
3956f4688295 Uploaded
wolma
parents:
diff changeset
73
3956f4688295 Uploaded
wolma
parents:
diff changeset
74 http://www.python.org
3956f4688295 Uploaded
wolma
parents:
diff changeset
75
3956f4688295 Uploaded
wolma
parents:
diff changeset
76
3956f4688295 Uploaded
wolma
parents:
diff changeset
77 A lean build of Python 3.4.x.
3956f4688295 Uploaded
wolma
parents:
diff changeset
78
3956f4688295 Uploaded
wolma
parents:
diff changeset
79 This package receives bug fixes within the 3.4 release series!
3956f4688295 Uploaded
wolma
parents:
diff changeset
80
3
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
81 Currently, it contains the zlib and sqlite3 modules as the only stdlib
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
82 modules with external dependencies (handled in here by depending on
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
83 package_zlib_1_2_8 and package_sqlite_3_8_3).
0
3956f4688295 Uploaded
wolma
parents:
diff changeset
84
3956f4688295 Uploaded
wolma
parents:
diff changeset
85 In particular, this build does not compile Python's ssl module (which
3956f4688295 Uploaded
wolma
parents:
diff changeset
86 would cause dependency on openssl and, in turn, on Perl).
3956f4688295 Uploaded
wolma
parents:
diff changeset
87
3956f4688295 Uploaded
wolma
parents:
diff changeset
88 This means that **the pip installation tool will not be available with
3956f4688295 Uploaded
wolma
parents:
diff changeset
89 this build** !!
3956f4688295 Uploaded
wolma
parents:
diff changeset
90
5
83407422ec16 Uploaded
wolma
parents: 4
diff changeset
91
0
3956f4688295 Uploaded
wolma
parents:
diff changeset
92 This version of Python includes a built-in virtual environment manager.
3956f4688295 Uploaded
wolma
parents:
diff changeset
93 To create a Python 3 virtual env, include the following actions in your
3956f4688295 Uploaded
wolma
parents:
diff changeset
94 tool_dependencies.xml, e.g. for a package MY_TOOL_venv:
3956f4688295 Uploaded
wolma
parents:
diff changeset
95
3956f4688295 Uploaded
wolma
parents:
diff changeset
96 &lt;action type="set_environment_for_install"&gt;
3
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
97 &lt;repository name="package_python_3_4_x_lean" owner="wolma"&gt;
0
3956f4688295 Uploaded
wolma
parents:
diff changeset
98 &lt;package name="python3" version="3.4" /&gt;
3956f4688295 Uploaded
wolma
parents:
diff changeset
99 &lt;/repository&gt;
3956f4688295 Uploaded
wolma
parents:
diff changeset
100 &lt;!-- other install time dependencies --&gt;
3956f4688295 Uploaded
wolma
parents:
diff changeset
101 &lt;/action&gt;
3956f4688295 Uploaded
wolma
parents:
diff changeset
102
5
83407422ec16 Uploaded
wolma
parents: 4
diff changeset
103 &lt;action type="shell_command"&gt;
0
3956f4688295 Uploaded
wolma
parents:
diff changeset
104 # Create virtual environment MY_TOOL_venv
3956f4688295 Uploaded
wolma
parents:
diff changeset
105 # pip cannot be used for installation because it depends on ssl,
3956f4688295 Uploaded
wolma
parents:
diff changeset
106 # which this build does not provide
3956f4688295 Uploaded
wolma
parents:
diff changeset
107
3
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
108 python3 -m venv --without-pip $INSTALL_DIR/MY_TOOL_venv
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
109
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
110 # optional: install setuptools if required
0
3956f4688295 Uploaded
wolma
parents:
diff changeset
111
3956f4688295 Uploaded
wolma
parents:
diff changeset
112 # install python packages
3956f4688295 Uploaded
wolma
parents:
diff changeset
113 # assuming you are in the download directory of the package
3956f4688295 Uploaded
wolma
parents:
diff changeset
114
3956f4688295 Uploaded
wolma
parents:
diff changeset
115 $INSTALL_DIR/MY_TOOL_venv/bin/python3 setup.py install
3956f4688295 Uploaded
wolma
parents:
diff changeset
116 &lt;/action&gt;
3956f4688295 Uploaded
wolma
parents:
diff changeset
117
5
83407422ec16 Uploaded
wolma
parents: 4
diff changeset
118 &lt;action type="set_environment"&gt;
83407422ec16 Uploaded
wolma
parents: 4
diff changeset
119 &lt;!-- prepend the bin directory of the virtual environment to PATH --&gt;
83407422ec16 Uploaded
wolma
parents: 4
diff changeset
120 &lt;environment_variable name="PATH" action="prepend_to"&gt;$INSTALL_DIR/MY_TOOL_venv/bin&lt;/environment_variable&gt;
83407422ec16 Uploaded
wolma
parents: 4
diff changeset
121 &lt;!-- prepend the site-packages directory of the virtual environment
83407422ec16 Uploaded
wolma
parents: 4
diff changeset
122 to PYTHONPATH; using SITE_PACKAGES_RELPATH here makes it easy to migrate to
83407422ec16 Uploaded
wolma
parents: 4
diff changeset
123 a different version of Python --&gt;
83407422ec16 Uploaded
wolma
parents: 4
diff changeset
124 &lt;environment_variable name="PYTHONPATH" action="prepend_to"&gt;$INSTALL_DIR/MY_TOOL_venv/$SITE_PACKAGES_RELPATH&lt;/environment_variable&gt;
83407422ec16 Uploaded
wolma
parents: 4
diff changeset
125 &lt;/action&gt;
83407422ec16 Uploaded
wolma
parents: 4
diff changeset
126
83407422ec16 Uploaded
wolma
parents: 4
diff changeset
127 Then, in your MY_TOOL.xml add the following requirements (in that order):
83407422ec16 Uploaded
wolma
parents: 4
diff changeset
128
83407422ec16 Uploaded
wolma
parents: 4
diff changeset
129 &lt;requirements&gt;
83407422ec16 Uploaded
wolma
parents: 4
diff changeset
130 &lt;requirement name="package" version="3.4"&gt;python3&lt;/requirement&gt;
83407422ec16 Uploaded
wolma
parents: 4
diff changeset
131 &lt;requirement name="package" version="XXX"&gt;MY_TOOL&lt;/requirement&gt;
83407422ec16 Uploaded
wolma
parents: 4
diff changeset
132 &lt;/requirements&gt;
83407422ec16 Uploaded
wolma
parents: 4
diff changeset
133
83407422ec16 Uploaded
wolma
parents: 4
diff changeset
134 For a concrete example look at the tool_dependencies file of:
0
3956f4688295 Uploaded
wolma
parents:
diff changeset
135
3
87b8dcebce9b Uploaded
wolma
parents: 2
diff changeset
136 https://toolshed.g2.bx.psu.edu/view/wolma/mimodd
0
3956f4688295 Uploaded
wolma
parents:
diff changeset
137
3956f4688295 Uploaded
wolma
parents:
diff changeset
138 </readme>
3956f4688295 Uploaded
wolma
parents:
diff changeset
139 </package>
3956f4688295 Uploaded
wolma
parents:
diff changeset
140 </tool_dependency>