From ac9501d8303b1f9088a9e519722edf4458a08d8c Mon Sep 17 00:00:00 2001 From: lz-coder Date: Fri, 20 Jan 2023 02:34:40 -0300 Subject: [PATCH] New package: chrono-date-3.0.1 --- common/shlibs | 1 + srcpkgs/chrono-date-devel | 1 + .../538_output_date_pc_for_pkg_config.patch | 60 +++++++++++++++++++ .../disable_buggy_libstdc++_tests.patch | 30 ++++++++++ srcpkgs/chrono-date/patches/get_info.patch | 24 ++++++++ srcpkgs/chrono-date/patches/sys_info.patch | 29 +++++++++ srcpkgs/chrono-date/template | 28 +++++++++ 7 files changed, 173 insertions(+) create mode 120000 srcpkgs/chrono-date-devel create mode 100644 srcpkgs/chrono-date/patches/538_output_date_pc_for_pkg_config.patch create mode 100644 srcpkgs/chrono-date/patches/disable_buggy_libstdc++_tests.patch create mode 100644 srcpkgs/chrono-date/patches/get_info.patch create mode 100644 srcpkgs/chrono-date/patches/sys_info.patch create mode 100644 srcpkgs/chrono-date/template diff --git a/common/shlibs b/common/shlibs index 85c08f13a05f..6a2c8e447c28 100644 --- a/common/shlibs +++ b/common/shlibs @@ -4224,3 +4224,4 @@ libIlmThread-3_1.so.30 libopenexr-3.1.5_1 libOpenEXR-3_1.so.30 libopenexr-3.1.5_1 libOpenEXRCore-3_1.so.30 libopenexr-3.1.5_1 libOpenEXRUtil-3_1.so.30 libopenexr-3.1.5_1 +libdate-tz.so.3 chrono-date-3.0.1_1 diff --git a/srcpkgs/chrono-date-devel b/srcpkgs/chrono-date-devel new file mode 120000 index 000000000000..7ba11f09e6bd --- /dev/null +++ b/srcpkgs/chrono-date-devel @@ -0,0 +1 @@ +chrono-date \ No newline at end of file diff --git a/srcpkgs/chrono-date/patches/538_output_date_pc_for_pkg_config.patch b/srcpkgs/chrono-date/patches/538_output_date_pc_for_pkg_config.patch new file mode 100644 index 000000000000..d20af66b16dc --- /dev/null +++ b/srcpkgs/chrono-date/patches/538_output_date_pc_for_pkg_config.patch @@ -0,0 +1,60 @@ +From e56b2dce7e89a92e1b9b35caa13b3e938c4cedea Mon Sep 17 00:00:00 2001 +From: Cole Mickens +Date: Sun, 26 Jan 2020 01:27:08 -0800 +Subject: [PATCH] CMakeLists.txt: output date.pc for pkg-config + +--- + CMakeLists.txt | 15 +++++++++++++++ + date.pc.in | 10 ++++++++++ + 2 files changed, 25 insertions(+) + create mode 100644 date.pc.in + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f30c473..fe778e8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -128,6 +128,15 @@ if( BUILD_TZ_LIB ) + endif( ) + endif( ) + ++if ( BUILD_TZ_LIB ) ++ # Cflags: -I${includedir} @TZ_COMPILE_DEFINITIONS@ ++ set( TZ_COMPILE_DEFINITIONS "$,-D$, -D>,>" ) ++ configure_file(date.pc.in date.pc.cf @ONLY) ++ file( GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/date.pc" ++ INPUT "${CMAKE_CURRENT_BINARY_DIR}/date.pc.cf" ) ++ ++endif( ) ++ + #[===================================================================[ + installation + #]===================================================================] +@@ -171,6 +180,12 @@ install ( + FILES cmake/dateConfig.cmake "${version_config}" + DESTINATION ${CONFIG_LOC}) + ++if ( BUILD_TZ_LIB ) ++ install( ++ FILES ${CMAKE_BINARY_DIR}/date.pc ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) ++endif( ) ++ + #[===================================================================[ + testing + #]===================================================================] +diff --git a/date.pc.in b/date.pc.in +new file mode 100644 +index 0000000..b9c4623 +--- /dev/null ++++ b/date.pc.in +@@ -0,0 +1,10 @@ ++prefix=@CMAKE_INSTALL_PREFIX@ ++exec_prefix=@CMAKE_INSTALL_BINDIR@ ++libdir=@CMAKE_INSTALL_LIB@ ++includedir=@CMAKE_INSTALL_INCLUDE@ ++ ++Name: date ++Description: A date and time library based on the C++11/14/17 header ++Version: @PACKAGE_VERSION@ ++Libs: -L${libdir} -ldate-tz ++Cflags: -I${includedir} @TZ_COMPILE_DEFINITIONS@ diff --git a/srcpkgs/chrono-date/patches/disable_buggy_libstdc++_tests.patch b/srcpkgs/chrono-date/patches/disable_buggy_libstdc++_tests.patch new file mode 100644 index 000000000000..d6257c4c3016 --- /dev/null +++ b/srcpkgs/chrono-date/patches/disable_buggy_libstdc++_tests.patch @@ -0,0 +1,30 @@ +--- a/test/date_test/parse.pass.cpp 2020-06-02 18:08:57.000000000 -0700 ++++ b/test/date_test/parse.pass.cpp 2020-07-11 19:35:35.349377734 -0700 +@@ -874,27 +874,20 @@ + int + main() + { +- test_a(); +- test_b(); +- test_c(); + test_C(); + test_d(); + test_D(); + test_F(); + test_H(); +- test_Ip(); + test_j(); + test_m(); + test_M(); +- test_p(); +- test_r(); + test_R(); + test_S(); + test_T(); + test_U(); + test_W(); + test_GV(); +- test_x(); + test_X(); + test_z(); + test_Z(); diff --git a/srcpkgs/chrono-date/patches/get_info.patch b/srcpkgs/chrono-date/patches/get_info.patch new file mode 100644 index 000000000000..5ce6f15f6d26 --- /dev/null +++ b/srcpkgs/chrono-date/patches/get_info.patch @@ -0,0 +1,24 @@ +From b49a7575ebbe127e8bd344900a52c14b5d69dd7b Mon Sep 17 00:00:00 2001 +From: Howard Hinnant +Date: Tue, 18 May 2021 16:15:31 -0400 +Subject: [PATCH] Zero initialize local_info in get_info + +* Even when the result is unique, the second sys_info + should be zero initialized. +--- + src/tz.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/tz.cpp b/src/tz.cpp +index 26babbd9..1592bc8f 100644 +--- a/src/tz.cpp ++++ b/src/tz.cpp +@@ -2164,7 +2164,7 @@ time_zone::get_info_impl(local_seconds tp) const + { + using namespace std::chrono; + init(); +- local_info i; ++ local_info i{}; + i.result = local_info::unique; + auto tr = upper_bound(transitions_.begin(), transitions_.end(), tp, + [](const local_seconds& x, const transition& t) diff --git a/srcpkgs/chrono-date/patches/sys_info.patch b/srcpkgs/chrono-date/patches/sys_info.patch new file mode 100644 index 000000000000..d7edfa0a4b5f --- /dev/null +++ b/srcpkgs/chrono-date/patches/sys_info.patch @@ -0,0 +1,29 @@ +From 052eebaf0086e6bbc5ead01c3f1a8f02496aa701 Mon Sep 17 00:00:00 2001 +From: Howard Hinnant +Date: Tue, 18 May 2021 16:17:37 -0400 +Subject: [PATCH] When comparing sys_info in test... only compare whether the + saves are equal to 0 and not their actual values. + +This allows one to compare against the binary database +which does not contain actual values of save. +--- + test/posix/ptz.pass.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/test/posix/ptz.pass.cpp b/test/posix/ptz.pass.cpp +index 5601c21d..9e15e3a9 100644 +--- a/test/posix/ptz.pass.cpp ++++ b/test/posix/ptz.pass.cpp +@@ -29,10 +29,11 @@ + bool + is_equal(date::sys_info const& x, date::sys_info const& y) + { ++ using namespace std::chrono; + return x.begin == y.begin && + x.end == y.end && + x.offset == y.offset && +- x.save == y.save && ++ (x.save == minutes{0}) == (y.save == minutes{0}) && + x.abbrev == y.abbrev; + } + diff --git a/srcpkgs/chrono-date/template b/srcpkgs/chrono-date/template new file mode 100644 index 000000000000..973481fc7317 --- /dev/null +++ b/srcpkgs/chrono-date/template @@ -0,0 +1,28 @@ +# Template file for 'chrono-date' +pkgname=chrono-date +version=3.0.1 +revision=1 +build_style=cmake +configure_args="-DBUILD_SHARED_LIBS=true -DBUILD_TZ_LIB=true + -DUSE_SYSTEM_TZ_DB=true -DENABLE_DATE_TESTING=false" +short_desc="Date and time library based on the C++11/14/17 header" +maintainer="lz-coder " +license="MIT" +homepage="https://howardhinnant.github.io/date/date.html" +changelog="https://github.com/HowardHinnant/date/releases" +distfiles="https://github.com/HowardHinnant/date/archive/v${version}.tar.gz" +checksum=7a390f200f0ccd207e8cff6757e04817c1a0aec3e327b006b7eb451c57ee3538 + +post_install() { + vlicense LICENSE.txt +} + +chrono-date-devel_package() { + depends="${sourcepkg}>=${version}_${revision}" + short_desc+=" - development files" + pkg_install() { + vmove usr/include + vmove usr/lib/cmake + vmove "usr/lib/*.so" + } +}