diff options
author | Adam J. Stewart <ajstewart426@gmail.com> | 2020-08-14 09:05:30 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-14 16:05:30 +0200 |
commit | 73fe3ce158c11ab8b9dee08c652121a16b4cbb2a (patch) | |
tree | 7431dc7843687b18a846528aafb95ed7aaef1d40 /var | |
parent | f901947f69a46071ccede45c32951550e3af7bdf (diff) | |
download | spack-73fe3ce158c11ab8b9dee08c652121a16b4cbb2a.tar.gz spack-73fe3ce158c11ab8b9dee08c652121a16b4cbb2a.tar.bz2 spack-73fe3ce158c11ab8b9dee08c652121a16b4cbb2a.tar.xz spack-73fe3ce158c11ab8b9dee08c652121a16b4cbb2a.zip |
M4: add spack external find support (#16693)
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/m4/package.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/m4/package.py b/var/spack/repos/builtin/packages/m4/package.py index daf89aed16..5ce6bfd0cc 100644 --- a/var/spack/repos/builtin/packages/m4/package.py +++ b/var/spack/repos/builtin/packages/m4/package.py @@ -3,7 +3,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -from spack import * +import re class M4(AutotoolsPackage, GNUMirrorPackage): @@ -32,6 +32,18 @@ class M4(AutotoolsPackage, GNUMirrorPackage): build_directory = 'spack-build' + executables = ['^g?m4$'] + + @classmethod + def determine_version(cls, exe): + # Output on macOS: + # GNU M4 1.4.6 + # Output on Linux: + # m4 (GNU M4) 1.4.18 + output = Executable(exe)('--version', output=str, error=str) + match = re.search(r'GNU M4\)?\s+(\S+)', output) + return match.group(1) if match else None + def configure_args(self): spec = self.spec args = ['--enable-c++'] |