gnupg: make discoverable as external (#42736)
This commit is contained in:
parent
c6faab10aa
commit
44d08d2c24
1 changed files with 10 additions and 0 deletions
|
@ -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"):
|
||||
|
|
Loading…
Reference in a new issue