gnupg: make discoverable as external (#42736)

This commit is contained in:
Alec Scott 2024-02-19 02:27:39 -08:00 committed by GitHub
parent c6faab10aa
commit 44d08d2c24
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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"):