1 |
commit: 57218032b025bf23f76a7053f3ddc2208b6e282e |
2 |
Author: Jonas Toth <gentoo <AT> jonas-toth <DOT> eu> |
3 |
AuthorDate: Wed Aug 12 14:32:56 2020 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Sep 13 05:31:05 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=57218032 |
7 |
|
8 |
dev-libs/date: add new 'date' C++ library |
9 |
|
10 |
The 'date' library is voted into C++20 and Howard Hinnants |
11 |
implementation serves as a free standing library and foundation for the |
12 |
standardized library. |
13 |
|
14 |
Bug: https://bugs.gentoo.org/712236 |
15 |
Package-Manager: Portage-3.0.2, Repoman-2.3.23 |
16 |
Signed-off-by: Jonas Toth <gentoo <AT> jonas-toth.eu> |
17 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
18 |
|
19 |
dev-libs/date/Manifest | 1 + |
20 |
dev-libs/date/date-3.0.0.ebuild | 55 +++++++++++++ |
21 |
.../date/files/date-3.0.0-c-locale-export.patch | 90 ++++++++++++++++++++++ |
22 |
dev-libs/date/files/date-3.0.0-version.patch | 15 ++++ |
23 |
dev-libs/date/metadata.xml | 20 +++++ |
24 |
5 files changed, 181 insertions(+) |
25 |
|
26 |
diff --git a/dev-libs/date/Manifest b/dev-libs/date/Manifest |
27 |
new file mode 100644 |
28 |
index 00000000000..168710ab471 |
29 |
--- /dev/null |
30 |
+++ b/dev-libs/date/Manifest |
31 |
@@ -0,0 +1 @@ |
32 |
+DIST date-3.0.0.tar.gz 822623 BLAKE2B 438a7a5c153c7c2d695fefc95bbd474ef507af2cd8182d1e7d54d482b0128c3f9c57582ed5b40ef46d8f6f5539228d20322c684b1e1b418e5ade3b4871bf4ec1 SHA512 03ba0faef68e053aba888591b9350af1a043ef543825c80b1ca3f0dc0448697f56286e561f1a2a59e684680d7fc1e51fd24955c4cc222fe28db64f56037dc1aa |
33 |
|
34 |
diff --git a/dev-libs/date/date-3.0.0.ebuild b/dev-libs/date/date-3.0.0.ebuild |
35 |
new file mode 100644 |
36 |
index 00000000000..1b7acb557db |
37 |
--- /dev/null |
38 |
+++ b/dev-libs/date/date-3.0.0.ebuild |
39 |
@@ -0,0 +1,55 @@ |
40 |
+# Copyright 1999-2020 Gentoo Authors |
41 |
+# Distributed under the terms of the GNU General Public License v2 |
42 |
+ |
43 |
+EAPI=7 |
44 |
+ |
45 |
+inherit cmake |
46 |
+ |
47 |
+DESCRIPTION="A date and time library based on the C++11/14/17 <chrono> header" |
48 |
+HOMEPAGE="https://github.com/HowardHinnant/date" |
49 |
+ |
50 |
+SRC_URI="https://github.com/HowardHinnant/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
51 |
+KEYWORDS="~amd64" |
52 |
+ |
53 |
+LICENSE="MIT" |
54 |
+SLOT="0" |
55 |
+IUSE="only-c-locale test" |
56 |
+RESTRICT="!test? ( test )" |
57 |
+ |
58 |
+PATCHES=( |
59 |
+ "${FILESDIR}"/${P}-c-locale-export.patch |
60 |
+ "${FILESDIR}"/${P}-version.patch |
61 |
+) |
62 |
+ |
63 |
+src_prepare() { |
64 |
+ # The test cases are implicitly generated with CMake code, that parses |
65 |
+ # the file names for ".cpp" and ".fail.cpp". Renaming the source files |
66 |
+ # disables the test. |
67 |
+ |
68 |
+ # This test case fails due to a stdlibc++ bug. |
69 |
+ # Upstream bug: https://github.com/HowardHinnant/date/issues/388 |
70 |
+ mv "test/date_test/parse.pass.cpp" "test/date_test/parse.disabled" || ewarn "Can not deactivate test case, test failure expected" |
71 |
+ |
72 |
+ # This test case fails only when the CMAKE_BUILD_TYPE=Gentoo. |
73 |
+ # The behaviour seems very strange, but does not appear with a |
74 |
+ # "valid" build type. |
75 |
+ # Upstream bug: https://github.com/HowardHinnant/date/issues/604 |
76 |
+ 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" |
77 |
+ |
78 |
+ cmake_src_prepare |
79 |
+} |
80 |
+ |
81 |
+src_configure() { |
82 |
+ local mycmakeargs=( |
83 |
+ -DBUILD_TZ_LIB=ON |
84 |
+ -DUSE_SYSTEM_TZ_DB=ON |
85 |
+ -DENABLE_DATE_TESTING=$(usex test) |
86 |
+ -DCOMPILE_WITH_C_LOCALE=$(usex only-c-locale) |
87 |
+ ) |
88 |
+ cmake_src_configure |
89 |
+} |
90 |
+ |
91 |
+src_test() { |
92 |
+ cd "${BUILD_DIR}" || die |
93 |
+ ninja testit |
94 |
+} |
95 |
|
96 |
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 |
97 |
new file mode 100644 |
98 |
index 00000000000..a4e5a9a93ef |
99 |
--- /dev/null |
100 |
+++ b/dev-libs/date/files/date-3.0.0-c-locale-export.patch |
101 |
@@ -0,0 +1,90 @@ |
102 |
+Fixes an compilation error when 'ONLY_C_LOCALE' is used to build the project. |
103 |
+ |
104 |
+Upstream-Bug: https://github.com/HowardHinnant/date/issues/589 |
105 |
+ |
106 |
+--- a/CMakeLists.txt |
107 |
++++ b/CMakeLists.txt |
108 |
+@@ -76,10 +76,25 @@ if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.15) |
109 |
+ # public headers will get installed: |
110 |
+ set_target_properties( date PROPERTIES PUBLIC_HEADER include/date/date.h ) |
111 |
+ endif () |
112 |
+-target_compile_definitions( date INTERFACE |
113 |
+- #To workaround libstdc++ issue https://github.com/HowardHinnant/date/issues/388 |
114 |
+- ONLY_C_LOCALE=$<IF:$<BOOL:${COMPILE_WITH_C_LOCALE}>,1,0> |
115 |
+- $<$<BOOL:${DISABLE_STRING_VIEW}>:HAS_STRING_VIEW=0> ) |
116 |
++ |
117 |
++# These used to be set with generator expressions, |
118 |
++# |
119 |
++# ONLY_C_LOCALE=$<IF:$<BOOL:${COMPILE_WITH_C_LOCALE}>,1,0> |
120 |
++# |
121 |
++# which expand in the output target file to, e.g. |
122 |
++# |
123 |
++# ONLY_C_LOCALE=$<IF:$<BOOL:FALSE>,1,0> |
124 |
++# |
125 |
++# This string is then (somtimes?) not correctly interpreted. |
126 |
++if ( COMPILE_WITH_C_LOCALE ) |
127 |
++ # To workaround libstdc++ issue https://github.com/HowardHinnant/date/issues/388 |
128 |
++ target_compile_definitions( date INTERFACE ONLY_C_LOCALE=1 ) |
129 |
++else() |
130 |
++ target_compile_definitions( date INTERFACE ONLY_C_LOCALE=0 ) |
131 |
++endif() |
132 |
++if ( DISABLE_STRING_VIEW ) |
133 |
++ target_compile_definitions( date INTERFACE HAS_STRING_VIEW=0 ) |
134 |
++endif() |
135 |
+ |
136 |
+ #[===================================================================[ |
137 |
+ tz (compiled) library |
138 |
+@@ -89,27 +104,40 @@ if( BUILD_TZ_LIB ) |
139 |
+ target_sources( date-tz |
140 |
+ PUBLIC |
141 |
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>$<INSTALL_INTERFACE:include>/date/tz.h |
142 |
+- $<$<BOOL:${IOS}>:$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>$<INSTALL_INTERFACE:include>/date/ios.h> |
143 |
+ PRIVATE |
144 |
+ include/date/tz_private.h |
145 |
+- $<$<BOOL:${IOS}>:src/ios.mm> |
146 |
+ src/tz.cpp ) |
147 |
++ if ( IOS ) |
148 |
++ target_sources( date-tz |
149 |
++ PUBLIC |
150 |
++ $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>$<INSTALL_INTERFACE:include>/date/ios.h |
151 |
++ PRIVATE |
152 |
++ src/ios.mm ) |
153 |
++ endif() |
154 |
+ add_library( date::tz ALIAS date-tz ) |
155 |
+ target_link_libraries( date-tz PUBLIC date ) |
156 |
+ target_include_directories( date-tz PUBLIC |
157 |
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> |
158 |
+ $<INSTALL_INTERFACE:include> ) |
159 |
+- target_compile_definitions( date-tz |
160 |
+- PRIVATE |
161 |
+- AUTO_DOWNLOAD=$<IF:$<OR:$<BOOL:${USE_SYSTEM_TZ_DB}>,$<BOOL:${MANUAL_TZ_DB}>>,0,1> |
162 |
+- HAS_REMOTE_API=$<IF:$<OR:$<BOOL:${USE_SYSTEM_TZ_DB}>,$<BOOL:${MANUAL_TZ_DB}>>,0,1> |
163 |
+- $<$<AND:$<BOOL:${WIN32}>,$<BOOL:${BUILD_SHARED_LIBS}>>:DATE_BUILD_DLL=1> |
164 |
+- $<$<BOOL:${USE_TZ_DB_IN_DOT}>:INSTALL=.> |
165 |
+- PUBLIC |
166 |
+- USE_OS_TZDB=$<IF:$<AND:$<BOOL:${USE_SYSTEM_TZ_DB}>,$<NOT:$<BOOL:${WIN32}>>,$<NOT:$<BOOL:${MANUAL_TZ_DB}>>>,1,0> |
167 |
+- INTERFACE |
168 |
+- $<$<AND:$<BOOL:${WIN32}>,$<BOOL:${BUILD_SHARED_LIBS}>>:DATE_USE_DLL=1> ) |
169 |
++ |
170 |
++ if ( USE_SYSTEM_TZ_DB OR MANUAL_TZ_DB ) |
171 |
++ target_compile_definitions( date-tz PRIVATE AUTO_DOWNLOAD=0 HAS_REMOTE_API=0 ) |
172 |
++ else() |
173 |
++ target_compile_definitions( date-tz PRIVATE AUTO_DOWNLOAD=1 HAS_REMOTE_API=1 ) |
174 |
++ endif() |
175 |
++ |
176 |
++ if ( USE_SYSTEM_TZ_DB AND NOT WIN32 AND NOT MANUAL_TZ_DB ) |
177 |
++ target_compile_definitions( date-tz PRIVATE INSTALL=. PUBLIC USE_OS_TZDB=1 ) |
178 |
++ else() |
179 |
++ target_compile_definitions( date-tz PUBLIC USE_OS_TZDB=0 ) |
180 |
++ endif() |
181 |
++ |
182 |
++ if ( WIN32 AND BUILD_SHARED_LIBS ) |
183 |
++ target_compile_definitions( date-tz PUBLIC DATE_BUILD_DLL=1 ) |
184 |
++ endif() |
185 |
++ |
186 |
+ set(TZ_HEADERS include/date/tz.h) |
187 |
++ |
188 |
+ if( IOS ) |
189 |
+ list(APPEND TZ_HEADERS include/date/ios.h) |
190 |
+ endif( ) |
191 |
+-- |
192 |
|
193 |
diff --git a/dev-libs/date/files/date-3.0.0-version.patch b/dev-libs/date/files/date-3.0.0-version.patch |
194 |
new file mode 100644 |
195 |
index 00000000000..398b2107059 |
196 |
--- /dev/null |
197 |
+++ b/dev-libs/date/files/date-3.0.0-version.patch |
198 |
@@ -0,0 +1,15 @@ |
199 |
+Fixes an oversight in the build-system versioning. |
200 |
+ |
201 |
+Upstream-Bug: https://github.com/HowardHinnant/date/issues/583 |
202 |
+ |
203 |
+--- a/CMakeLists.txt |
204 |
++++ b/CMakeLists.txt |
205 |
+@@ -17,7 +17,7 @@ |
206 |
+ |
207 |
+ cmake_minimum_required( VERSION 3.7 ) |
208 |
+ |
209 |
+-project( date VERSION 2.4.1 ) |
210 |
++project( date VERSION 3.0.0 ) |
211 |
+ |
212 |
+ include( GNUInstallDirs ) |
213 |
+ |
214 |
|
215 |
diff --git a/dev-libs/date/metadata.xml b/dev-libs/date/metadata.xml |
216 |
new file mode 100644 |
217 |
index 00000000000..aaa7e8ae6e5 |
218 |
--- /dev/null |
219 |
+++ b/dev-libs/date/metadata.xml |
220 |
@@ -0,0 +1,20 @@ |
221 |
+<?xml version="1.0" encoding="UTF-8"?> |
222 |
+<!DOCTYPE pkgmetadata SYSTEM 'http://www.gentoo.org/dtd/metadata.dtd'> |
223 |
+<pkgmetadata> |
224 |
+ <maintainer type="person"> |
225 |
+ <email>gentoo@××××××××××.eu</email> |
226 |
+ <name>Jonas Toth</name> |
227 |
+ </maintainer> |
228 |
+ <maintainer type="project"> |
229 |
+ <email>proxy-maint@g.o</email> |
230 |
+ <name>Proxy Maintainers</name> |
231 |
+ </maintainer> |
232 |
+ <use> |
233 |
+ <flag name="only-c-locale">Build only the C locale</flag> |
234 |
+ </use> |
235 |
+ <upstream> |
236 |
+ <remote-id type="github">HowardHinnant/date</remote-id> |
237 |
+ <bugs-to>https://github.com/HowardHinnant/date/issues</bugs-to> |
238 |
+ <changelog>https://github.com/HowardHinnant/date/releases</changelog> |
239 |
+ </upstream> |
240 |
+</pkgmetadata> |