visit-cgns: better sets VISIT_PLUGIN_DIR to fit VisIt dir struct (#23834)
This commit is contained in:
parent
202510869d
commit
dcb3fbf98e
@ -17,7 +17,7 @@ class VisitCgns(CMakePackage):
|
|||||||
# These settings are exactly those of VisIt
|
# These settings are exactly those of VisIt
|
||||||
homepage = "https://wci.llnl.gov/simulation/computer-codes/visit/"
|
homepage = "https://wci.llnl.gov/simulation/computer-codes/visit/"
|
||||||
git = "https://github.com/visit-dav/visit.git"
|
git = "https://github.com/visit-dav/visit.git"
|
||||||
url = "https://github.com/visit-dav/visit/releases/download/v3.1.1/visit3.1.1.tar.gz"
|
url = "https://github.com/visit-dav/visit/releases/download/v3.1.1/visit3.1.1.tar.gz"
|
||||||
|
|
||||||
maintainers = ['cyrush', 'cessenat']
|
maintainers = ['cyrush', 'cessenat']
|
||||||
|
|
||||||
@ -25,6 +25,7 @@ class VisitCgns(CMakePackage):
|
|||||||
version('local', url='file://{0}/visit-CGNS.tgz'.format(os.getcwd()))
|
version('local', url='file://{0}/visit-CGNS.tgz'.format(os.getcwd()))
|
||||||
# Below we copy the VisIt paths:
|
# Below we copy the VisIt paths:
|
||||||
version('develop', branch='develop')
|
version('develop', branch='develop')
|
||||||
|
version('3.2.0', sha256='7328fd8592f9aaf17bf79ffcffd7eaec77773926b0843d9053f39c2190dbe1c0')
|
||||||
version('3.1.4', sha256='be20d9acf56f0599e3c511709f48d8d3b232a57425f69d2bd1e2df1eccb84c93')
|
version('3.1.4', sha256='be20d9acf56f0599e3c511709f48d8d3b232a57425f69d2bd1e2df1eccb84c93')
|
||||||
version('3.1.1', sha256='0b60ac52fd00aff3cf212a310e36e32e13ae3ca0ddd1ea3f54f75e4d9b6c6cf0')
|
version('3.1.1', sha256='0b60ac52fd00aff3cf212a310e36e32e13ae3ca0ddd1ea3f54f75e4d9b6c6cf0')
|
||||||
version('3.0.1', sha256='a506d4d83b8973829e68787d8d721199523ce7ec73e7594e93333c214c2c12bd')
|
version('3.0.1', sha256='a506d4d83b8973829e68787d8d721199523ce7ec73e7594e93333c214c2c12bd')
|
||||||
@ -37,19 +38,21 @@ class VisitCgns(CMakePackage):
|
|||||||
version('2.10.1', sha256='6b53dea89a241fd03300a7a3a50c0f773e2fb8458cd3ad06816e9bd2f0337cd8')
|
version('2.10.1', sha256='6b53dea89a241fd03300a7a3a50c0f773e2fb8458cd3ad06816e9bd2f0337cd8')
|
||||||
|
|
||||||
depends_on('cmake', type='build')
|
depends_on('cmake', type='build')
|
||||||
depends_on('cgns@3.3.1+int64~scoping~legacy', when='@2.10.1:3.1.14')
|
depends_on('cgns@3.3.1+int64~scoping~legacy', when='@2.10.1:3.1.4')
|
||||||
depends_on('cgns+int64~scoping~legacy')
|
depends_on('cgns+int64~scoping~legacy')
|
||||||
|
depends_on('visit@3.2.0:', when='@3.2.0:')
|
||||||
depends_on('visit')
|
depends_on('visit')
|
||||||
|
|
||||||
extends('visit')
|
extends('visit')
|
||||||
|
|
||||||
build_targets = ['VERBOSE=1']
|
build_targets = ['VERBOSE=1']
|
||||||
phases = ['cmake', 'build']
|
phases = ['cmake', 'build']
|
||||||
|
extname = 'CGNS'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def root_cmakelists_dir(self):
|
def root_cmakelists_dir(self):
|
||||||
if '@local' not in self.spec:
|
if '@local' not in self.spec:
|
||||||
return join_path('src', 'databases', 'CGNS')
|
return join_path('src', 'databases', self.extname)
|
||||||
else:
|
else:
|
||||||
return '.'
|
return '.'
|
||||||
|
|
||||||
@ -59,9 +62,8 @@ def build_directory(self):
|
|||||||
|
|
||||||
@run_before('cmake')
|
@run_before('cmake')
|
||||||
def run_xml2cmake(self):
|
def run_xml2cmake(self):
|
||||||
spec = self.spec
|
visit = self.spec['visit']
|
||||||
visit = spec['visit']
|
args = ['-v', str(visit.version), '-clobber', '-public', self.extname + '.xml']
|
||||||
args = ['-v', str(visit.version), '-clobber', '-public', 'CGNS.xml']
|
|
||||||
with working_dir(self.root_cmakelists_dir):
|
with working_dir(self.root_cmakelists_dir):
|
||||||
# Regenerate the public cmake files
|
# Regenerate the public cmake files
|
||||||
if os.path.exists("CMakeLists.txt"):
|
if os.path.exists("CMakeLists.txt"):
|
||||||
@ -70,22 +72,20 @@ def run_xml2cmake(self):
|
|||||||
# spack extension activate : alter VISIT_PLUGIN_DIR ;
|
# spack extension activate : alter VISIT_PLUGIN_DIR ;
|
||||||
# xml2cmake should have set it to visit prefix but it can
|
# xml2cmake should have set it to visit prefix but it can
|
||||||
# happen the directory is an alias.
|
# happen the directory is an alias.
|
||||||
f = 0
|
# In that case we match version/smth/plugins.
|
||||||
mstr = r'^SET[(]VISIT_PLUGIN_DIR\s+\"{0}(.+)\"[)]'.format(visit.prefix)
|
mstr = None
|
||||||
|
mstr1 = r'^SET[(]VISIT_PLUGIN_DIR\s+\"{0}(.+)\"[)]'.format(visit.prefix)
|
||||||
|
mstr2 = r'^SET[(]VISIT_PLUGIN_DIR\s+\".+({0}.+?{1})\"[)]'.format(
|
||||||
|
join_path(os.sep, visit.version, ''), join_path(os.sep, 'plugins'))
|
||||||
with open('CMakeLists.txt', 'r') as file:
|
with open('CMakeLists.txt', 'r') as file:
|
||||||
for line in file:
|
for line in file:
|
||||||
if re.search(mstr, line):
|
if re.search(mstr1, line):
|
||||||
f = 1
|
mstr = mstr1
|
||||||
elif re.search(r'^SET\(VISIT_PLUGIN_DIR\s+\"(.+)\"\)', line):
|
elif re.search(mstr2, line):
|
||||||
f = 2
|
mstr = mstr2
|
||||||
cmf = FileFilter('CMakeLists.txt')
|
if mstr is not None:
|
||||||
if f == 1:
|
filter_file(mstr, r'SET(VISIT_PLUGIN_DIR "{0}\1")'.format(prefix),
|
||||||
cmf.filter(mstr, r'SET(VISIT_PLUGIN_DIR "{0}\1")'.format(prefix))
|
'CMakeLists.txt')
|
||||||
elif f == 2:
|
|
||||||
vis = join_path(prefix, spec.platform + '_'
|
|
||||||
+ str(spec.target.family), 'plugins')
|
|
||||||
cmf.filter(r'^SET\(VISIT_PLUGIN_DIR\s+\"(.+)\"\)',
|
|
||||||
r'SET(VISIT_PLUGIN_DIR "{0}")'.format(vis))
|
|
||||||
|
|
||||||
def cmake_args(self):
|
def cmake_args(self):
|
||||||
cgns = self.spec['cgns']
|
cgns = self.spec['cgns']
|
||||||
|
Loading…
Reference in New Issue
Block a user