From 86d2200523ed793836c02097135cb100bd487c63 Mon Sep 17 00:00:00 2001 From: Alex Richert <82525672+AlexanderRichert-NOAA@users.noreply.github.com> Date: Wed, 11 Oct 2023 10:37:48 -0700 Subject: [PATCH] krb5: Fix spack install krb5 ^openssl~shared (#40306) --- var/spack/repos/builtin/packages/krb5/package.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/var/spack/repos/builtin/packages/krb5/package.py b/var/spack/repos/builtin/packages/krb5/package.py index db9218cdff..84dc616066 100644 --- a/var/spack/repos/builtin/packages/krb5/package.py +++ b/var/spack/repos/builtin/packages/krb5/package.py @@ -35,6 +35,7 @@ class Krb5(AutotoolsPackage): depends_on("openssl") depends_on("gettext") depends_on("findutils", type="build") + depends_on("pkgconfig", type="build", when="^openssl~shared") variant( "shared", default=True, description="install shared libraries if True, static if false" @@ -80,6 +81,11 @@ def configure_args(self): if "%gcc@10:" in self.spec: args.append("CFLAGS=-fcommon") + if self.spec["openssl"].satisfies("~shared"): + pkgconf = which("pkg-config") + ssllibs = pkgconf("--static", "--libs", "openssl", output=str) + args.append(f"LDFLAGS={ssllibs}") + return args def flag_handler(self, name, flags):