diff options
author | Jonas Toth <gentoo@jonas-toth.eu> | 2020-08-12 16:32:56 +0200 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2020-09-13 05:31:05 +0000 |
commit | 57218032b025bf23f76a7053f3ddc2208b6e282e (patch) | |
tree | fed4c3a08a32efbfb085ad53a7a2ec27f998f8bf /dev-libs/date/date-3.0.0.ebuild | |
parent | app-metrics/consul_exporter: 0.7.1 bump (diff) | |
download | gentoo-57218032b025bf23f76a7053f3ddc2208b6e282e.tar.gz gentoo-57218032b025bf23f76a7053f3ddc2208b6e282e.tar.bz2 gentoo-57218032b025bf23f76a7053f3ddc2208b6e282e.zip |
dev-libs/date: add new 'date' C++ library
The 'date' library is voted into C++20 and Howard Hinnants
implementation serves as a free standing library and foundation for the
standardized library.
Bug: https://bugs.gentoo.org/712236
Package-Manager: Portage-3.0.2, Repoman-2.3.23
Signed-off-by: Jonas Toth <gentoo@jonas-toth.eu>
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-libs/date/date-3.0.0.ebuild')
-rw-r--r-- | dev-libs/date/date-3.0.0.ebuild | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/dev-libs/date/date-3.0.0.ebuild b/dev-libs/date/date-3.0.0.ebuild new file mode 100644 index 000000000000..1b7acb557db0 --- /dev/null +++ b/dev-libs/date/date-3.0.0.ebuild @@ -0,0 +1,55 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake + +DESCRIPTION="A date and time library based on the C++11/14/17 <chrono> header" +HOMEPAGE="https://github.com/HowardHinnant/date" + +SRC_URI="https://github.com/HowardHinnant/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" +KEYWORDS="~amd64" + +LICENSE="MIT" +SLOT="0" +IUSE="only-c-locale test" +RESTRICT="!test? ( test )" + +PATCHES=( + "${FILESDIR}"/${P}-c-locale-export.patch + "${FILESDIR}"/${P}-version.patch +) + +src_prepare() { + # The test cases are implicitly generated with CMake code, that parses + # the file names for ".cpp" and ".fail.cpp". Renaming the source files + # disables the test. + + # This test case fails due to a stdlibc++ bug. + # Upstream bug: https://github.com/HowardHinnant/date/issues/388 + mv "test/date_test/parse.pass.cpp" "test/date_test/parse.disabled" || ewarn "Can not deactivate test case, test failure expected" + + # This test case fails only when the CMAKE_BUILD_TYPE=Gentoo. + # The behaviour seems very strange, but does not appear with a + # "valid" build type. + # Upstream bug: https://github.com/HowardHinnant/date/issues/604 + mv "test/clock_cast_test/local_t.pass.cpp" "test/clock_cast_test/local_t.disabled" || ewarn "Can not deactivate test case, test failure expected" + + cmake_src_prepare +} + +src_configure() { + local mycmakeargs=( + -DBUILD_TZ_LIB=ON + -DUSE_SYSTEM_TZ_DB=ON + -DENABLE_DATE_TESTING=$(usex test) + -DCOMPILE_WITH_C_LOCALE=$(usex only-c-locale) + ) + cmake_src_configure +} + +src_test() { + cd "${BUILD_DIR}" || die + ninja testit +} |