diff options
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/packages/calendar.scm | 104 | ||||
| -rw-r--r-- | gnu/packages/patches/date-output-pkg-config-files.patch | 12 |
2 files changed, 57 insertions, 59 deletions
diff --git a/gnu/packages/calendar.scm b/gnu/packages/calendar.scm index a735b5a0cc6..03c9412df3e 100644 --- a/gnu/packages/calendar.scm +++ b/gnu/packages/calendar.scm | |||
| @@ -105,61 +105,59 @@ available in French.") | |||
| 105 | (license license:gpl2)))) | 105 | (license license:gpl2)))) |
| 106 | 106 | ||
| 107 | (define-public date | 107 | (define-public date |
| 108 | ;; We make the same choice as the Arch package maintainer by choosing a | 108 | (package |
| 109 | ;; recent commit to fix some bugs. | 109 | (name "date") |
| 110 | ;; https://github.com/Alexays/Waybar/issues/565 | 110 | (version "3.0.1") |
| 111 | (let ((commit "9a0ee2542848ab8625984fc8cdbfb9b5414c0082")) | 111 | (source |
| 112 | (package | 112 | (origin |
| 113 | (name "date") | 113 | (method git-fetch) |
| 114 | (version (string-append "2.4.1-" (string-take commit 8))) | 114 | (uri (git-reference |
| 115 | (source | 115 | (url "https://github.com/HowardHinnant/date") |
| 116 | (origin | 116 | (commit (string-append "v" version)))) |
| 117 | (method git-fetch) | 117 | (file-name (git-file-name name version)) |
| 118 | (uri (git-reference | 118 | (sha256 |
| 119 | (url "https://github.com/HowardHinnant/date") | 119 | (base32 "1qk7pgnk0bpinja28104qha6f7r1xwh5dy3gra7vjkqwl0jdwa35")) |
| 120 | (commit "9a0ee2542848ab8625984fc8cdbfb9b5414c0082"))) | 120 | (patches |
| 121 | (file-name (git-file-name name version)) | 121 | ;; Install pkg-config files |
| 122 | (sha256 | 122 | ;; https://github.com/HowardHinnant/date/pull/538 |
| 123 | (base32 "0yxsn0hj22n61bjywysxqgfv7hj5xvsl6isma95fl8xrimpny083")) | 123 | (search-patches "date-ignore-zonenow.patch" |
| 124 | (patches | 124 | "date-output-pkg-config-files.patch")))) |
| 125 | ;; Install pkg-config files | 125 | (inputs (list tzdata)) |
| 126 | ;; https://github.com/HowardHinnant/date/pull/538 | 126 | (build-system cmake-build-system) |
| 127 | (search-patches "date-ignore-zonenow.patch" | 127 | (arguments |
| 128 | "date-output-pkg-config-files.patch")))) | 128 | '(#:configure-flags (list "-DUSE_SYSTEM_TZ_DB=ON" |
| 129 | (inputs (list tzdata)) | 129 | "-DBUILD_SHARED_LIBS=ON" |
| 130 | (build-system cmake-build-system) | 130 | "-DBUILD_TZ_LIB=ON" |
| 131 | (arguments | 131 | "-DENABLE_DATE_TESTING=ON") |
| 132 | '(#:configure-flags (list "-DUSE_SYSTEM_TZ_DB=ON" | 132 | #:phases |
| 133 | "-DBUILD_SHARED_LIBS=ON" | 133 | (modify-phases %standard-phases |
| 134 | "-DBUILD_TZ_LIB=ON" | 134 | (add-after 'unpack 'patch-bin-bash |
| 135 | "-DENABLE_DATE_TESTING=ON") | 135 | (lambda* (#:key inputs #:allow-other-keys) |
| 136 | #:phases | 136 | (substitute* "compile_fail.sh" |
| 137 | (modify-phases %standard-phases | 137 | (("/bin/bash") (which "bash"))) |
| 138 | (add-after 'unpack 'patch-bin-bash | 138 | #t)) |
| 139 | (lambda* (#:key inputs #:allow-other-keys) | 139 | (add-after 'unpack 'patch-zoneinfo-path |
| 140 | (substitute* "compile_fail.sh" | 140 | (lambda* (#:key inputs #:allow-other-keys) |
| 141 | (("/bin/bash") (which "bash"))) | 141 | (substitute* "src/tz.cpp" |
| 142 | #t)) | 142 | (("/usr/share/zoneinfo") |
| 143 | (add-after 'unpack 'patch-zoneinfo-path | 143 | (search-input-directory inputs |
| 144 | (lambda* (#:key inputs #:allow-other-keys) | 144 | "share/zoneinfo"))))) |
| 145 | (substitute* "src/tz.cpp" | 145 | (add-after 'unpack 'skip-failing-tests |
| 146 | (("/usr/share/zoneinfo") | 146 | ;; Disable test that requires checking timezone that |
| 147 | (search-input-directory inputs | 147 | ;; isn't set in the build environment. |
| 148 | "share/zoneinfo"))))) | 148 | (lambda _ |
| 149 | (replace 'check | 149 | (for-each delete-file |
| 150 | (lambda _ | 150 | '("test/solar_hijri_test/parse.pass.cpp" |
| 151 | ;; Disable test that requires checking timezone that | 151 | "test/tz_test/zoned_time_deduction.pass.cpp")))) |
| 152 | ;; isn't set in the build environment. | 152 | (replace 'check |
| 153 | (substitute* "CTestTestfile.cmake" | 153 | (lambda _ |
| 154 | (("add_test.tz_test_pass_zoned_time_deduction_test.*") "") | 154 | (invoke "make" "testit")))))) |
| 155 | (("set_tests_properties.tz_test_pass_zoned_time_deduction_test.*") "")) | 155 | (synopsis "Date and time library for C++11 and C++14") |
| 156 | (invoke "make" "testit")))))) | 156 | (description "Date is a header only C++ library that extends the chrono |
| 157 | (synopsis "Date and time library for C++11 and C++14") | ||
| 158 | (description "Date is a header only C++ library that extends the chrono | ||
| 159 | date algorithms library for calendar dates and durations. It also provides | 157 | date algorithms library for calendar dates and durations. It also provides |
| 160 | the <tz.h> library for handling time zones and leap seconds.") | 158 | the <tz.h> library for handling time zones and leap seconds.") |
| 161 | (home-page "https://howardhinnant.github.io/date/date.html") | 159 | (home-page "https://howardhinnant.github.io/date/date.html") |
| 162 | (license license:expat)))) | 160 | (license license:expat))) |
| 163 | 161 | ||
| 164 | (define-public libical | 162 | (define-public libical |
| 165 | (package | 163 | (package |
diff --git a/gnu/packages/patches/date-output-pkg-config-files.patch b/gnu/packages/patches/date-output-pkg-config-files.patch index 3fd1d54b369..cfef1d8512b 100644 --- a/gnu/packages/patches/date-output-pkg-config-files.patch +++ b/gnu/packages/patches/date-output-pkg-config-files.patch | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | From e56b2dce7e89a92e1b9b35caa13b3e938c4cedea Mon Sep 17 00:00:00 2001 | 1 | From 13762204d70733b6e7510ccd323b9b1e77c06c0f Mon Sep 17 00:00:00 2001 |
| 2 | From: Cole Mickens <cole.mickens@gmail.com> | 2 | From: Cole Mickens <cole.mickens@gmail.com> |
| 3 | Date: Sun, 26 Jan 2020 01:27:08 -0800 | 3 | Date: Sun, 26 Jan 2020 01:27:08 -0800 |
| 4 | Subject: [PATCH] CMakeLists.txt: output date.pc for pkg-config | 4 | Subject: [PATCH] CMakeLists.txt: output date.pc for pkg-config |
| @@ -10,16 +10,16 @@ Subject: [PATCH] CMakeLists.txt: output date.pc for pkg-config | |||
| 10 | create mode 100644 date.pc.in | 10 | create mode 100644 date.pc.in |
| 11 | 11 | ||
| 12 | diff --git a/CMakeLists.txt b/CMakeLists.txt | 12 | diff --git a/CMakeLists.txt b/CMakeLists.txt |
| 13 | index f30c473..fe778e8 100644 | 13 | index 012512a..5fbea80 100644 |
| 14 | --- a/CMakeLists.txt | 14 | --- a/CMakeLists.txt |
| 15 | +++ b/CMakeLists.txt | 15 | +++ b/CMakeLists.txt |
| 16 | @@ -128,6 +128,15 @@ if( BUILD_TZ_LIB ) | 16 | @@ -158,6 +158,15 @@ if( BUILD_TZ_LIB ) |
| 17 | endif( ) | 17 | endif( ) |
| 18 | endif( ) | 18 | endif( ) |
| 19 | 19 | ||
| 20 | +if ( BUILD_TZ_LIB ) | 20 | +if ( BUILD_TZ_LIB ) |
| 21 | + # Cflags: -I${includedir} @TZ_COMPILE_DEFINITIONS@ | 21 | + # Cflags: -I${includedir} @TZ_COMPILE_DEFINITIONS@ |
| 22 | + set( TZ_COMPILE_DEFINITIONS "$<IF:$<TARGET_EXISTS:tz>,-D$<JOIN:$<TARGET_PROPERTY:tz,INTERFACE_COMPILE_DEFINITIONS>, -D>,>" ) | 22 | + set( TZ_COMPILE_DEFINITIONS "$<IF:$<TARGET_EXISTS:date-tz>,-D$<JOIN:$<TARGET_PROPERTY:date-tz,INTERFACE_COMPILE_DEFINITIONS>, -D>,>" ) |
| 23 | + configure_file(date.pc.in date.pc.cf @ONLY) | 23 | + configure_file(date.pc.in date.pc.cf @ONLY) |
| 24 | + file( GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/date.pc" | 24 | + file( GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/date.pc" |
| 25 | + INPUT "${CMAKE_CURRENT_BINARY_DIR}/date.pc.cf" ) | 25 | + INPUT "${CMAKE_CURRENT_BINARY_DIR}/date.pc.cf" ) |
| @@ -29,7 +29,7 @@ index f30c473..fe778e8 100644 | |||
| 29 | #[===================================================================[ | 29 | #[===================================================================[ |
| 30 | installation | 30 | installation |
| 31 | #]===================================================================] | 31 | #]===================================================================] |
| 32 | @@ -171,6 +180,12 @@ install ( | 32 | @@ -201,6 +210,12 @@ install ( |
| 33 | FILES cmake/dateConfig.cmake "${version_config}" | 33 | FILES cmake/dateConfig.cmake "${version_config}" |
| 34 | DESTINATION ${CONFIG_LOC}) | 34 | DESTINATION ${CONFIG_LOC}) |
| 35 | 35 | ||
| @@ -56,5 +56,5 @@ index 0000000..b9c4623 | |||
| 56 | +Name: date | 56 | +Name: date |
| 57 | +Description: A date and time library based on the C++11/14/17 <chrono> header | 57 | +Description: A date and time library based on the C++11/14/17 <chrono> header |
| 58 | +Version: @PACKAGE_VERSION@ | 58 | +Version: @PACKAGE_VERSION@ |
| 59 | +Libs: -L${libdir} -ltz | 59 | +Libs: -L${libdir} -ldate-tz |
| 60 | +Cflags: -I${includedir} @TZ_COMPILE_DEFINITIONS@ | 60 | +Cflags: -I${includedir} @TZ_COMPILE_DEFINITIONS@ |
