Mercurial > repos > jankanis > package_python3_4
view tool_dependencies.xml @ 4:9491d3c0dbe6 draft
Add --with-ensurepip
author | jankanis |
---|---|
date | Thu, 22 May 2014 11:01:04 -0400 |
parents | d71cfcee2977 |
children | fb4d95141633 |
line wrap: on
line source
<?xml version="1.0"?> <tool_dependency> <package name="openssl" version="1.0.1g"> <repository changeset_revision="1c167e73d30f" name="package_openssl" owner="jankanis" prior_installation_required="True" toolshed="http://toolshed.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="1c167e73d30f" name="package_openssl" owner="jankanis" prior_installation_required="True" toolshed="http://toolshed.g2.bx.psu.edu"> <package name="openssl" version="1.0.1g" /> </repository> </action> <!-- Python3 config doesn't search for some optional dependencies in non-standard locations. Patch config.py to also look at the repositories we just installed above --> <action type="shell_command"> patch << EOF --- a/setup.py +++ b/setup.py @@ -750,10 +750,14 @@ exts.append( Extension('_socket', ['socketmodule.c'], depends = ['socketmodule.h']) ) # Detect SSL support for the socket module (via _ssl) + CUSTOM_OPENSSL = os.environ.get('OPENSSL_ROOT_DIR') search_for_ssl_incs_in = [ '/usr/local/ssl/include', '/usr/contrib/ssl/include/' ] + if CUSTOM_OPENSSL: + search_for_ssl_incs_in.append(os.path.join(CUSTOM_OPENSSL, 'include')) + ssl_incs = find_file('openssl/ssl.h', inc_dirs, search_for_ssl_incs_in ) @@ -762,10 +766,12 @@ ['/usr/kerberos/include']) if krb5_h: ssl_incs += krb5_h - ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, - ['/usr/local/ssl/lib', - '/usr/contrib/ssl/lib/' - ] ) + + search_for_ssl_libs_in = ['/usr/local/ssl/lib', + '/usr/contrib/ssl/lib/'] + if CUSTOM_OPENSSL: + search_for_ssl_libs_in.append(os.path.join(CUSTOM_OPENSSL, 'lib')) + ssl_libs = find_library_file(self.compiler, 'ssl', lib_dirs, search_for_ssl_libs_in) if (ssl_incs is not None and ssl_libs is not None): EOF </action> <action type="autoconf">--prefix=$INSTALL_DIR --with-ensurepip</action> <action type="set_environment"> <environment_variable action="prepend_to" name="PATH">$INSTALL_DIR/bin</environment_variable> <!-- empty 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. Configured with the default settings, using --prefix=$INSTALL_DIR. 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: <action type="set_environment_for_install"> <repository name="python3" owner="jankanis"> <package name="python3" version="3.4.1" /> </repository> </action> <action type="shell_command"> # 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 pyvenv {{\$MY_PACKAGE_NAME}} . {{\$MY_PACKAGE_NAME}}/bin/activate pip3 install {{\$PYTHON-PACKAGE}} </action> <action type="set_environment"> <environment_variable name="PYTHONPATH" action="prepend_to">\$INSTALL_DIR/lib/python3.4/site-packages</environment_variable> </action> </readme> </package> </tool_dependency>