From d2a0235d4b9f31a5af9f407ab2c2d1ee4c1a6e48 Mon Sep 17 00:00:00 2001 From: iarspider Date: Tue, 16 Feb 2021 16:57:02 +0100 Subject: [PATCH] gruff: add support for external detection (#21646) --- var/spack/repos/builtin/packages/groff/package.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/var/spack/repos/builtin/packages/groff/package.py b/var/spack/repos/builtin/packages/groff/package.py index 450c4794c0..63c8bf1c4f 100644 --- a/var/spack/repos/builtin/packages/groff/package.py +++ b/var/spack/repos/builtin/packages/groff/package.py @@ -4,6 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * +import re class Groff(AutotoolsPackage, GNUMirrorPackage): @@ -40,6 +41,14 @@ class Groff(AutotoolsPackage, GNUMirrorPackage): patch('BuildFoundries.patch') patch('pdfmom.patch') + executables = ['^groff$'] + + @classmethod + def determine_version(cls, exe): + output = Executable(exe)('--version', output=str, error=str) + match = re.search(r'GNU groff version\s+(\S+)', output) + return match.group(1) if match else None + def configure_args(self): args = [ "--without-x"