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 <ajstewart426@gmail.com> * 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 <ajstewart426@gmail.com> * set env for macos as well * generalize lib dir detection Co-authored-by: sbulut <sbulut@3vgeomatics.com> Co-authored-by: Sinan81 <Sinan81@users.noreply.github.com> Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
This commit is contained in:
parent
6a44a146af
commit
0a7b0c68cf
1 changed files with 15 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue