summaryrefslogtreecommitdiff
path: root/dev-libs/date
diff options
context:
space:
mode:
Diffstat (limited to 'dev-libs/date')
-rw-r--r--dev-libs/date/Manifest5
-rw-r--r--dev-libs/date/date-3.0.0.ebuild55
-rw-r--r--dev-libs/date/files/date-3.0.0-c-locale-export.patch90
-rw-r--r--dev-libs/date/files/date-3.0.0-version.patch15
-rw-r--r--dev-libs/date/metadata.xml20
5 files changed, 185 insertions, 0 deletions
diff --git a/dev-libs/date/Manifest b/dev-libs/date/Manifest
new file mode 100644
index 000000000000..7bc8ed9b69eb
--- /dev/null
+++ b/dev-libs/date/Manifest
@@ -0,0 +1,5 @@
+AUX date-3.0.0-c-locale-export.patch 3628 BLAKE2B 25fcd214430334a2c9f95dbff685957c563bd881ad6669bd7ee7ec7dcf619256cf096b65d76c8968c43192e2dd48b9739225f97e2088a12925d8b3d878ae5f53 SHA512 31f36be9fd6bc3eb8622ea6856b2c5b3bfbfa5a7dae748613839e5432051fe32e0ebe4c6b2c31dba4a0dc4787c85e671cdf321059f26a222b6a16436c3f624ea
+AUX date-3.0.0-version.patch 312 BLAKE2B 6cbfd659c271d39b3441ce980579efb8fa2b002e482710dfafde89ab1978742fb178ed3336d284febfb143f1a81ca23276e04bca3b1a00e218db26f403283acd SHA512 c1165064c48793572ffc02a07728b0fb815f4b8610764f08e9ca53b9fc7fbce83168d39b38191db2ccac69f283b637ac12cc8c1516c99d8e1cdffe9773cd0dfd
+DIST date-3.0.0.tar.gz 822623 BLAKE2B 438a7a5c153c7c2d695fefc95bbd474ef507af2cd8182d1e7d54d482b0128c3f9c57582ed5b40ef46d8f6f5539228d20322c684b1e1b418e5ade3b4871bf4ec1 SHA512 03ba0faef68e053aba888591b9350af1a043ef543825c80b1ca3f0dc0448697f56286e561f1a2a59e684680d7fc1e51fd24955c4cc222fe28db64f56037dc1aa
+EBUILD date-3.0.0.ebuild 1599 BLAKE2B 9eb62cd334e71c10fe02b209f0b78d47fa62d73b54e1a83584c26bb25c3ef07374e95ba1d31ef0100a25bd6bb222ef22105c6001b7a7e6a77d2f31d97efdc571 SHA512 46d468e6ca99498bd2008347584eaaa13958a6ff22e071c4bddf658f1661d54cca881ac0dd3d7580df0bf68f292d1d08281bce50419f8e37286555a61635c129
+MISC metadata.xml 659 BLAKE2B 5e21f2ef7779eb58a8f2ec78005ff01f5b0df2ddaada6acbd2588f2be8ce318665735ad509e705761606917b858c4714722f3f5c261765bb0df70c17ed8b2af5 SHA512 b5ebc03dcafe026118e7b0035671890327c2a719086861ad682fb0bf3e242ac11ebcaa031ffb865e8039b5370b6e28f99d1c4baa7ccf3fa99ee0fbf9e05f7ff9
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..d77a0ca0a183
--- /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/3.0.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
+}
diff --git a/dev-libs/date/files/date-3.0.0-c-locale-export.patch b/dev-libs/date/files/date-3.0.0-c-locale-export.patch
new file mode 100644
index 000000000000..a4e5a9a93ef0
--- /dev/null
+++ b/dev-libs/date/files/date-3.0.0-c-locale-export.patch
@@ -0,0 +1,90 @@
+Fixes an compilation error when 'ONLY_C_LOCALE' is used to build the project.
+
+Upstream-Bug: https://github.com/HowardHinnant/date/issues/589
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -76,10 +76,25 @@ if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.15)
+ # public headers will get installed:
+ set_target_properties( date PROPERTIES PUBLIC_HEADER include/date/date.h )
+ endif ()
+-target_compile_definitions( date INTERFACE
+- #To workaround libstdc++ issue https://github.com/HowardHinnant/date/issues/388
+- ONLY_C_LOCALE=$<IF:$<BOOL:${COMPILE_WITH_C_LOCALE}>,1,0>
+- $<$<BOOL:${DISABLE_STRING_VIEW}>:HAS_STRING_VIEW=0> )
++
++# These used to be set with generator expressions,
++#
++# ONLY_C_LOCALE=$<IF:$<BOOL:${COMPILE_WITH_C_LOCALE}>,1,0>
++#
++# which expand in the output target file to, e.g.
++#
++# ONLY_C_LOCALE=$<IF:$<BOOL:FALSE>,1,0>
++#
++# This string is then (somtimes?) not correctly interpreted.
++if ( COMPILE_WITH_C_LOCALE )
++ # To workaround libstdc++ issue https://github.com/HowardHinnant/date/issues/388
++ target_compile_definitions( date INTERFACE ONLY_C_LOCALE=1 )
++else()
++ target_compile_definitions( date INTERFACE ONLY_C_LOCALE=0 )
++endif()
++if ( DISABLE_STRING_VIEW )
++ target_compile_definitions( date INTERFACE HAS_STRING_VIEW=0 )
++endif()
+
+ #[===================================================================[
+ tz (compiled) library
+@@ -89,27 +104,40 @@ if( BUILD_TZ_LIB )
+ target_sources( date-tz
+ PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>$<INSTALL_INTERFACE:include>/date/tz.h
+- $<$<BOOL:${IOS}>:$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>$<INSTALL_INTERFACE:include>/date/ios.h>
+ PRIVATE
+ include/date/tz_private.h
+- $<$<BOOL:${IOS}>:src/ios.mm>
+ src/tz.cpp )
++ if ( IOS )
++ target_sources( date-tz
++ PUBLIC
++ $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>$<INSTALL_INTERFACE:include>/date/ios.h
++ PRIVATE
++ src/ios.mm )
++ endif()
+ add_library( date::tz ALIAS date-tz )
+ target_link_libraries( date-tz PUBLIC date )
+ target_include_directories( date-tz PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+ $<INSTALL_INTERFACE:include> )
+- target_compile_definitions( date-tz
+- PRIVATE
+- AUTO_DOWNLOAD=$<IF:$<OR:$<BOOL:${USE_SYSTEM_TZ_DB}>,$<BOOL:${MANUAL_TZ_DB}>>,0,1>
+- HAS_REMOTE_API=$<IF:$<OR:$<BOOL:${USE_SYSTEM_TZ_DB}>,$<BOOL:${MANUAL_TZ_DB}>>,0,1>
+- $<$<AND:$<BOOL:${WIN32}>,$<BOOL:${BUILD_SHARED_LIBS}>>:DATE_BUILD_DLL=1>
+- $<$<BOOL:${USE_TZ_DB_IN_DOT}>:INSTALL=.>
+- PUBLIC
+- USE_OS_TZDB=$<IF:$<AND:$<BOOL:${USE_SYSTEM_TZ_DB}>,$<NOT:$<BOOL:${WIN32}>>,$<NOT:$<BOOL:${MANUAL_TZ_DB}>>>,1,0>
+- INTERFACE
+- $<$<AND:$<BOOL:${WIN32}>,$<BOOL:${BUILD_SHARED_LIBS}>>:DATE_USE_DLL=1> )
++
++ if ( USE_SYSTEM_TZ_DB OR MANUAL_TZ_DB )
++ target_compile_definitions( date-tz PRIVATE AUTO_DOWNLOAD=0 HAS_REMOTE_API=0 )
++ else()
++ target_compile_definitions( date-tz PRIVATE AUTO_DOWNLOAD=1 HAS_REMOTE_API=1 )
++ endif()
++
++ if ( USE_SYSTEM_TZ_DB AND NOT WIN32 AND NOT MANUAL_TZ_DB )
++ target_compile_definitions( date-tz PRIVATE INSTALL=. PUBLIC USE_OS_TZDB=1 )
++ else()
++ target_compile_definitions( date-tz PUBLIC USE_OS_TZDB=0 )
++ endif()
++
++ if ( WIN32 AND BUILD_SHARED_LIBS )
++ target_compile_definitions( date-tz PUBLIC DATE_BUILD_DLL=1 )
++ endif()
++
+ set(TZ_HEADERS include/date/tz.h)
++
+ if( IOS )
+ list(APPEND TZ_HEADERS include/date/ios.h)
+ endif( )
+--
diff --git a/dev-libs/date/files/date-3.0.0-version.patch b/dev-libs/date/files/date-3.0.0-version.patch
new file mode 100644
index 000000000000..398b2107059c
--- /dev/null
+++ b/dev-libs/date/files/date-3.0.0-version.patch
@@ -0,0 +1,15 @@
+Fixes an oversight in the build-system versioning.
+
+Upstream-Bug: https://github.com/HowardHinnant/date/issues/583
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -17,7 +17,7 @@
+
+ cmake_minimum_required( VERSION 3.7 )
+
+-project( date VERSION 2.4.1 )
++project( date VERSION 3.0.0 )
+
+ include( GNUInstallDirs )
+
diff --git a/dev-libs/date/metadata.xml b/dev-libs/date/metadata.xml
new file mode 100644
index 000000000000..aaa7e8ae6e5d
--- /dev/null
+++ b/dev-libs/date/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM 'http://www.gentoo.org/dtd/metadata.dtd'>
+<pkgmetadata>
+ <maintainer type="person">
+ <email>gentoo@jonas-toth.eu</email>
+ <name>Jonas Toth</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <use>
+ <flag name="only-c-locale">Build only the C locale</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">HowardHinnant/date</remote-id>
+ <bugs-to>https://github.com/HowardHinnant/date/issues</bugs-to>
+ <changelog>https://github.com/HowardHinnant/date/releases</changelog>
+ </upstream>
+</pkgmetadata>