diff options
author | Tom Scogland <scogland1@llnl.gov> | 2022-02-16 23:45:24 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-17 08:45:24 +0100 |
commit | a0bd6c8817bbd2839c3fe1e41e627bfabf3c052f (patch) | |
tree | 0664505b326413a78fd38be844a8cd82ab2c1e9d | |
parent | dcdf5022ad37daee7809245cfd68eed72fde6171 (diff) | |
download | spack-a0bd6c8817bbd2839c3fe1e41e627bfabf3c052f.tar.gz spack-a0bd6c8817bbd2839c3fe1e41e627bfabf3c052f.tar.bz2 spack-a0bd6c8817bbd2839c3fe1e41e627bfabf3c052f.tar.xz spack-a0bd6c8817bbd2839c3fe1e41e627bfabf3c052f.zip |
binutils: add external detection (#29022)
-rw-r--r-- | var/spack/repos/builtin/packages/binutils/package.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/binutils/package.py b/var/spack/repos/builtin/packages/binutils/package.py index 1ea2765197..8d4a4ad692 100644 --- a/var/spack/repos/builtin/packages/binutils/package.py +++ b/var/spack/repos/builtin/packages/binutils/package.py @@ -2,6 +2,7 @@ # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import re class Binutils(AutotoolsPackage, GNUMirrorPackage): @@ -12,6 +13,8 @@ class Binutils(AutotoolsPackage, GNUMirrorPackage): maintainers = ['alalazo'] + executables = ['^nm$', '^readelf$'] + version('2.37', sha256='67fc1a4030d08ee877a4867d3dcab35828148f87e1fd05da6db585ed5a166bd4') version('2.36.1', sha256='5b4bd2e79e30ce8db0abd76dd2c2eae14a94ce212cfc59d3c37d23e24bc6d7a3') version('2.35.2', sha256='cfa7644dbecf4591e136eb407c1c1da16578bd2b03f0c2e8acdceba194bb9d61') @@ -80,6 +83,12 @@ class Binutils(AutotoolsPackage, GNUMirrorPackage): # --disable-ld flag conflicts('~ld', '+gold') + @classmethod + def determine_version(cls, exe): + output = Executable(exe)('--version', output=str, error=str) + match = re.search(r'GNU Binutils.*\) (\S+)', output) + return match.group(1) if match else None + def setup_build_environment(self, env): if self.spec.satisfies('%cce'): |