Skip to content

Commit 366433f

Browse files
committed
redisjson package installation working on ANL/Polaris
1 parent a89f09b commit 366433f

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

packages/redisjson/package.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class Redisjson(Package):
1515
.. code-block:: console
1616
1717
redis-server $(spack find --path redisjson | grep -o "/.*/redisjson.*")/redis.conf
18-
redis-server --module $REDISJSON_MODULE_PATH # or use the environment variable
1918
2019
"""
2120

@@ -27,21 +26,24 @@ class Redisjson(Package):
2726
depends_on("rust")
2827
depends_on("redis")
2928

30-
def build(self, spec, prefix):
29+
def setup_build_environment(self, env):
30+
env.set("CARGO_HOME", self.stage.source_path)
31+
32+
def install(self, spec, prefix):
3133
cargo = which("cargo")
3234
cargo("build", "--release")
3335

34-
def install(self, spec, prefix):
3536
mkdir(prefix.lib)
36-
install_tree("target/release", prefix.lib)
37+
install_tree(
38+
join_path(
39+
self.stage.source_path,
40+
"target",
41+
"release"
42+
),
43+
prefix.lib
44+
)
3745

3846
ext = "dylib" if self.spec.satisfies("platform=darwin") else "so"
3947
target = join_path(prefix.lib, f"librejson.{ext}")
4048
with open(join_path(prefix, "redis.conf"), "w") as f:
4149
f.write(f"loadmodule {target}")
42-
43-
def setup_run_environment(self, env):
44-
ext = "dylib" if self.spec.satisfies("platform=darwin") else "so"
45-
target = join_path(prefix.lib, f"librejson.{ext}")
46-
env.set("REDISJSON_MODULE_PATH", target)
47-

0 commit comments

Comments
 (0)