summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2017-06-15 05:35:56 -0500
committerTodd Gamblin <tgamblin@llnl.gov>2017-06-15 12:35:56 +0200
commitdc911661ca1ea15d0e4f39ed530900dd615f2178 (patch)
tree56f355e1b3b65fec864d64c9ccc78c4f5f8dff07 /var
parent27e6e8715e6c3176718660653713ab410250e3c6 (diff)
downloadspack-dc911661ca1ea15d0e4f39ed530900dd615f2178.tar.gz
spack-dc911661ca1ea15d0e4f39ed530900dd615f2178.tar.bz2
spack-dc911661ca1ea15d0e4f39ed530900dd615f2178.tar.xz
spack-dc911661ca1ea15d0e4f39ed530900dd615f2178.zip
Add missing doc variant to fenics package (#4473)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/fenics/package.py37
1 files 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))