OpenGL: add spack external find support (#18003)

This commit is contained in:
Adam J. Stewart 2020-08-14 01:48:11 -05:00 committed by GitHub
parent 70419c752d
commit 84a16e62d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,