From dc911661ca1ea15d0e4f39ed530900dd615f2178 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Thu, 15 Jun 2017 05:35:56 -0500 Subject: Add missing doc variant to fenics package (#4473) --- var/spack/repos/builtin/packages/fenics/package.py | 37 +++++++++++++--------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/var/spack/repos/builtin/packages/fenics/package.py b/var/spack/repos/builtin/packages/fenics/package.py index 4be94a96b8..1db9614dc2 100644 --- a/var/spack/repos/builtin/packages/fenics/package.py +++ b/var/spack/repos/builtin/packages/fenics/package.py @@ -25,7 +25,7 @@ from spack import * -class Fenics(Package): +class Fenics(CMakePackage): """FEniCS is organized as a collection of interoperable components that together form the FEniCS Project. These components include the problem-solving environment DOLFIN, the form compiler FFC, the @@ -35,9 +35,10 @@ class Fenics(Package): homepage = "http://fenicsproject.org/" url = "https://bitbucket.org/fenics-project/dolfin/downloads/dolfin-1.6.0.tar.gz" - base_url = "https://bitbucket.org/fenics-project/{pkg}/downloads/{pkg}-{version}.tar.gz" + python_components = ['ufl', 'ffc', 'fiat', 'instant'] + variant('hdf5', default=True, description='Compile with HDF5') variant('parmetis', default=True, description='Compile with ParMETIS') variant('scotch', default=True, description='Compile with Scotch') @@ -56,6 +57,8 @@ class Fenics(Package): description='Enables the build of shared libraries') variant('debug', default=False, description='Builds a debug version of the libraries') + variant('doc', default=False, + description='Builds the documentation') # not part of spack list for now # variant('petsc4py', default=True, description='Uses PETSc4py') @@ -68,7 +71,7 @@ class Fenics(Package): extends('python') - depends_on('eigen@3.2.0:', type='build') + depends_on('eigen@3.2.0:') depends_on('boost+filesystem+program_options+system+iostreams+timer+regex+chrono') depends_on('mpi', when='+mpi') @@ -88,7 +91,7 @@ class Fenics(Package): depends_on('py-numpy', type=('build', 'run')) depends_on('py-sympy', type=('build', 'run')) depends_on('swig@3.0.3:', type=('build', 'run')) - depends_on('cmake@2.8.12:', type=('build', 'run')) + depends_on('cmake@2.8.12:', type='build') depends_on('py-setuptools', type='build') depends_on('py-sphinx@1.0.1:', when='+doc', type='build') @@ -140,14 +143,14 @@ class Fenics(Package): def cmake_is_on(self, option): return 'ON' if option in self.spec else 'OFF' - def install(self, spec, prefix): - for package in ['ufl', 'ffc', 'fiat', 'instant']: - with working_dir(join_path('depends', package)): - setup_py('install', '--prefix=%s' % prefix) + def cmake_args(self): + spec = self.spec - cmake_args = [ + return [ '-DCMAKE_BUILD_TYPE:STRING={0}'.format( 'Debug' if '+debug' in spec else 'RelWithDebInfo'), + '-DDOLFIN_ENABLE_DOCS:BOOL={0}'.format( + self.cmake_is_on('+doc')), '-DBUILD_SHARED_LIBS:BOOL={0}'.format( self.cmake_is_on('+shared')), '-DDOLFIN_SKIP_BUILD_TESTS:BOOL=ON', @@ -189,10 +192,14 @@ class Fenics(Package): self.cmake_is_on('zlib')), ] - cmake_args.extend(std_cmake_args) - - with working_dir('build', create=True): - cmake('..', *cmake_args) + @run_after('build') + def build_python_components(self): + for package in self.python_components: + with working_dir(join_path('depends', package)): + setup_py('build') - make() - make('install') + @run_after('install') + def install_python_components(self): + for package in self.python_components: + with working_dir(join_path('depends', package)): + setup_py('install', '--prefix={0}'.format(self.prefix)) -- cgit v1.2.3-60-g2f50