From c33b8ece8973a5750dd0cdd0af9f138051340424 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Fri, 2 Dec 2022 10:25:45 -0700 Subject: [PATCH] Simplify var/spack/repos/jcsda-emc-bundles/packages/base-env/package.py --- .../packages/base-env/package.py | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/var/spack/repos/jcsda-emc-bundles/packages/base-env/package.py b/var/spack/repos/jcsda-emc-bundles/packages/base-env/package.py index a13dbf4d7698c6..e7507c12d148a8 100644 --- a/var/spack/repos/jcsda-emc-bundles/packages/base-env/package.py +++ b/var/spack/repos/jcsda-emc-bundles/packages/base-env/package.py @@ -29,18 +29,16 @@ class BaseEnv(BundlePackage): depends_on("curl", type="run") # I/O - depends_on("zlib+shared", type="run", when="+shared") - depends_on("zlib~shared", type="run", when="~shared") - depends_on("hdf5+hl+mpi+shared", type="run", when="+shared") - depends_on("hdf5+hl+mpi~shared", type="run", when="~shared") - depends_on("netcdf-c~parallel-netcdf+v2+mpi+shared", type="run", when="+shared") - depends_on("netcdf-c~parallel-netcdf+v2+mpi~shared", type="run", when="~shared") - depends_on("netcdf-fortran+shared", type="run", when="+shared") - depends_on("netcdf-fortran~shared", type="run", when="~shared") - depends_on("parallel-netcdf+shared", type="run", when="+shared") - depends_on("parallel-netcdf~shared", type="run", when="~shared") - depends_on("parallelio+fortran~pnetcdf+shared", type="run", when="+shared") - depends_on("parallelio+fortran~pnetcdf~shared", type="run", when="~shared") + with when("+shared"): + shared_variant = "+shared" + with when("~shared"): + shared_variant = "~shared" + depends_on("zlib{}".format(shared_variant), type="run", when="{}".format(shared_variant)) + depends_on("hdf5{}".format(shared_variant), type="run", when="{}".format(shared_variant)) + depends_on("netcdf-c{}".format(shared_variant), type="run", when="{}".format(shared_variant)) + depends_on("netcdf-fortran{}".format(shared_variant), type="run", when="{}".format(shared_variant)) + depends_on("parallel-netcdf{}".format(shared_variant), type="run", when="{}".format(shared_variant)) + depends_on("parallelio{}".format(shared_variant), type="run", when="{}".format(shared_variant)) depends_on("nccmp", type="run") # Python