summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/garfieldpp/package.py26
1 files changed, 25 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/garfieldpp/package.py b/var/spack/repos/builtin/packages/garfieldpp/package.py
index f24d1dc5b2..ec4e1450c6 100644
--- a/var/spack/repos/builtin/packages/garfieldpp/package.py
+++ b/var/spack/repos/builtin/packages/garfieldpp/package.py
@@ -17,6 +17,11 @@ class Garfieldpp(CMakePackage):
tags = ["hep"]
maintainers("mirguest")
+ patch(
+ "https://gitlab.cern.ch/garfield/garfieldpp/-/commit/882c3023cfa89b45ca7a0c95ab1518454536e8e1.patch",
+ sha256="440bc8129c55168e6c45d39e4344911d48ddb13fd3f9ee05974b2ede46a23b93",
+ when="@4.0",
+ )
variant("examples", default=False, description="Build garfield examples")
@@ -29,5 +34,24 @@ class Garfieldpp(CMakePackage):
depends_on("geant4", when="+examples")
def cmake_args(self):
- args = [self.define_from_variant("WITH_EXAMPLES", "examples")]
+ args = [
+ "-DCMAKE_INSTALL_LIBDIR=lib",
+ self.define_from_variant("WITH_EXAMPLES", "examples"),
+ ]
return args
+
+ def setup_run_environment(self, env):
+ env.set("GARFIELD_INSTALL", self.prefix)
+ env.set("HEED_DATABASE", self.prefix.share.Heed.database)
+
+ # In order to get Garfield work in python, need to setup both ROOT and GSL
+ pyver = self.spec["python"].version.up_to(2)
+ site_packages = "python{}/site-packages".format(pyver)
+ pypath = join_path(self.prefix.lib, site_packages)
+ env.prepend_path("PYTHONPATH", pypath)
+ env.prepend_path("LD_LIBRARY_PATH", self.spec["root"].prefix.lib.root)
+ env.prepend_path("LD_LIBRARY_PATH", self.spec["gsl"].prefix.lib.root)
+
+ def setup_dependent_build_environment(self, env):
+ env.set("GARFIELD_INSTALL", self.prefix)
+ env.set("HEED_DATABASE", self.prefix.share.Heed.database)