diff options
author | Adam J. Stewart <ajstewart426@gmail.com> | 2017-05-01 10:00:09 -0500 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2017-05-01 08:00:09 -0700 |
commit | 2511520b32fb6559084684c24ec51f54e30f4bb4 (patch) | |
tree | 51e50132475acdd22cb61bcd4f34691f587f51cd /var | |
parent | b3ce04cba3262865a1a2242f69c7f11d75e6c595 (diff) | |
download | spack-2511520b32fb6559084684c24ec51f54e30f4bb4.tar.gz spack-2511520b32fb6559084684c24ec51f54e30f4bb4.tar.bz2 spack-2511520b32fb6559084684c24ec51f54e30f4bb4.tar.xz spack-2511520b32fb6559084684c24ec51f54e30f4bb4.zip |
Add a WafPackage base class (#3975)
* Add a WafPackage base class
* Correct comment in docstring
* Be more specific about the Python versions supported
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/py-py2cairo/package.py | 17 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/tut/package.py | 14 |
2 files changed, 19 insertions, 12 deletions
diff --git a/var/spack/repos/builtin/packages/py-py2cairo/package.py b/var/spack/repos/builtin/packages/py-py2cairo/package.py index 5626784e34..2eacf540c9 100644 --- a/var/spack/repos/builtin/packages/py-py2cairo/package.py +++ b/var/spack/repos/builtin/packages/py-py2cairo/package.py @@ -25,7 +25,7 @@ from spack import * -class PyPy2cairo(Package): +class PyPy2cairo(WafPackage): """Pycairo is a set of Python bindings for the cairo graphics library.""" homepage = "https://www.cairographics.org/pycairo/" @@ -35,10 +35,15 @@ class PyPy2cairo(Package): extends('python') - depends_on('cairo') + depends_on('python', type=('build', 'run')) + depends_on('cairo@1.10.0:') depends_on('pixman') + depends_on('pkg-config', type='build') - def install(self, spec, prefix): - python('waf', 'configure', '--prefix={0}'.format(prefix)) - python('waf', 'build') - python('waf', 'install') + # TODO: Add a 'test' deptype + # depends_on('py-pytest', type='test') + + def installtest(self): + with working_dir('test'): + pytest = which('py.test') + pytest() diff --git a/var/spack/repos/builtin/packages/tut/package.py b/var/spack/repos/builtin/packages/tut/package.py index 9b135e0964..6c6c6bdb27 100644 --- a/var/spack/repos/builtin/packages/tut/package.py +++ b/var/spack/repos/builtin/packages/tut/package.py @@ -25,7 +25,7 @@ from spack import * -class Tut(Package): +class Tut(WafPackage): """TUT is a small and portable unit test framework for C++.""" homepage = "http://mrzechonek.github.io/tut-framework/" @@ -33,9 +33,11 @@ class Tut(Package): version('2016-12-19', '8b1967fa295ae1ce4d4431c2f811e521') - extends('python') + def build_args(self, spec, prefix): + args = [] - def install(self, spec, prefix): - python('waf', 'configure', '--prefix={0}'.format(prefix)) - python('waf', 'build') - python('waf', 'install') + if self.run_tests: + # Run unit tests + args.append('--test') + + return args |