summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2020-08-14 01:48:11 -0500
committerGitHub <noreply@github.com>2020-08-14 08:48:11 +0200
commit84a16e62d6d56609564bb38947571e6a276c83e9 (patch)
treebc9686946a4f7a6d9088c687923f5879436df896 /var
parent70419c752dc64eb6b839b4976e4fe78c5708f5f1 (diff)
downloadspack-84a16e62d6d56609564bb38947571e6a276c83e9.tar.gz
spack-84a16e62d6d56609564bb38947571e6a276c83e9.tar.bz2
spack-84a16e62d6d56609564bb38947571e6a276c83e9.tar.xz
spack-84a16e62d6d56609564bb38947571e6a276c83e9.zip
OpenGL: add spack external find support (#18003)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/opengl/package.py11
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,