pkgconfig: add spack external find support (#16690)

This commit is contained in:
Adam J. Stewart 2020-08-14 09:07:17 -05:00 committed by GitHub
parent c18167d01f
commit 512ef506a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 0 deletions

View File

@ -27,6 +27,20 @@ class PkgConfig(AutotoolsPackage):
parallel = False
executables = ['^pkg-config$']
@classmethod
def determine_version(cls, exe):
exe = Executable(exe)
# Make sure this is actually pkg-config, not pkgconf
if 'usage: pkgconf' in exe('--help', output=str, error=str):
return None
version = exe('--version', output=str, error=str).rstrip()
return version
def setup_dependent_build_environment(self, env, dependent_spec):
"""Adds the ACLOCAL path for autotools."""
env.append_path('ACLOCAL_PATH', self.prefix.share.aclocal)

View File

@ -31,6 +31,20 @@ class Pkgconf(AutotoolsPackage):
# TODO: Add a package for the kyua testing framework
# depends_on('kyua', type='test')
executables = ['^pkgconf$', '^pkg-config$']
@classmethod
def determine_version(cls, exe):
exe = Executable(exe)
# Make sure this is actually pkgconf, not pkg-config
if 'usage: pkgconf' not in exe('--help', output=str, error=str):
return None
version = exe('--version', output=str, error=str).rstrip()
return version
def setup_dependent_build_environment(self, env, dependent_spec):
"""Adds the ACLOCAL path for autotools."""
env.append_path('ACLOCAL_PATH', self.prefix.share.aclocal)