6
|
1 <?xml version="1.0"?>
|
|
2 <tool_dependency>
|
|
3 <package name="zlib" version="1.2.8">
|
|
4 <repository changeset_revision="9d017266c41e" name="package_zlib_1_2_8" owner="wolma" prior_installation_required="True" toolshed="https://testtoolshed.g2.bx.psu.edu" />
|
|
5 </package>
|
|
6
|
|
7 <package name="python3" version="3.4.1">
|
|
8 <install version="1.0">
|
|
9 <actions>
|
|
10 <action type="download_by_url">https://www.python.org/ftp/python/3.4.1/Python-3.4.1.tgz</action>
|
|
11
|
|
12 <action type="set_environment_for_install">
|
|
13 <repository changeset_revision="9d017266c41e" name="package_zlib_1_2_8" owner="wolma" toolshed="https://testtoolshed.g2.bx.psu.edu">
|
|
14 <package name="zlib" version="1.2.8" />
|
|
15 </repository>
|
|
16 </action>
|
|
17
|
|
18 <action type="shell_command">
|
|
19 # The python build system doesn't check CPATH / C(PLUS)_INCLUDE_PATH which is set by the depended-upon
|
|
20 # tool definitions for these sources, but it does check CPPFLAGS / LDFLAGS
|
|
21 # Currently not whitespace-safe, I haven't found a way yet to quote the *FLAGS values so that they are
|
|
22 # correctly recognized by both the python build process and the compiler. But as galaxy itself isn't
|
|
23 # whitespace-safe either it doesn't really matter (currently).
|
|
24 oldifs="$IFS"
|
|
25 IFS=":"
|
|
26 for p in $CPLUS_INCLUDE_PATH
|
|
27 do
|
|
28 CPPFLAGS="$CPPFLAGS -I$p"
|
|
29 done
|
|
30 for p in $LD_LIBRARY_PATH
|
|
31 do
|
|
32 LDFLAGS="$LDFLAGS -L$p"
|
|
33 done
|
|
34 IFS="$oldifs"
|
|
35 export CPPFLAGS
|
|
36 export LDFLAGS
|
|
37
|
|
38 # Clear variables that may be used in Galaxy's extenal python 2 environment
|
|
39 unset PYTHONPATH
|
|
40 unset PYTHONHOME
|
|
41
|
|
42 ./configure --prefix="$INSTALL_DIR" --with-ensurepip \
|
|
43 && make \
|
|
44 && make install
|
|
45 </action>
|
|
46
|
|
47 <action type="set_environment">
|
|
48 <environment_variable action="prepend_to" name="PATH">$INSTALL_DIR/bin</environment_variable>
|
|
49 <environment_variable action="prepend_to" name="LD_LIBRARY_PATH">$ENV[LD_LIBRARY_PATH]</environment_variable>
|
|
50 <!-- clear PYTHONPATH, otherwise we will get Galaxy's Python 2 libraries in the Python 3 path. -->
|
|
51 <environment_variable action="set_to" name="PYTHONPATH" />
|
|
52 <environment_variable action="set_to" name="PYTHONHOME">$INSTALL_DIR</environment_variable>
|
|
53 <environment_variable action="prepend_to" name="PKG_CONFIG_PATH">$INSTALL_DIR/lib/pkgconfig</environment_variable>
|
|
54 </action>
|
|
55 </actions>
|
|
56 </install>
|
|
57
|
|
58 <readme>
|
|
59 Python 3.4.1
|
|
60
|
|
61 The Python programming language version 3.
|
|
62
|
|
63 http://www.python.org
|
|
64
|
|
65
|
7
|
66 A lean build of python 3.4.1. It does not include modules with external dependencies except for the zlib module (handled in here by depending on package_zlib_1_2_8).
|
|
67
|
|
68 In particular, this build does not compile Python's ssl module, which would cause dependency on openssl and, in turn, on Perl. This means that **the pip installation tool will not be available with this build**.
|
|
69
|
|
70 For a build with more modules (and also ssl) included look at
|
|
71 https://toolshed.g2.bx.psu.edu/view/jankanis/package_python3_4
|
|
72 written by jankanis, of which this package is a shameless plagiarism.
|
6
|
73
|
|
74 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:
|
|
75
|
|
76 <action type="set_environment_for_install">
|
7
|
77 <repository name="package_python3_zlib_dependent_1_0" owner="wolma">
|
6
|
78 <package name="python3" version="3.4.1" />
|
|
79 </repository>
|
|
80 <!-- other install time dependencies -->
|
|
81 </action>
|
|
82
|
7
|
83 <action type="shell_command">
|
|
84
|
6
|
85 # Create virtual environment MY_TOOL_venv
|
7
|
86 # pip cannot be used for installation because it depends on ssl,
|
|
87 # which this build does not provide
|
|
88
|
|
89 pyvenv --without-pip $INSTALL_DIR/MY_TOOL_venv
|
|
90
|
6
|
91 # install python packages
|
7
|
92 # assuming you are in the download directory of the package
|
|
93
|
|
94 $INSTALL_DIR/MY_TOOL_venv/bin/python3 setup.py install
|
6
|
95 </action>
|
|
96
|
7
|
97 For an example of how this could used by a package look at:
|
|
98
|
|
99 https://testtoolshed.g2.bx.psu.edu/view/wolma/package_mimodd_0_1_5
|
|
100
|
6
|
101 </readme>
|
|
102
|
|
103 </package>
|
|
104 </tool_dependency>
|