diff options
author | Olivier Cessenat <cessenat@gmail.com> | 2021-10-07 12:19:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-07 10:19:58 +0000 |
commit | 20ee786d09907bc0e028c3c86b77505a496b0539 (patch) | |
tree | f2cdb65d15bc95104dd00c979adfb2e29f89eb8f | |
parent | 653d5e15909230f58818c5dbbc4d4769b8981159 (diff) | |
download | spack-20ee786d09907bc0e028c3c86b77505a496b0539.tar.gz spack-20ee786d09907bc0e028c3c86b77505a496b0539.tar.bz2 spack-20ee786d09907bc0e028c3c86b77505a496b0539.tar.xz spack-20ee786d09907bc0e028c3c86b77505a496b0539.zip |
visit: add an external find function (determine_version) (#25817)
* visit: add an external find function (determine_version)
* visit: correct too long comment line
* visit: forgot to set executables
* visit: external find uses signgle dash version
* visit: found as external asking visit version
-rw-r--r-- | var/spack/repos/builtin/packages/visit/package.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/visit/package.py b/var/spack/repos/builtin/packages/visit/package.py index 3bd6bb0e17..68276b9831 100644 --- a/var/spack/repos/builtin/packages/visit/package.py +++ b/var/spack/repos/builtin/packages/visit/package.py @@ -64,6 +64,8 @@ class Visit(CMakePackage): extendable = True + executables = ['^visit$'] + version('develop', branch='develop') version('3.1.1', sha256='0b60ac52fd00aff3cf212a310e36e32e13ae3ca0ddd1ea3f54f75e4d9b6c6cf0') version('3.0.1', sha256='a506d4d83b8973829e68787d8d721199523ce7ec73e7594e93333c214c2c12bd') @@ -282,3 +284,12 @@ class Visit(CMakePackage): args.append('-DVISIT_MPI_COMPILER={0}'.format(spec['mpi'].mpicxx)) return args + + # https://spack.readthedocs.io/en/latest/packaging_guide.html?highlight=executables#making-a-package-discoverable-with-spack-external-find + # Here we are only able to determine the latest version + # despite VisIt may have multiple versions + @classmethod + def determine_version(cls, exe): + output = Executable(exe)('-version', output=str, error=str) + match = re.search(r'\s*(\d[\d\.]+)\.', output) + return match.group(1) if match else None |