From 57218032b025bf23f76a7053f3ddc2208b6e282e Mon Sep 17 00:00:00 2001 From: Jonas Toth Date: Wed, 12 Aug 2020 16:32:56 +0200 Subject: 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 Signed-off-by: Sam James --- dev-libs/date/date-3.0.0.ebuild | 55 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 dev-libs/date/date-3.0.0.ebuild (limited to 'dev-libs/date/date-3.0.0.ebuild') 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 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 +} -- cgit v1.2.3-65-gdbad