[!6] Some cleanup

Merge branch 'feature/cleanups' into 'master'

ref:spack/dune-spack\> Regarding coding style and use of Spack functions.

Builds on top of [!5]

See merge request [spack/dune-spack!6]

  [!5]: gitlab.dune-project.org/NoneNone/merge_requests/5
  [spack/dune-spack!6]: gitlab.dune-project.org/spack/dune-spack/merge_requests/6
This commit is contained in:
Dominic Kempf 2020-05-15 09:19:07 +00:00
commit a3e5890ca9
1 changed files with 12 additions and 18 deletions

View File

@ -24,8 +24,6 @@ import os
from spack import *
class Dune(CMakePackage):
"""
DUNE, the Distributed and Unified Numerics Environment is a modular toolbox for solving partial differential equations (PDEs) with grid-based methods.
@ -265,32 +263,28 @@ class Dune(CMakePackage):
def cmake(self, spec, prefix):
if self.stage.archive_file:
os.remove(self.stage.archive_file)
optFile = open(self.stage.source_path+"/../dune.opts", "w")
optFile.write('CMAKE_FLAGS="')
for flag in self.cmake_args():
optFile.write(flag.replace("\"", "'")+" ")
optFile.write('-DCMAKE_INSTALL_PREFIX=%s' % prefix)
optFile.write('"')
optFile.close()
set_executable('bin/dunecontrol')
# Write an opts file for later use
with open(join_path(self.stage.source_path, "..", "dune.opts"), "w") as optFile:
optFile.write('CMAKE_FLAGS="')
for flag in self.cmake_args():
optFile.write(flag.replace("\"", "'")+" ")
optFile.write('-DCMAKE_INSTALL_PREFIX=%s' % prefix)
optFile.write('"')
installer = Executable('bin/dunecontrol')
options_file=self.stage.source_path+"/../dune.opts"
options_file = join_path(self.stage.source_path, "..", "dune.opts")
installer('--builddir=%s'%self.build_directory , '--opts=%s' % options_file, 'cmake')
pass
def install(self, spec, prefix):
set_executable('bin/dunecontrol')
installer = Executable('bin/dunecontrol')
options_file=self.stage.source_path+"/../dune.opts"
options_file = join_path(self.stage.source_path, "..", "dune.opts")
installer('--builddir=%s'%self.build_directory , '--opts=%s' % options_file, 'make', 'install')
pass
def build(self, spec, prefix):
set_executable('bin/dunecontrol')
installer = Executable('bin/dunecontrol')
options_file=self.stage.source_path+"/../dune.opts"
options_file = join_path(self.stage.source_path, "..", "dune.opts")
installer('--builddir=%s'%self.build_directory , '--opts=%s' % options_file, 'make')
pass
@run_after('install')
def install_python_components(self):