|
| 1 | +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other |
| 2 | +# Spack Project Developers. See the top-level COPYRIGHT file for details. |
| 3 | +# |
| 4 | +# SPDX-License-Identifier: (Apache-2.0 OR MIT) |
| 5 | + |
| 6 | +from spack import * |
| 7 | + |
| 8 | + |
| 9 | +class Libzmq(AutotoolsPackage): |
| 10 | + """The ZMQ networking/concurrency library and core API""" |
| 11 | + |
| 12 | + homepage = "http://zguide.zeromq.org/" |
| 13 | + url = "https://github.com/zeromq/libzmq/releases/download/v4.3.2/zeromq-4.3.2.tar.gz" |
| 14 | + git = "https://github.com/zeromq/libzmq.git" |
| 15 | + |
| 16 | + version('master', branch='master') |
| 17 | + version('4.3.3', sha256='9d9285db37ae942ed0780c016da87060497877af45094ff9e1a1ca736e3875a2') |
| 18 | + version('4.3.2', sha256='ebd7b5c830d6428956b67a0454a7f8cbed1de74b3b01e5c33c5378e22740f763') |
| 19 | + version('4.3.1', sha256='bcbabe1e2c7d0eec4ed612e10b94b112dd5f06fcefa994a0c79a45d835cd21eb') |
| 20 | + version('4.3.0', sha256='8e9c3af6dc5a8540b356697081303be392ade3f014615028b3c896d0148397fd') |
| 21 | + version('4.2.5', sha256='cc9090ba35713d59bb2f7d7965f877036c49c5558ea0c290b0dcc6f2a17e489f') |
| 22 | + version('4.2.2', sha256='5b23f4ca9ef545d5bd3af55d305765e3ee06b986263b31967435d285a3e6df6b') |
| 23 | + version('4.1.4', sha256='e99f44fde25c2e4cb84ce440f87ca7d3fe3271c2b8cfbc67d55e4de25e6fe378') |
| 24 | + version('4.1.2', sha256='f9162ead6d68521e5154d871bac304f88857308bb02366b81bb588497a345927') |
| 25 | + version('4.1.1', sha256='43d61e5706b43946aad4a661400627bcde9c63cc25816d4749c67b64c3dab8db') |
| 26 | + version('4.0.7', sha256='e00b2967e074990d0538361cc79084a0a92892df2c6e7585da34e4c61ee47b03') |
| 27 | + version('4.0.6', sha256='28a2a9c9b77014c39087a498942449df18bb9885cdb63334833525a1d19f2894') |
| 28 | + version('4.0.5', sha256='3bc93c5f67370341428364ce007d448f4bb58a0eaabd0a60697d8086bc43342b') |
| 29 | + |
| 30 | + variant("libsodium", default=True, |
| 31 | + description="Build with message encryption support via libsodium") |
| 32 | + |
| 33 | + variant("drafts", default=False, |
| 34 | + description="Build and install draft classes and methods") |
| 35 | + |
| 36 | + depends_on("libsodium", when='+libsodium') |
| 37 | + depends_on("libsodium@:1.0.3", when='+libsodium@:4.1.2') |
| 38 | + |
| 39 | + depends_on('autoconf', type='build', when='@develop') |
| 40 | + depends_on('automake', type='build', when='@develop') |
| 41 | + depends_on('libtool', type='build', when='@develop') |
| 42 | + depends_on('pkgconfig', type='build') |
| 43 | + |
| 44 | + depends_on('libbsd', type='link', when='@4.3.3: platform=linux') |
| 45 | + depends_on('libbsd', type='link', when='@4.3.3: platform=cray') |
| 46 | + |
| 47 | + depends_on('libunwind', type=('build','link') ) |
| 48 | + |
| 49 | + conflicts('%gcc@8:', when='@:4.2.2') |
| 50 | + |
| 51 | + def url_for_version(self, version): |
| 52 | + if version <= Version('4.1.4'): |
| 53 | + url = "http://download.zeromq.org/zeromq-{0}.tar.gz" |
| 54 | + else: |
| 55 | + url = "https://github.com/zeromq/libzmq/releases/download/v{0}/zeromq-{0}.tar.gz" |
| 56 | + return url.format(version) |
| 57 | + |
| 58 | + @when('@develop') |
| 59 | + def autoreconf(self, spec, prefix): |
| 60 | + bash = which('bash') |
| 61 | + bash('./autogen.sh') |
| 62 | + |
| 63 | + def configure_args(self): |
| 64 | + config_args = [] |
| 65 | + |
| 66 | + config_args.extend(self.enable_or_disable("drafts")) |
| 67 | + |
| 68 | + if '+libsodium' in self.spec: |
| 69 | + config_args.append('--with-libsodium') |
| 70 | + if 'clang' in self.compiler.cc: |
| 71 | + config_args.append("CFLAGS=-Wno-gnu") |
| 72 | + config_args.append("CXXFLAGS=-Wno-gnu") |
| 73 | + return config_args |
0 commit comments