From ef32f3880f8d3ef67256a9bcddba25c393ec141b Mon Sep 17 00:00:00 2001 From: Matthew Krafczyk Date: Tue, 3 Jan 2017 16:07:12 -0600 Subject: Add rockstar support to py-yt package --- var/spack/repos/builtin/packages/py-yt/package.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/py-yt/package.py b/var/spack/repos/builtin/packages/py-yt/package.py index 00ea99c625..2e592b4ab0 100644 --- a/var/spack/repos/builtin/packages/py-yt/package.py +++ b/var/spack/repos/builtin/packages/py-yt/package.py @@ -53,6 +53,7 @@ class PyYt(Package): variant("astropy", default=True, description="enable astropy support") variant("h5py", default=True, description="enable h5py support") variant("scipy", default=True, description="enable scipy support") + variant("rockstar", default=False, description="enable rockstar support") extends("python") @@ -65,9 +66,15 @@ class PyYt(Package): depends_on("py-scipy", type=('build', 'run'), when="+scipy") depends_on("py-setuptools", type="build") depends_on("py-sympy", type=('build', 'run')) + depends_on("rockstar@yt", type=('build', 'run'), when="+rockstar") depends_on("python @2.7:2.999,3.4:") def install(self, spec, prefix): + if '+rockstar' in spec: + if os.path.exists('rockstar.cfg'): + rm('rockstar.cfg') + rockstar_cfg = open('rockstar.cfg', 'w') + rockstar_cfg.write(os.environ['ROCKSTAR_DIR']+"/lib\n") setup_py("install", "--prefix=%s" % prefix) self.check_install(spec, prefix) -- cgit v1.2.3-70-g09d2 From fa39273e1fb1cf12b1be3083918f12699025e802 Mon Sep 17 00:00:00 2001 From: Matthew Krafczyk Date: Wed, 4 Jan 2017 17:49:05 -0500 Subject: Correct how rockstar prefix is found and written to file --- var/spack/repos/builtin/packages/py-yt/package.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/py-yt/package.py b/var/spack/repos/builtin/packages/py-yt/package.py index 2e592b4ab0..4de7cf700e 100644 --- a/var/spack/repos/builtin/packages/py-yt/package.py +++ b/var/spack/repos/builtin/packages/py-yt/package.py @@ -72,9 +72,10 @@ class PyYt(Package): def install(self, spec, prefix): if '+rockstar' in spec: if os.path.exists('rockstar.cfg'): - rm('rockstar.cfg') + os.remove('rockstar.cfg') rockstar_cfg = open('rockstar.cfg', 'w') - rockstar_cfg.write(os.environ['ROCKSTAR_DIR']+"/lib\n") + rockstar_cfg.write(spec.get_dependency('rockstar').spec.prefix) + rockstar_cfg.close() setup_py("install", "--prefix=%s" % prefix) self.check_install(spec, prefix) -- cgit v1.2.3-70-g09d2