Bazel: add spack external find support (#18008)
This commit is contained in:
parent
84a16e62d6
commit
be046d7341
@ -3,6 +3,8 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
|
|
||||||
class Bazel(Package):
|
class Bazel(Package):
|
||||||
"""Bazel is an open-source build and test tool similar to Make, Maven, and
|
"""Bazel is an open-source build and test tool similar to Make, Maven, and
|
||||||
@ -135,6 +137,14 @@ class Bazel(Package):
|
|||||||
|
|
||||||
phases = ['bootstrap', 'install']
|
phases = ['bootstrap', 'install']
|
||||||
|
|
||||||
|
executables = ['^bazel$']
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def determine_version(cls, exe):
|
||||||
|
output = Executable(exe)('version', output=str, error=str)
|
||||||
|
match = re.search(r'Build label: ([\d.]+)', output)
|
||||||
|
return match.group(1) if match else None
|
||||||
|
|
||||||
def url_for_version(self, version):
|
def url_for_version(self, version):
|
||||||
if version >= Version('0.4.1'):
|
if version >= Version('0.4.1'):
|
||||||
url = 'https://github.com/bazelbuild/bazel/releases/download/{0}/bazel-{0}-dist.zip'
|
url = 'https://github.com/bazelbuild/bazel/releases/download/{0}/bazel-{0}-dist.zip'
|
||||||
|
Loading…
Reference in New Issue
Block a user