1 # Maintainer: Brett Cornwall <ainola@archlinux.org>
6 pkgdesc="A date and time library based on the C++11/14/17 <chrono> header"
8 url="https://howardhinnant.github.io/date/date.html"
17 source=("$pkgname-$pkgver.tar.gz::https://github.com/HowardHinnant/date/archive/v$pkgver.tar.gz"
18 "538-output-date-pc-for-pkg-config.patch::https://patch-diff.githubusercontent.com/raw/HowardHinnant/date/pull/538.patch"
19 "https://github.com/HowardHinnant/date/commit/052eebaf0086e6bbc5ead01c3f1a8f02496aa701.patch"
20 "https://github.com/HowardHinnant/date/commit/b49a7575ebbe127e8bd344900a52c14b5d69dd7b.patch"
21 "disable_buggy_libstdc++_tests.patch")
22 sha256sums=('7a390f200f0ccd207e8cff6757e04817c1a0aec3e327b006b7eb451c57ee3538'
23 'c881ae3ae08b46a2137b987e593469d030669c37c9423921a1fac7de512676f3'
24 '9d8586fce2b98130dbfa5586250a74142f87cde97a9368ae07ebe89e5d6ea586'
25 '2a14544db6dad5e0f6a674384fccb86144915c45e9d3826f0c49ef2c01143884'
26 'bd770b44554790c8854dd433aa670ecb8071a69bbeb2855c97dc66570d442165')
31 # https://github.com/HowardHinnant/date/issues/671
32 # These two patches were commited right after release of 3.0.1 and fix a
34 patch -p1 < ../052eebaf0086e6bbc5ead01c3f1a8f02496aa701.patch
35 patch -p1 < ../b49a7575ebbe127e8bd344900a52c14b5d69dd7b.patch
36 # https://github.com/HowardHinnant/date/issues/537
37 # Modified to link against date-tz as newer releases of date changed the library.
38 patch -p1 < ../538-output-date-pc-for-pkg-config.patch
40 # FIXME: one particular test suite will fail; according to the date author,
41 # GCC's std::time_get is buggy and bugs should be raised to that project.
43 # https://github.com/HowardHinnant/date/issues/334
44 # https://github.com/HowardHinnant/date/issues/455
45 # https://github.com/HowardHinnant/date/issues/496
46 patch -p1 < ../disable_buggy_libstdc++_tests.patch
51 cmake -B build -S "date-$pkgver" \
52 -DCMAKE_BUILD_TYPE=None \
53 -DCMAKE_INSTALL_PREFIX=/usr \
54 -DBUILD_SHARED_LIBS=true \
56 -DUSE_SYSTEM_TZ_DB=true \
57 -DENABLE_DATE_TESTING=true \
61 # TODO test fails, temporarily disabling to rebuild ===> 105 - tz_test_pass_validate_test
63 # make -C build testit
67 make -C build DESTDIR="$pkgdir/" install
68 install -Dm644 "date-$pkgver/LICENSE.txt" -t "$pkgdir/usr/share/licenses/$pkgname"
69 install -Dm644 "date-$pkgver/README.md" -t "$pkgdir/usr/share/doc/$pkgname"