diff --git a/dev-libs/date-3.0.3.PKGBUILD b/dev-libs/date-3.0.3.PKGBUILD new file mode 100644 index 0000000..2087dfc --- /dev/null +++ b/dev-libs/date-3.0.3.PKGBUILD @@ -0,0 +1,48 @@ +pkgname=date +pkgver=3.0.3 +pkgdesc="Date and time library based on the C++11/14/17 header" +homepage="https://github.com/HowardHinnant/date" +license=("MIT") +_patches=("date-3.0.3_remove-failing-tests.patch") +_patche_sums=("e5a453239592d4852d05b50f1f428f6cbc3b0415a247d1e3e9aea4cef42a02d3e9f65233bb717629e2670667e73e700af72eba5374faa6f96f5e952f630d45e1") +sources=("${pkgname}-${pkgver}.tar.gz" + "${_patches[@]}" +) +urls=("https://github.com/HowardHinnant/date/archive/refs/tags/v${pkgver}.tar.gz" + "${_patches[@]}" +) +sha512sums=("e11d7f230ecc431d94c4b58fe7394dd57a9ec0baa9de52496578479b51bbf885566d6666882916d84d388060fa36065b3fa8dd3a8bc14f720b38d1c943f06700" + "${_patche_sums[@]}" +) + +src_prepare() { + tar -xf ${distdir}/${sources[0]} --strip-components=1 + for _patch in ${_patches[@]}; do + patch -p1 -i ${filedir}/${_patch} + done +} + +src_build() { + local cmake_args=( + -D CMAKE_INSTALL_PREFIX=/usr + -D CMAKE_BUILD_TYPE=release + -D BUILD_SHARED_LIBS=true + -D BUILD_TZ_LIB=ON + -D USE_SYSTEM_TZ_DB=ON + -D ENABLE_DATE_TESTING=no + -D COMPILE_WITH_C_LOCALE=no + ) + cmake -B build "${cmake_args[@]}" + cmake --build build +} + +src_check() { + cd test + ./testit +} + +src_install() { + DESTDIR="$pkgdir" cmake --install build +} + +# vim:ft=sh syn=sh et sw=2: diff --git a/dev-libs/date-3.0.3/date-3.0.3_remove-failing-tests.patch b/dev-libs/date-3.0.3/date-3.0.3_remove-failing-tests.patch new file mode 100644 index 0000000..158b282 --- /dev/null +++ b/dev-libs/date-3.0.3/date-3.0.3_remove-failing-tests.patch @@ -0,0 +1,34 @@ +From: Filip Kobierski + +Upstream states that " There are known failures on all platforms"[1]. +This patch removes the tests that fail for Gentoo. +They both test if the library can parse PM dates in a 12 hour format. + +Here are the failiure messages: +test_Ip(): Assertion `tp == sys_days{2016_y/12/11} + hours{13}' failed. +test_p(): Assertion `tp == sys_days{2016_y/12/11} + hours{23}' failed. + +[1]: https://github.com/HowardHinnant/date?tab=readme-ov-file#build--test +--- + test/date_test/parse.pass.cpp | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/test/date_test/parse.pass.cpp b/test/date_test/parse.pass.cpp +index 13ca909..cdeea71 100644 +--- a/test/date_test/parse.pass.cpp ++++ b/test/date_test/parse.pass.cpp +@@ -906,11 +906,9 @@ main() + test_D(); + test_F(); + test_H(); +- test_Ip(); + test_j(); + test_m(); + test_M(); +- test_p(); + test_r(); + test_R(); + test_S(); +-- +2.45.2 +