aboutsummaryrefslogtreecommitdiff
path: root/libraries/date
diff options
context:
space:
mode:
authorDamian Perticone <mjolnirdam@gmail.com>2022-04-26 05:06:35 +0100
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2022-04-30 13:51:52 +0700
commitbdcc683d4e9822cfe91f86fd7632810a2c0abf4e (patch)
tree82c98f5a801520cf02d72dd2411afe3920b60d7f /libraries/date
parent1a90621cd7d7b252ee58a0970381d7a6d3ce8998 (diff)
libraries/date: Added (date and time library)
Signed-off-by: Dave Woodfall <dave@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'libraries/date')
-rw-r--r--libraries/date/052eebaf0086e6bbc5ead01c3f1a8f02496aa701.patch29
-rw-r--r--libraries/date/538-output-date-pc-for-pkg-config.patch60
-rw-r--r--libraries/date/README26
-rw-r--r--libraries/date/b49a7575ebbe127e8bd344900a52c14b5d69dd7b.patch24
-rw-r--r--libraries/date/date.SlackBuild122
-rw-r--r--libraries/date/date.info10
-rw-r--r--libraries/date/disable_buggy_libstdc++_tests.patch30
-rw-r--r--libraries/date/slack-desc19
8 files changed, 320 insertions, 0 deletions
diff --git a/libraries/date/052eebaf0086e6bbc5ead01c3f1a8f02496aa701.patch b/libraries/date/052eebaf0086e6bbc5ead01c3f1a8f02496aa701.patch
new file mode 100644
index 0000000000000..d7edfa0a4b5f4
--- /dev/null
+++ b/libraries/date/052eebaf0086e6bbc5ead01c3f1a8f02496aa701.patch
@@ -0,0 +1,29 @@
+From 052eebaf0086e6bbc5ead01c3f1a8f02496aa701 Mon Sep 17 00:00:00 2001
+From: Howard Hinnant <howard.hinnant@gmail.com>
+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/libraries/date/538-output-date-pc-for-pkg-config.patch b/libraries/date/538-output-date-pc-for-pkg-config.patch
new file mode 100644
index 0000000000000..d20af66b16dca
--- /dev/null
+++ b/libraries/date/538-output-date-pc-for-pkg-config.patch
@@ -0,0 +1,60 @@
+From e56b2dce7e89a92e1b9b35caa13b3e938c4cedea Mon Sep 17 00:00:00 2001
+From: Cole Mickens <cole.mickens@gmail.com>
+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 "$<IF:$<TARGET_EXISTS:date-tz>,-D$<JOIN:$<TARGET_PROPERTY:date-tz,INTERFACE_COMPILE_DEFINITIONS>, -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 <chrono> header
++Version: @PACKAGE_VERSION@
++Libs: -L${libdir} -ldate-tz
++Cflags: -I${includedir} @TZ_COMPILE_DEFINITIONS@
diff --git a/libraries/date/README b/libraries/date/README
new file mode 100644
index 0000000000000..6ab91e8d4a8c0
--- /dev/null
+++ b/libraries/date/README
@@ -0,0 +1,26 @@
+This is actually several separate C++11/C++14/C++17 libraries:
+
+"date.h" is a header-only library which builds upon <chrono>. It adds
+some new duration types, and new time_point types. It also adds
+"field" types such as year_month_day which is a struct
+{year, month, day}. And it provides convenient means to convert between
+the "field" types and the time_point types.
+
+"tz.h" / "tz.cpp" are a timezone library built on top of the "date.h"
+library.
+This timezone library is a complete parser of the IANA timezone
+database. It provides for an easy way to access all of the data in this
+database, using the types from "date.h" and <chrono>. The IANA database
+ also includes data on leap seconds, and this library provides utilities
+to compute with that information as well.
+
+"iso_week.h" is a header-only library built on top of the "date.h"
+library which implements the ISO week date calendar.
+
+"julian.h" is a header-only library built on top of the "date.h" library
+which implements a proleptic Julian calendar which is fully
+interoperable with everything above.
+
+"islamic.h" is a header-only library built on top of the "date.h"
+library which implements a proleptic Islamic calendar which is fully
+interoperable with everything above.
diff --git a/libraries/date/b49a7575ebbe127e8bd344900a52c14b5d69dd7b.patch b/libraries/date/b49a7575ebbe127e8bd344900a52c14b5d69dd7b.patch
new file mode 100644
index 0000000000000..5ce6f15f6d266
--- /dev/null
+++ b/libraries/date/b49a7575ebbe127e8bd344900a52c14b5d69dd7b.patch
@@ -0,0 +1,24 @@
+From b49a7575ebbe127e8bd344900a52c14b5d69dd7b Mon Sep 17 00:00:00 2001
+From: Howard Hinnant <howard.hinnant@gmail.com>
+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/libraries/date/date.SlackBuild b/libraries/date/date.SlackBuild
new file mode 100644
index 0000000000000..f26c3536db247
--- /dev/null
+++ b/libraries/date/date.SlackBuild
@@ -0,0 +1,122 @@
+#!/bin/bash
+
+# Slackware build script for date
+
+# Copyright 2022 Damian Perticone Berisso, Argentina
+# All rights reserved.
+# thanks for the cmake hint OXBG!
+
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PRGNAM=date
+VERSION=${VERSION:-3.0.1}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+# fix failing test
+patch -p1 < $CWD/052eebaf0086e6bbc5ead01c3f1a8f02496aa701.patch
+patch -p1 < $CWD/b49a7575ebbe127e8bd344900a52c14b5d69dd7b.patch
+# Modified to link against date-tz as newer releases of date changed the library.
+patch -p1 < $CWD/538-output-date-pc-for-pkg-config.patch
+# fix one particular test suite will fail; according to the date author,
+# GCC's std::time_get is buggy and bugs should be raised to that project.
+patch -p1 < $CWD/disable_buggy_libstdc++_tests.patch
+
+mkdir -p build
+cd build
+ cmake \
+ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_LIBDIR=/usr/lib${LIBDIRSUFFIX} \
+ -DCMAKE_INSTALL_MANDIR=/usr/man \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DENABLE_DATE_TESTING=ON \
+ -DBUILD_TZ_LIB=ON \
+ -DUSE_SYSTEM_TZ_DB=ON \
+ -DBUILD_SHARED_LIBS=ON ..
+ make
+ make install/strip DESTDIR=$PKG
+cd ..
+
+rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
+
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+find $PKG -name perllocal.pod -o -name ".packlist" -o -name "*.bs" | xargs rm -f || true
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a LICENSE.txt README.md $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/libraries/date/date.info b/libraries/date/date.info
new file mode 100644
index 0000000000000..5ffb5a0375ec7
--- /dev/null
+++ b/libraries/date/date.info
@@ -0,0 +1,10 @@
+PRGNAM="date"
+VERSION="3.0.1"
+HOMEPAGE="https://github.com/HowardHinnant/date"
+DOWNLOAD="https://github.com/HowardHinnant/date/archive/v3.0.1/date-3.0.1.tar.gz"
+MD5SUM="78902f47f7931a3ae8a320e0dea1f20a"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="Damian Perticone"
+EMAIL="mjolnirdam@gmail.com"
diff --git a/libraries/date/disable_buggy_libstdc++_tests.patch b/libraries/date/disable_buggy_libstdc++_tests.patch
new file mode 100644
index 0000000000000..d6257c4c3016e
--- /dev/null
+++ b/libraries/date/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/libraries/date/slack-desc b/libraries/date/slack-desc
new file mode 100644
index 0000000000000..a1413b99e93ab
--- /dev/null
+++ b/libraries/date/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+date: date (date and time library)
+date:
+date: Date is a date and time library
+date: based on the C++11/14/17 <chrono> header
+date:
+date:
+date: Home: https://github.com/HowardHinnant/date
+date:
+date:
+date:
+date: