From 44d08d2c24fd195b7a608f6610ba3e536f8cf9a7 Mon Sep 17 00:00:00 2001 From: Alec Scott Date: Mon, 19 Feb 2024 02:27:39 -0800 Subject: [PATCH] gnupg: make discoverable as external (#42736) --- var/spack/repos/builtin/packages/gnupg/package.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/var/spack/repos/builtin/packages/gnupg/package.py b/var/spack/repos/builtin/packages/gnupg/package.py index d41f2d2632..c59d4875ec 100644 --- a/var/spack/repos/builtin/packages/gnupg/package.py +++ b/var/spack/repos/builtin/packages/gnupg/package.py @@ -3,6 +3,8 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import re + from spack.package import * from spack.util.environment import is_system_path @@ -136,6 +138,14 @@ class Gnupg(AutotoolsPackage): # Getting some linking error. conflicts("%gcc@10:", when="@:1") + executables = ["^gpg$", "^gpg-agent$"] + + @classmethod + def determine_version(cls, exe): + output = Executable(exe)("--version", output=str, error=str) + match = re.search(r"gpg \(GnuPG\) (\S+)", output) + return match.group(1) if match else None + @run_after("install") def add_gpg2_symlink(self): if self.spec.satisfies("@2.0:2"):