diff options
author | g-mathias <40861554+g-mathias@users.noreply.github.com> | 2020-07-03 08:34:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-02 23:34:00 -0700 |
commit | cf104b0f102cacad96b7de918d5fdd2c960560d0 (patch) | |
tree | eca724be9f3b2a93b7e49d75b9bcbacd78ec3b68 | |
parent | 17106a131df7906dc17e957b5c0c052a057435a1 (diff) | |
download | spack-cf104b0f102cacad96b7de918d5fdd2c960560d0.tar.gz spack-cf104b0f102cacad96b7de918d5fdd2c960560d0.tar.bz2 spack-cf104b0f102cacad96b7de918d5fdd2c960560d0.tar.xz spack-cf104b0f102cacad96b7de918d5fdd2c960560d0.zip |
jmol: add version 14.31.0 (#17351)
Also:
* Add url_for_version function
* Add Java to PATH for run environment
* Update `install` method to handle old and new version
Co-authored-by: lu64bag3 <gerald.mathias@lrz.de>
-rw-r--r-- | var/spack/repos/builtin/packages/jmol/package.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/jmol/package.py b/var/spack/repos/builtin/packages/jmol/package.py index 6bbe7e28cd..9da452f396 100644 --- a/var/spack/repos/builtin/packages/jmol/package.py +++ b/var/spack/repos/builtin/packages/jmol/package.py @@ -4,6 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * +import os.path class Jmol(Package): @@ -11,15 +12,26 @@ class Jmol(Package): with features for chemicals, crystals, materials and biomolecules.""" homepage = "http://jmol.sourceforge.net/" - url = "https://sourceforge.net/projects/jmol/files/Jmol/Version%2014.8/Jmol%2014.8.0/Jmol-14.8.0-binary.tar.gz" + url = "https://sourceforge.net/projects/jmol/files/Jmol/Version%2014.8/Jmol%2014.8.0/Jmol-14.8.0-binary.tar.gz" + version('14.31.0', sha256='eee0703773607c8bd6d51751d0d062c3e10ce44c11e1d7828e4ea3d5f710e892') version('14.8.0', sha256='8ec45e8d289aa0762194ca71848edc7d736121ddc72276031a253a3651e6d588') + def url_for_version(self, version): + url = 'https://sourceforge.net/projects/jmol/files/Jmol/Version%20{0}/Jmol%20{1}/Jmol-{1}-binary.tar.gz' + return url.format(version.up_to(2), version) + depends_on('java', type='run') def install(self, spec, prefix): - install_tree('jmol-{0}'.format(self.version), prefix) + if os.path.exists('jmol-{0}'.format(self.version)): + # tar ball contains subdir with different versions + install_tree('jmol-{0}'.format(self.version), prefix) + else: + # no subdirs - tarball was unpacked in spack-src + install_tree('./', prefix) def setup_run_environment(self, env): env.prepend_path('PATH', self.prefix) env.set('JMOL_HOME', self.prefix) + env.prepend_path('PATH', self.spec['java'].prefix.bin) |