summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/curl/package.py
diff options
context:
space:
mode:
authorNils Leif Fischer <nils.fischer@aei.mpg.de>2022-01-12 10:24:10 +0100
committerGitHub <noreply@github.com>2022-01-12 10:24:10 +0100
commit4e0372b9b78d31dae7456376468c1f26e8aa60fb (patch)
tree7b3a4b4aec2f643cab91633d4ff641b8bf8d899f /var/spack/repos/builtin/packages/curl/package.py
parent5476e5d035410e228b6978d116551fc8da2486e0 (diff)
downloadspack-4e0372b9b78d31dae7456376468c1f26e8aa60fb.tar.gz
spack-4e0372b9b78d31dae7456376468c1f26e8aa60fb.tar.bz2
spack-4e0372b9b78d31dae7456376468c1f26e8aa60fb.tar.xz
spack-4e0372b9b78d31dae7456376468c1f26e8aa60fb.zip
curl: add support for external detection (#28331)
Diffstat (limited to 'var/spack/repos/builtin/packages/curl/package.py')
-rw-r--r--var/spack/repos/builtin/packages/curl/package.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/curl/package.py b/var/spack/repos/builtin/packages/curl/package.py
index 5f3f26d898..2942bc2012 100644
--- a/var/spack/repos/builtin/packages/curl/package.py
+++ b/var/spack/repos/builtin/packages/curl/package.py
@@ -3,6 +3,7 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+import re
import sys
from spack import *
@@ -16,6 +17,8 @@ class Curl(AutotoolsPackage):
# URL must remain http:// so Spack can bootstrap curl
url = "http://curl.haxx.se/download/curl-7.78.0.tar.bz2"
+ executables = ['^curl$']
+
version('7.80.0', sha256='dd0d150e49cd950aff35e16b628edf04927f0289df42883750cf952bb858189c')
version('7.79.1', sha256='de62c4ab9a9316393962e8b94777a570bb9f71feb580fb4475e412f2f9387851')
version('7.79.0', sha256='d607a677f473f79f96c964100327125a6204a39d835dc00dab7fc0129b959f42')
@@ -103,6 +106,35 @@ class Curl(AutotoolsPackage):
# curl queries pkgconfig for openssl compilation flags
depends_on('pkgconfig', type='build')
+ @classmethod
+ def determine_version(cls, exe):
+ curl = Executable(exe)
+ output = curl('--version', output=str, error=str)
+ match = re.match(r'curl ([\d.]+)', output)
+ return match.group(1) if match else None
+
+ @classmethod
+ def determine_variants(cls, exes, version):
+ for exe in exes:
+ variants = ''
+ curl = Executable(exe)
+ output = curl('--version', output=str, error='str')
+ if 'nghttp2' in output:
+ variants += '+nghttp2'
+ protocols_match = re.search(r'Protocols: (.*)\n', output)
+ if protocols_match:
+ protocols = protocols_match.group(1).strip().split(' ')
+ if 'ldap' in protocols:
+ variants += '+ldap'
+ features_match = re.search(r'Features: (.*)\n', output)
+ if features_match:
+ features = features_match.group(1).strip().split(' ')
+ if 'GSS-API' in features:
+ variants += '+gssapi'
+ # TODO: Determine TLS backend if needed.
+ # TODO: Determine more variants.
+ return variants
+
def configure_args(self):
spec = self.spec