From 0a7b0c68cffb172bb446c79b7c0dbdd4ed8d1fee Mon Sep 17 00:00:00 2001 From: Sinan Date: Wed, 4 Jan 2023 13:01:13 -0800 Subject: package/libproxy: fix py3 install (#34431) * package/libproxy: fix py3 install * improve readability * fix bug * also add extend * make flake happy * [@spackbot] updating style on behalf of Sinan81 * Update var/spack/repos/builtin/packages/libproxy/package.py Co-authored-by: Adam J. Stewart * python dependency implied by extends const. * disable python variant by default * add run_env, add py conflict * Update var/spack/repos/builtin/packages/libproxy/package.py Co-authored-by: Adam J. Stewart * set env for macos as well * generalize lib dir detection Co-authored-by: sbulut Co-authored-by: Sinan81 Co-authored-by: Adam J. Stewart --- var/spack/repos/builtin/packages/libproxy/package.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/var/spack/repos/builtin/packages/libproxy/package.py b/var/spack/repos/builtin/packages/libproxy/package.py index b4de7f9c31..1a27509609 100644 --- a/var/spack/repos/builtin/packages/libproxy/package.py +++ b/var/spack/repos/builtin/packages/libproxy/package.py @@ -20,17 +20,29 @@ class Libproxy(CMakePackage): version("0.4.13", sha256="d610bc0ef81a18ba418d759c5f4f87bf7102229a9153fb397d7d490987330ffd") variant("perl", default=False, description="Enable Perl bindings") - variant("python", default=True, description="Enable Python bindings", when="@0.4.16:") + variant("python", default=False, description="Enable Python bindings", when="@0.4.16:") depends_on("zlib") depends_on("perl", type=("build", "run"), when="+perl") - depends_on("python", type=("build", "run"), when="+python") + + extends("python@:3.8", when="+python") def cmake_args(self): - return [ + args = [ self.define_from_variant("WITH_PERL", "perl"), self.define_from_variant("WITH_PYTHON3", "python"), self.define("WITH_DOTNET", False), self.define("WITH_PYTHON2", False), self.define("WITH_VALA", False), ] + if "+python" in self.spec: + args.append(self.define("PYTHON3_SITEPKG_DIR", python_platlib)) + return args + + def setup_run_environment(self, env): + if "+python" in self.spec: + libs = self.spec["libproxy"].libs.directories[0] + if self.spec.satisfies("platform=darwin"): + env.prepend_path("DYLD_FALLBACK_LIBRARY_PATH", libs) + else: + env.prepend_path("LD_LIBRARY_PATH", libs) -- cgit v1.2.3-70-g09d2