Massive conversion from Package to CMakePackage (#4975)

This commit is contained in:
Adam J. Stewart
2017-08-05 10:15:18 -05:00
committed by GitHub
parent 17cdb73be7
commit c7df12f698
57 changed files with 410 additions and 677 deletions

View File

@@ -25,7 +25,7 @@
from spack import *
class Piranha(Package):
class Piranha(CMakePackage):
"""Piranha is a computer-algebra library for the symbolic manipulation of
sparse multivariate polynomials and other closely-related symbolic objects
(such as Poisson series)."""
@@ -40,7 +40,7 @@ class Piranha(Package):
description='Build the Python bindings')
# Build dependencies
depends_on('cmake@3.0:', type='build')
depends_on('cmake@3.2.0:', type='build')
extends('python', when='+pyranha')
depends_on('python@2.6:', type='build', when='+pyranha')
@@ -53,21 +53,8 @@ class Piranha(Package):
depends_on('gmp') # mpir is a drop-in replacement for this
depends_on('mpfr') # Could also be built against mpir
def install(self, spec, prefix):
options = []
options.extend(std_cmake_args)
# Python bindings
options.extend([
'-DBUILD_PYRANHA=%s' % (
'ON' if '+python' in spec else 'OFF'),
def cmake_args(self):
return [
'-DBUILD_PYRANHA=%s' % ('ON' if '+python' in self.spec else 'OFF'),
'-DBUILD_TESTS:BOOL=ON',
])
with working_dir('spack-build', create=True):
cmake('..', *options)
make()
make('install')
if self.run_tests:
make('test')
]