apr-util: Fix spack install apr-util +crypto ^openssl~shared (#40301)

This commit is contained in:
Alex Richert
2023-10-11 14:38:28 -07:00
committed by GitHub
parent 7a4b479724
commit df01a11e07

View File

@@ -32,6 +32,7 @@ class AprUtil(AutotoolsPackage):
depends_on("postgresql", when="+pgsql") depends_on("postgresql", when="+pgsql")
depends_on("sqlite", when="+sqlite") depends_on("sqlite", when="+sqlite")
depends_on("unixodbc", when="+odbc") depends_on("unixodbc", when="+odbc")
depends_on("pkg-config", type="build", when="+crypto ^openssl~shared")
@property @property
def libs(self): def libs(self):
@@ -85,6 +86,13 @@ def configure_args(self):
else: else:
args.append("--without-odbc") args.append("--without-odbc")
if spec.satisfies("+crypto ^openssl~shared"):
# Need pkg-config to get zlib and -ldl flags
# (see https://dev.apr.apache.narkive.com/pNnO9F1S/configure-bug-openssl)
pkgconf = which("pkg-config")
ssl_libs = pkgconf("--libs", "--static", "openssl", output=str)
args.append(f"LIBS={ssl_libs}")
return args return args
def check(self): def check(self):