From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:33988) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDLqg-000366-GA for guix-patches@gnu.org; Sun, 15 Mar 2020 01:30:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDLqc-00044a-Te for guix-patches@gnu.org; Sun, 15 Mar 2020 01:30:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56436) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jDLqc-00044I-Ph for guix-patches@gnu.org; Sun, 15 Mar 2020 01:30:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jDLqc-0006KW-MN for guix-patches@gnu.org; Sun, 15 Mar 2020 01:30:02 -0400 Subject: [bug#40068] [PATCH 1/4] gnu: Add date. References: <3eca1927-4a04-3219-77d8-729626e41086@brendan.scot> In-Reply-To: <3eca1927-4a04-3219-77d8-729626e41086@brendan.scot> Resent-Message-ID: From: Brendan Tildesley Date: Sun, 15 Mar 2020 16:28:50 +1100 Message-Id: <20200315052853.26793-1-mail@brendan.scot> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 40068@debbugs.gnu.org * gnu/packages/wm.scm (date): New variable. * gnu/packages/patches/date-output-pkg-config-files.patch: New file. * gnu/local.mk: Add patch. --- gnu/local.mk | 2 + gnu/packages/calendar.scm | 58 ++++++++++++++++++ .../date-output-pkg-config-files.patch | 60 +++++++++++++++++++ 3 files changed, 120 insertions(+) create mode 100644 gnu/packages/patches/date-output-pkg-config-files.patch diff --git a/gnu/local.mk b/gnu/local.mk index 99baddea92..84ddeb3f9e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -26,6 +26,7 @@ # Copyright © 2019 Evan Straw # Copyright © 2019 Brett Gilio # Copyright © 2019 Amin Bandali +# Copyright © 2020 Brendan Tildesley # # This file is part of GNU Guix. # @@ -802,6 +803,7 @@ dist_patch_DATA = \ %D%/packages/patches/cube-nocheck.patch \ %D%/packages/patches/cursynth-wave-rand.patch \ %D%/packages/patches/cvs-CVE-2017-12836.patch \ + %D%/packages/patches/date-output-pkg-config-files.patch \ %D%/packages/patches/darkice-workaround-fpermissive-error.patch \ %D%/packages/patches/dbus-helper-search-path.patch \ %D%/packages/patches/dbus-c++-gcc-compat.patch \ diff --git a/gnu/packages/calendar.scm b/gnu/packages/calendar.scm index 060e4d18ad..95c43e1d06 100644 --- a/gnu/packages/calendar.scm +++ b/gnu/packages/calendar.scm @@ -7,6 +7,7 @@ ;;; Copyright © 2016 Stefan Reichoer ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice ;;; Copyright © 2020 Marius Bakke ;;; ;;; This file is part of GNU Guix. ;;; @@ -26,6 +27,7 @@ (define-module (gnu packages calendar) #:use-module (gnu packages) #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix git-download) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system gnu) @@ -48,6 +50,62 @@ #:use-module (gnu packages xml) #:use-module (srfi srfi-26)) +(define-public date + ;; We make the same choice as the Arch package maintainer by choosing a + ;; recent commit to fix some bugs. + ;; https://github.com/Alexays/Waybar/issues/565 + (let ((commit "9a0ee2542848ab8625984fc8cdbfb9b5414c0082")) + (package + (name "date") + (version (string-append "2.4.1-" (string-take commit 8))) + (source + (origin + (method git-fetch) + (uri (git-reference + (url"https://github.com/HowardHinnant/date.git") + (commit "9a0ee2542848ab8625984fc8cdbfb9b5414c0082"))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0yxsn0hj22n61bjywysxqgfv7hj5xvsl6isma95fl8xrimpny083")) + (patches + ;; Install pkg-config files + ;; https://github.com/HowardHinnant/date/pull/538 + (search-patches "date-output-pkg-config-files.patch")))) + (inputs `(("tzdata" ,tzdata))) + (build-system cmake-build-system) + (arguments + '(#:configure-flags (list "-DUSE_SYSTEM_TZ_DB=ON" + "-DBUILD_SHARED_LIBS=ON" + "-DBUILD_TZ_LIB=ON" + "-DENABLE_DATE_TESTING=ON") + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-bin-bash + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "compile_fail.sh" + (("/bin/bash") (which "bash"))) + #t)) + (add-after 'unpack 'patch-zoneinfo-path + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "src/tz.cpp" + (("/usr/share/zoneinfo") + (string-append (assoc-ref inputs "tzdata") "/share/zoneinfo"))) + #t)) + (replace 'check + (lambda _ + ;; Disable test that requires checking timezone that + ;; isn't set in the build environment. + (substitute* "CTestTestfile.cmake" + (("add_test.tz_test_pass_zoned_time_deduction_test.*") "") + (("set_tests_properties.tz_test_pass_zoned_time_deduction_test.*") "")) + (invoke "make" "testit")))))) + (synopsis "Date and time library for C++11 and C++14") + (description "Date is a header only C++ library that extends the chrono +date algorithms library for calendar dates and durations. It also provides +the library for handling time zones and leap seconds.") + (home-page "https://howardhinnant.github.io/date/date.html") + (license license:expat)))) + (define-public libical (package (name "libical") diff --git a/gnu/packages/patches/date-output-pkg-config-files.patch b/gnu/packages/patches/date-output-pkg-config-files.patch new file mode 100644 index 0000000000..3fd1d54b36 --- /dev/null +++ b/gnu/packages/patches/date-output-pkg-config-files.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} -ltz ++Cflags: -I${includedir} @TZ_COMPILE_DEFINITIONS@ -- 2.25.1