modules : prefix_inspections moved to modules.yaml
This commit is contained in:
parent
c11a665ba1
commit
f8f71b1c2c
@ -5,4 +5,14 @@
|
|||||||
# although users can override these settings in their ~/.spack/modules.yaml.
|
# although users can override these settings in their ~/.spack/modules.yaml.
|
||||||
# -------------------------------------------------------------------------
|
# -------------------------------------------------------------------------
|
||||||
modules:
|
modules:
|
||||||
|
prefix_inspections: {
|
||||||
|
bin: ['PATH'],
|
||||||
|
man: ['MANPATH'],
|
||||||
|
lib: ['LIBRARY_PATH', 'LD_LIBRARY_PATH'],
|
||||||
|
lib64: ['LIBRARY_PATH', 'LD_LIBRARY_PATH'],
|
||||||
|
include: ['CPATH'],
|
||||||
|
lib/pkgconfig: ['PKGCONFIG'],
|
||||||
|
lib64/pkgconfig: ['PKGCONFIG'],
|
||||||
|
'': ['CMAKE_PREFIX_PATH']
|
||||||
|
}
|
||||||
enable: ['tcl', 'dotkit']
|
enable: ['tcl', 'dotkit']
|
||||||
|
@ -315,6 +315,14 @@
|
|||||||
'default': {},
|
'default': {},
|
||||||
'additionalProperties': False,
|
'additionalProperties': False,
|
||||||
'properties': {
|
'properties': {
|
||||||
|
'prefix_inspections': {
|
||||||
|
'type': 'object',
|
||||||
|
'patternProperties': {
|
||||||
|
r'\w[\w-]*': { # path to be inspected for existence (relative to prefix)
|
||||||
|
'$ref': '#/definitions/array_of_strings'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
'enable': {
|
'enable': {
|
||||||
'type': 'array',
|
'type': 'array',
|
||||||
'default': [],
|
'default': [],
|
||||||
|
@ -94,24 +94,12 @@ def inspect_path(prefix):
|
|||||||
"""
|
"""
|
||||||
env = EnvironmentModifications()
|
env = EnvironmentModifications()
|
||||||
# Inspect the prefix to check for the existence of common directories
|
# Inspect the prefix to check for the existence of common directories
|
||||||
prefix_inspections = {
|
prefix_inspections = CONFIGURATION.get('prefix_inspections', {})
|
||||||
'bin': ('PATH',),
|
for relative_path, variables in prefix_inspections.items():
|
||||||
'man': ('MANPATH',),
|
expected = join_path(prefix, relative_path)
|
||||||
'lib': ('LIBRARY_PATH', 'LD_LIBRARY_PATH'),
|
|
||||||
'lib64': ('LIBRARY_PATH', 'LD_LIBRARY_PATH'),
|
|
||||||
'include': ('CPATH',)
|
|
||||||
}
|
|
||||||
for attribute, variables in prefix_inspections.items():
|
|
||||||
expected = getattr(prefix, attribute)
|
|
||||||
if os.path.isdir(expected):
|
if os.path.isdir(expected):
|
||||||
for variable in variables:
|
for variable in variables:
|
||||||
env.prepend_path(variable, expected)
|
env.prepend_path(variable, expected)
|
||||||
# PKGCONFIG
|
|
||||||
for expected in (join_path(prefix.lib, 'pkgconfig'), join_path(prefix.lib64, 'pkgconfig')):
|
|
||||||
if os.path.isdir(expected):
|
|
||||||
env.prepend_path('PKG_CONFIG_PATH', expected)
|
|
||||||
# CMake related variables
|
|
||||||
env.prepend_path('CMAKE_PREFIX_PATH', prefix)
|
|
||||||
return env
|
return env
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user