summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/cmake
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2023-07-09 23:48:00 +0200
committerGitHub <noreply@github.com>2023-07-09 17:48:00 -0400
commiteef14ddcadb6af5beec76a2f5a3cb88d4b9eb1ef (patch)
tree2445c57b8b50ddda55681ddc7d7dfa5e0b7e79c7 /var/spack/repos/builtin/packages/cmake
parentdb879a567928d3166365861d85dd1f3be4f0b36e (diff)
downloadspack-eef14ddcadb6af5beec76a2f5a3cb88d4b9eb1ef.tar.gz
spack-eef14ddcadb6af5beec76a2f5a3cb88d4b9eb1ef.tar.bz2
spack-eef14ddcadb6af5beec76a2f5a3cb88d4b9eb1ef.tar.xz
spack-eef14ddcadb6af5beec76a2f5a3cb88d4b9eb1ef.zip
openssl: prefer 3.x (#36729)
* openssl: prefer 3.x This PR is not intended to be merged immediately, but it would be good to see what packages fail to build in CI so that we can get proper version constraints on openssl (before all packages update and support both openssl 1 and 3) * Disable assembly for 3.x %oneapi * cmake: depend on spack curl, to deal with curl - openssl compat * also make zlib external * remove overly strict & unsafe requirement on py-cryptographty patch version number * update openssl compat bounds in py-cryptography * smaller diff * Make libssh2 an autotools/cmake package * fix weird upperbound in libssh2 as there is not openssl v2 * libssh2: pc file lists plain -lssl -lcrypto w/o leading -L flag, confusing libgit2 parsing of pkg-config output * Actually fix the issue in libssh2: its pc file looks broken
Diffstat (limited to 'var/spack/repos/builtin/packages/cmake')
-rw-r--r--var/spack/repos/builtin/packages/cmake/package.py51
1 files changed, 24 insertions, 27 deletions
diff --git a/var/spack/repos/builtin/packages/cmake/package.py b/var/spack/repos/builtin/packages/cmake/package.py
index a70f04152d..2cc358f41b 100644
--- a/var/spack/repos/builtin/packages/cmake/package.py
+++ b/var/spack/repos/builtin/packages/cmake/package.py
@@ -210,10 +210,20 @@ class Cmake(Package):
# transparent to patch Spack's versions of CMake's dependencies.
conflicts("+ownlibs %nvhpc")
+ # Use Spack's curl even if +ownlibs, since that allows us to make use of
+ # the conflicts on the curl package for TLS libs like OpenSSL.
+ # In the past we let CMake build a vendored copy of curl, but had to
+ # provide Spack's TLS libs anyways, which is not flexible, and actually
+ # leads to issues where we have to keep track of the vendored curl version
+ # and its conflicts with OpenSSL.
+ depends_on("curl")
+
+ # When using curl, cmake defaults to using system zlib too, probably because
+ # curl already depends on zlib. Therefore, also unconditionaly depend on zlib.
+ depends_on("zlib")
+
with when("~ownlibs"):
- depends_on("curl")
depends_on("expat")
- depends_on("zlib")
# expat/zlib are used in CMake/CTest, so why not require them in libarchive.
depends_on("libarchive@3.1.0: xar=expat compression=zlib")
depends_on("libarchive@3.3.3:", when="@3.15.0:")
@@ -222,11 +232,6 @@ class Cmake(Package):
depends_on("libuv@1.10.0:", when="@3.12.0:")
depends_on("rhash", when="@3.8.0:")
- for plat in ["darwin", "linux", "cray"]:
- with when("+ownlibs platform=%s" % plat):
- depends_on("openssl")
- depends_on("openssl@:1.0", when="@:3.6.9")
-
depends_on("qt", when="+qt")
depends_on("ncurses", when="+ncurses")
@@ -311,11 +316,6 @@ class Cmake(Package):
flags.append(self.compiler.cxx11_flag)
return (flags, None, None)
- def setup_build_environment(self, env):
- spec = self.spec
- if "+ownlibs" in spec and "platform=windows" not in spec:
- env.set("OPENSSL_ROOT_DIR", spec["openssl"].prefix)
-
def bootstrap_args(self):
spec = self.spec
args = []
@@ -355,6 +355,9 @@ class Cmake(Package):
# use CMake-provided library to avoid circular dependency
args.append("--no-system-jsoncpp")
+ # Whatever +/~ownlibs, use system curl.
+ args.append("--system-curl")
+
if "+qt" in spec:
args.append("--qt-gui")
else:
@@ -369,21 +372,15 @@ class Cmake(Package):
else:
args.append("-DCMAKE_INSTALL_PREFIX=%s" % self.prefix)
- args.append("-DCMAKE_BUILD_TYPE={0}".format(self.spec.variants["build_type"].value))
-
- # Install CMake correctly, even if `spack install` runs
- # inside a ctest environment
- args.append("-DCMake_TEST_INSTALL=OFF")
-
- # When building our own private copy of curl we still require an
- # external openssl.
- if "+ownlibs" in spec:
- if "platform=windows" in spec:
- args.append("-DCMAKE_USE_OPENSSL=OFF")
- else:
- args.append("-DCMAKE_USE_OPENSSL=ON")
-
- args.append("-DBUILD_CursesDialog=%s" % str("+ncurses" in spec))
+ args.extend(
+ [
+ f"-DCMAKE_BUILD_TYPE={self.spec.variants['build_type'].value}",
+ # Install CMake correctly, even if `spack install` runs
+ # inside a ctest environment
+ "-DCMake_TEST_INSTALL=OFF",
+ f"-DBUILD_CursesDialog={'ON' if '+ncurses' in spec else 'OFF'}",
+ ]
+ )
# Make CMake find its own dependencies.
rpaths = spack.build_environment.get_rpaths(self)