diff options
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/opengl/package.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/opengl/package.py b/var/spack/repos/builtin/packages/opengl/package.py index 413b8e0f45..54eda66e70 100644 --- a/var/spack/repos/builtin/packages/opengl/package.py +++ b/var/spack/repos/builtin/packages/opengl/package.py @@ -3,10 +3,9 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import re import sys -from spack import * - class Opengl(Package): """Placeholder for external OpenGL libraries from hardware vendors""" @@ -35,6 +34,14 @@ class Opengl(Package): if sys.platform != 'darwin': provides('glx@1.4') + executables = ['^glxinfo$'] + + @classmethod + def determine_version(cls, exe): + output = Executable(exe)(output=str, error=str) + match = re.search(r'OpenGL version string: (\S+)', output) + return match.group(1) if match else None + # Override the fetcher method to throw a useful error message; # fixes GitHub issue (#7061) in which this package threw a # generic, uninformative error during the `fetch` step, |