From a51f6474d2c814f2252a8aa32286736d567c01e0 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Mon, 18 Sep 2017 03:25:11 +0200 Subject: [PATCH] =?UTF-8?q?libical:=201.0.1=20=E2=86=92=202.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../development/libraries/libical/default.nix | 9 ++-- .../libraries/libical/respect-env-tzdir.patch | 48 ++++++++++--------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/pkgs/development/libraries/libical/default.nix b/pkgs/development/libraries/libical/default.nix index a91205e182c7..5ba8bb667845 100644 --- a/pkgs/development/libraries/libical/default.nix +++ b/pkgs/development/libraries/libical/default.nix @@ -2,18 +2,21 @@ stdenv.mkDerivation rec { name = "libical-${version}"; - version = "1.0.1"; + version = "2.0.0"; src = fetchFromGitHub { owner = "libical"; repo = "libical"; rev = "v${version}"; - sha256 = "1y6rbw24m133d984pyqzx2bi7f37dsw6f33l6arwn6yd4zlqdib9"; + sha256 = "0xsvqy1hzmwxn783wrb2k8p751544pzv39v9ynr9pj4yzkwjzsvb"; }; nativeBuildInputs = [ perl cmake ]; - patches = [ ./respect-env-tzdir.patch ]; + patches = [ + # TODO: upstream this patch + ./respect-env-tzdir.patch + ]; meta = with stdenv.lib; { homepage = https://github.com/libical/libical; diff --git a/pkgs/development/libraries/libical/respect-env-tzdir.patch b/pkgs/development/libraries/libical/respect-env-tzdir.patch index fad78c2fb8a0..715ba1fa8426 100644 --- a/pkgs/development/libraries/libical/respect-env-tzdir.patch +++ b/pkgs/development/libraries/libical/respect-env-tzdir.patch @@ -1,27 +1,29 @@ ---- a/src/libical/icaltz-util.c 2015-06-11 15:40:58.843138630 +0200 -+++ b/src/libical/icaltz-util.c 2015-06-11 15:43:12.722046252 +0200 -@@ -107,7 +107,7 @@ - char charcnt[4]; - } tzinfo; - --static char *search_paths [] = {"/usr/share/zoneinfo","/usr/lib/zoneinfo","/etc/zoneinfo","/usr/share/lib/zoneinfo"}; -+static char *search_paths [] = {"/etc/zoneinfo","/usr/share/zoneinfo","/usr/lib/zoneinfo","/usr/share/lib/zoneinfo"}; +--- a/src/libical/icaltz-util.c ++++ b/src/libical/icaltz-util.c +@@ -96,9 +96,9 @@ typedef struct static char *zdir = NULL; - #define NUM_SEARCH_PATHS (sizeof (search_paths)/ sizeof (search_paths [0])) -@@ -194,6 +194,15 @@ - const char *fname = ZONES_TAB_SYSTEM_FILENAME; - unsigned int i; + static char *search_paths[] = { ++ "/etc/zoneinfo", + "/usr/share/zoneinfo", + "/usr/lib/zoneinfo", +- "/etc/zoneinfo", + "/usr/share/lib/zoneinfo" + }; -+ const char *env_tzdir = getenv ("TZDIR"); -+ if (env_tzdir) { -+ sprintf (file_path, "%s/%s", env_tzdir, fname); -+ if (!access (file_path, F_OK|R_OK)) { -+ zdir = env_tzdir; -+ return; -+ } -+ } +@@ -179,6 +179,15 @@ static void set_zonedir(void) + const char *fname = ZONES_TAB_SYSTEM_FILENAME; + size_t i, num_search_paths; + ++ const char *env_tzdir = getenv ("TZDIR"); ++ if (env_tzdir) { ++ snprintf(file_path, MAXPATHLEN, "%s/%s", env_tzdir, fname); ++ if (!access (file_path, F_OK|R_OK)) { ++ zdir = env_tzdir; ++ return; ++ } ++ } + - for (i = 0; i < NUM_SEARCH_PATHS; i++) { - sprintf (file_path, "%s/%s", search_paths [i], fname); - if (!access (file_path, F_OK|R_OK)) { + num_search_paths = sizeof(search_paths) / sizeof(search_paths[0]); + for (i = 0; i < num_search_paths; i++) { + snprintf(file_path, MAXPATHLEN, "%s/%s", search_paths[i], fname);