diff options
author | Geoffrey Gunter <12984092+gmgunter@users.noreply.github.com> | 2020-10-26 18:18:34 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-26 20:18:34 -0500 |
commit | e9223062a8f4f74f6bcf24849753f798d5e168cf (patch) | |
tree | 3103903a4114425cdda8cf3997e797af8e4dac87 | |
parent | bc4e7eabfec37df50911b63aa2f53c14e7ddfa70 (diff) | |
download | spack-e9223062a8f4f74f6bcf24849753f798d5e168cf.tar.gz spack-e9223062a8f4f74f6bcf24849753f798d5e168cf.tar.bz2 spack-e9223062a8f4f74f6bcf24849753f798d5e168cf.tar.xz spack-e9223062a8f4f74f6bcf24849753f798d5e168cf.zip |
New package: date (#19515)
* Add new package: date
* date: resolve style conformance issues
* date: explicitly disable some cmake options
Explicitly disable CMake options corresponding to variant
'tzdb=download'
* date: make more cmake options explicit
* date: simplify defining cmake cli args
-rw-r--r-- | var/spack/repos/builtin/packages/date/package.py | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/date/package.py b/var/spack/repos/builtin/packages/date/package.py new file mode 100644 index 0000000000..0d2e7e5d8a --- /dev/null +++ b/var/spack/repos/builtin/packages/date/package.py @@ -0,0 +1,49 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class Date(CMakePackage): + """A date and time library based on the C++11/14/17 <chrono> header""" + + homepage = "https://github.com/HowardHinnant/date" + url = "https://github.com/HowardHinnant/date/archive/v3.0.0.zip" + + version('3.0.0', sha256='ddbec664607bb6ec7dd4c7be1f9eefc3d8ce88293ffc9391486ce6ce887ec9b2') + + variant('cxxstd', + default='17', + values=('11', '14', '17'), + description='Use the specified C++ standard when building') + variant('shared', + default=False, + description='Build shared instead of static libraries') + variant('tz', default=False, description='Build/install of TZ library') + variant('tzdb', + default='download', + values=('download', 'system', 'manual'), + description="Timezone database source (automatic download, use " + "operating system's database, or manually specify)") + + depends_on('cmake@3.7.0:', type='build') + depends_on('curl', when='+tz tzdb=download') + + def cmake_args(self): + spec = self.spec + args = [ + self.define('CMAKE_CXX_STANDARD', spec.variants['cxxstd'].value), + self.define('CMAKE_CXX_STANDARD_REQUIRED', True), + self.define('BUILD_SHARED_LIBS', '+shared' in spec), + self.define('BUILD_TZ_LIB', '+tz' in spec), + ] + + tzdb = spec.variants['tzdb'].value + args.extend([ + self.define('USE_SYSTEM_TZ_DB', tzdb == 'system'), + self.define('MANUAL_TZ_DB', tzdb == 'manual'), + ]) + + return args |