OpenGL: add spack external find support (#18003)
This commit is contained in:
parent
70419c752d
commit
84a16e62d6
1 changed files with 9 additions and 2 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue