2019-01-01 14:04:23 +08:00
|
|
|
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
|
2018-10-08 04:52:23 +08:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
2016-05-12 12:22:25 +08:00
|
|
|
#
|
2018-10-08 04:52:23 +08:00
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
|
2014-11-02 06:00:24 +08:00
|
|
|
from spack import *
|
|
|
|
|
2016-08-10 16:50:00 +08:00
|
|
|
|
2017-01-19 02:34:09 +08:00
|
|
|
class Gnutls(AutotoolsPackage):
|
2017-06-20 04:13:18 +08:00
|
|
|
"""GnuTLS is a secure communications library implementing the SSL, TLS
|
|
|
|
and DTLS protocols and technologies around them. It provides a simple C
|
|
|
|
language application programming interface (API) to access the secure
|
|
|
|
communications protocols as well as APIs to parse and write X.509, PKCS
|
|
|
|
#12, OpenPGP and other required structures. It is aimed to be portable
|
|
|
|
and efficient with focus on security and interoperability."""
|
2014-11-02 06:00:24 +08:00
|
|
|
|
|
|
|
homepage = "http://www.gnutls.org"
|
2019-05-16 01:07:31 +08:00
|
|
|
url = "https://www.gnupg.org/ftp/gcrypt/gnutls/v3.5/gnutls-3.5.19.tar.xz"
|
2014-11-02 06:00:24 +08:00
|
|
|
|
2019-05-29 04:23:59 +08:00
|
|
|
version('3.6.8', sha256='aa81944e5635de981171772857e72be231a7e0f559ae0292d2737de475383e83')
|
2019-05-27 09:45:16 +08:00
|
|
|
version('3.6.7.1', sha256='881b26409ecd8ea4c514fd3fbdb6fae5fab422ca7b71116260e263940a4bbbad')
|
2019-05-16 01:07:31 +08:00
|
|
|
version('3.5.19', sha256='1936eb64f03aaefd6eb16cef0567457777618573826b94d03376bb6a4afadc44')
|
2019-10-11 13:44:41 +08:00
|
|
|
version('3.5.13', sha256='79f5480ad198dad5bc78e075f4a40c4a315a1b2072666919d2d05a08aec13096')
|
|
|
|
version('3.5.10', sha256='af443e86ba538d4d3e37c4732c00101a492fe4b56a55f4112ff0ab39dbe6579d')
|
|
|
|
version('3.5.9', sha256='82b10f0c4ef18f4e64ad8cef5dbaf14be732f5095a41cf366b4ecb4050382951')
|
|
|
|
version('3.3.9', sha256='39166de5293a9d30ef1cd0a4d97f01fdeed7d7dbf8db95392e309256edcb13c1')
|
2014-11-02 06:00:24 +08:00
|
|
|
|
2017-06-20 04:13:18 +08:00
|
|
|
variant('zlib', default=True, description='Enable zlib compression support')
|
2019-06-26 01:08:28 +08:00
|
|
|
variant('guile', default=False, description='Enable Guile bindings')
|
|
|
|
|
|
|
|
# gnutls+guile is currently broken on MacOS. See Issue #11668
|
|
|
|
conflicts('+guile', when='platform=darwin')
|
2017-06-20 04:13:18 +08:00
|
|
|
|
2017-03-30 15:16:56 +08:00
|
|
|
# Note that version 3.3.9 of gnutls doesn't support nettle 3.0.
|
2019-05-27 09:45:16 +08:00
|
|
|
depends_on('nettle@3.4.1:', when='@3.6.7.1:')
|
2019-05-29 04:23:59 +08:00
|
|
|
depends_on('guile', when='+guile')
|
2017-06-20 04:13:18 +08:00
|
|
|
depends_on('nettle@:2.9', when='@3.3.9')
|
|
|
|
depends_on('nettle', when='@3.5:')
|
2019-05-16 01:07:31 +08:00
|
|
|
depends_on('libidn2@:2.0.99', when='@:3.5.99')
|
2017-06-20 04:13:18 +08:00
|
|
|
depends_on('zlib', when='+zlib')
|
|
|
|
depends_on('gettext')
|
|
|
|
|
2017-11-23 23:05:38 +08:00
|
|
|
depends_on('pkgconfig', type='build')
|
2017-03-27 23:29:56 +08:00
|
|
|
|
|
|
|
build_directory = 'spack-build'
|
2017-03-29 16:55:02 +08:00
|
|
|
|
2017-03-30 15:16:56 +08:00
|
|
|
def url_for_version(self, version):
|
|
|
|
url = "https://www.gnupg.org/ftp/gcrypt/gnutls/v{0}/gnutls-{1}.tar.xz"
|
|
|
|
return url.format(version.up_to(2), version)
|
|
|
|
|
2019-11-30 05:00:44 +08:00
|
|
|
def setup_build_environment(self, env):
|
2019-06-06 01:14:06 +08:00
|
|
|
spec = self.spec
|
|
|
|
if '+guile' in spec:
|
2019-11-30 05:00:44 +08:00
|
|
|
env.set('GUILE', spec["guile"].prefix.bin.guile)
|
2019-06-06 01:14:06 +08:00
|
|
|
|
2017-03-29 16:55:02 +08:00
|
|
|
def configure_args(self):
|
2017-06-20 04:13:18 +08:00
|
|
|
spec = self.spec
|
|
|
|
args = [
|
|
|
|
'--enable-static',
|
|
|
|
]
|
|
|
|
|
|
|
|
if spec.satisfies('@3.5:'):
|
2017-03-29 16:55:02 +08:00
|
|
|
# use shipped libraries, might be turned into variants
|
|
|
|
args.append('--with-included-libtasn1')
|
|
|
|
args.append('--with-included-unistring')
|
|
|
|
args.append('--without-p11-kit') # p11-kit@0.23.1: ...
|
2017-06-20 04:13:18 +08:00
|
|
|
|
|
|
|
if '+zlib' in spec:
|
|
|
|
args.append('--with-zlib')
|
|
|
|
else:
|
|
|
|
args.append('--without-zlib')
|
|
|
|
|
2019-05-29 04:23:59 +08:00
|
|
|
if '+guile' in spec:
|
|
|
|
args.append('--enable-guile')
|
|
|
|
else:
|
|
|
|
args.append('--disable-guile')
|
|
|
|
|
2017-06-20 04:13:18 +08:00
|
|
|
if self.run_tests:
|
|
|
|
args.extend([
|
|
|
|
'--enable-tests',
|
|
|
|
'--enable-valgrind-tests',
|
|
|
|
'--enable-full-test-suite',
|
|
|
|
])
|
|
|
|
else:
|
|
|
|
args.extend([
|
|
|
|
'--disable-tests',
|
|
|
|
'--disable-valgrind-tests',
|
|
|
|
'--disable-full-test-suite',
|
|
|
|
])
|
|
|
|
|
2017-03-29 16:55:02 +08:00
|
|
|
return args
|