2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/91399e1ae5fc/ Changeset: 91399e1ae5fc User: BjoernGruening Date: 2013-10-23 13:45:33 Summary: Add setup_ruby_environment action type Affected #: 2 files diff -r 115a6924dc4c459467ca162e10ee24ba04001a1e -r 91399e1ae5fc827ddc9b33702fe401a10d367539 lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py --- a/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py +++ b/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py @@ -375,6 +375,68 @@ return_code = handle_command( app, tool_dependency, install_dir, modify_env_command ) if return_code: return + elif action_type == 'setup_ruby_environment': + # setup an Ruby environment + # <action type="setup_ruby_environment"> + # <repository name="package_ruby_2_0" owner="bgruening"> + # <package name="ruby" version="2.0" /> + # </repository> + # <!-- allow downloading and installing an Ruby package from http://rubygems.org/ --> + # <package>protk</package> + # <package>protk=1.2.4</package> + # <package>http://url-to-some-gem-file.de/protk.gem</package> + # </action> + if action_dict.get( 'env_shell_file_paths', False ): + install_environment.add_env_shell_file_paths( action_dict[ 'env_shell_file_paths' ] ) + else: + log.warning( 'Missing Ruby environment. Please check if your specified Ruby installation exists.' ) + return + + dir = os.path.curdir + current_dir = os.path.abspath( os.path.join( work_dir, dir ) ) + with lcd( current_dir ): + with settings( warn_only=True ): + for (gem, gem_version) in action_dict[ 'ruby_packages' ]: + if os.path.isfile( gem ): + # we assume a local shipped gem file + cmd = '''export PATH=$PATH:$RUBY_HOME/bin && export GEM_HOME=$INSTALL_DIR && + gem install --local %s''' % ( gem ) + elif gem.find('://') != -1: + # we assume a URL to a gem file + url = gem + gem_name = url.split( '/' )[ -1 ] + td_common_util.url_download( work_dir, gem_name, url, extract=False ) + cmd = '''export PATH=$PATH:$RUBY_HOME/bin && export GEM_HOME=$INSTALL_DIR && + gem install --local %s ''' % ( gem_name ) + else: + # gem file from rubygems.org with or without version number + if gem_version: + # version number was specified + cmd = '''export PATH=$PATH:$RUBY_HOME/bin && export GEM_HOME=$INSTALL_DIR && + gem install %s --version "=%s"''' % ( gem, gem_version) + else: + # no version number given + cmd = '''export PATH=$PATH:$RUBY_HOME/bin && export GEM_HOME=$INSTALL_DIR && + gem install %s''' % ( gem ) + cmd = install_environment.build_command( td_common_util.evaluate_template( cmd, install_dir ) ) + return_code = handle_command( app, tool_dependency, install_dir, cmd ) + if return_code: + return + + # Ruby libraries are installed to $INSTALL_DIR (install_dir), we now set the GEM_PATH path to that directory + # TODO: That code is used a lot for the different environments and should be refactored, once the environments are integrated + modify_env_command_dict = dict( name="GEM_PATH", action="prepend_to", value=install_dir ) + env_entry, env_file = td_common_util.create_or_update_env_shell_file( install_dir, modify_env_command_dict ) + return_code = file_append( env_entry, env_file, skip_if_contained=True, make_executable=True ) + if return_code: + return + + modify_env_command_dict = dict( name="PATH", action="prepend_to", value=os.path.join(install_dir, 'bin') ) + env_entry, env_file = td_common_util.create_or_update_env_shell_file( install_dir, modify_env_command_dict ) + return_code = file_append( env_entry, env_file, skip_if_contained=True, make_executable=True ) + if return_code: + return + else: # We're handling a complex repository dependency where we only have a set_environment tag set. # <action type="set_environment"> diff -r 115a6924dc4c459467ca162e10ee24ba04001a1e -r 91399e1ae5fc827ddc9b33702fe401a10d367539 lib/tool_shed/galaxy_install/tool_dependencies/install_util.py --- a/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py +++ b/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py @@ -631,6 +631,46 @@ action_dict[ 'r_packages' ] = r_packages else: continue + elif action_type == 'setup_ruby_environment': + # setup an Ruby environment + # <action type="setup_ruby_environment"> + # <repository name="package_ruby_2_0" owner="bgruening"> + # <package name="ruby" version="2.0" /> + # </repository> + # <!-- allow downloading and installing an Ruby package from http://rubygems.org/ --> + # <package>protk</package> + # <package>protk=1.2.4</package> + # <package>http://url-to-some-gem-file.de/protk.gem</package> + # </action> + + env_shell_file_paths = td_common_util.get_env_shell_file_paths( app, action_elem.find('repository') ) + all_env_shell_file_paths.extend( env_shell_file_paths ) + if all_env_shell_file_paths: + action_dict[ 'env_shell_file_paths' ] = all_env_shell_file_paths + ruby_packages = list() + for env_elem in action_elem: + if env_elem.tag == 'package': + """ + A valid gem definition can be: + protk=1.2.4 + protk + ftp://ftp.gruening.de/protk.gem + """ + gem_token = env_elem.text.strip().split('=') + if len(gem_token) == 2: + # version string + gem_name = gem_token[0] + gem_version = gem_token[1] + ruby_packages.append( [gem_name, gem_version] ) + else: + # gem name for rubygems.org without version number + gem = env_elem.text.strip() + ruby_packages.append( [gem, None] ) + + if ruby_packages: + action_dict[ 'ruby_packages' ] = ruby_packages + else: + continue elif action_type == 'make_install': # make; make install; allow providing make options if action_elem.text: https://bitbucket.org/galaxy/galaxy-central/commits/d4e60067889e/ Changeset: d4e60067889e User: BjoernGruening Date: 2013-10-23 14:39:49 Summary: cleanup & bugfix for R environment Affected #: 2 files diff -r 91399e1ae5fc827ddc9b33702fe401a10d367539 -r d4e60067889e2bd8873010fa0fc887e725a4b695 lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py --- a/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py +++ b/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py @@ -341,10 +341,13 @@ elif action_type == 'setup_r_environment': # setup an R environment # <action type="setup_r_environment"> - # <r_base name="package_r_3_0_1" owner="bgruening" /> + # <repository name="package_r_3_0_1" owner="bgruening"> + # <package name="R" version="3.0.1" /> + # </repository> + # <!-- allow installing an R packages --> + # <package>https://github.com/bgruening/download_store/raw/master/DESeq2-1_0_18/BiocGenerics_0.6.0.tar.gz</package> # </action> - # allow downloading and installing an R package - # <package>https://github.com/bgruening/download_store/raw/master/DESeq2-1_0_18/BiocGenerics_0.6.0.tar.gz</package> + if action_dict.get( 'env_shell_file_paths', False ): install_environment.add_env_shell_file_paths( action_dict[ 'env_shell_file_paths' ] ) else: @@ -371,8 +374,9 @@ # R libraries are installed to $INSTALL_DIR (install_dir), we now set the R_LIBS path to that directory # TODO: That code is used a lot for the different environments and should be refactored, once the environments are integrated modify_env_command_dict = dict( name="R_LIBS", action="prepend_to", value=install_dir ) - modify_env_command = td_common_util.create_or_update_env_shell_file( install_dir, modify_env_command_dict ) - return_code = handle_command( app, tool_dependency, install_dir, modify_env_command ) + env_entry, env_file = td_common_util.create_or_update_env_shell_file( install_dir, modify_env_command_dict ) + return_code = file_append( env_entry, env_file, skip_if_contained=True, make_executable=True ) + if return_code: return elif action_type == 'setup_ruby_environment': diff -r 91399e1ae5fc827ddc9b33702fe401a10d367539 -r d4e60067889e2bd8873010fa0fc887e725a4b695 lib/tool_shed/galaxy_install/tool_dependencies/install_util.py --- a/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py +++ b/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py @@ -613,10 +613,13 @@ action_dict[ 'configure_opts' ] = configure_opts elif action_type == 'setup_r_environment': # setup an R environment - # <action type="setup_r_environment" name="package_r_3_0_1" owner="bgruening"> - # <package>https://github.com/bgruening/download_store/raw/master/DESeq2-1_0_18/BiocGenerics_0.6.0.tar.gz</package> + # <action type="setup_r_environment"> + # <repository name="package_r_3_0_1" owner="bgruening"> + # <package name="R" version="3.0.1" /> + # </repository> + # <!-- allow installing an R packages --> + # <package>https://github.com/bgruening/download_store/raw/master/DESeq2-1_0_18/BiocGenerics_0.6.0.tar.gz</package> # </action> - env_shell_file_paths = td_common_util.get_env_shell_file_paths( app, action_elem.find('repository') ) all_env_shell_file_paths.extend( env_shell_file_paths ) Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.