libical: 1.0.1 → 2.0.0

This commit is contained in:
Jan Tojnar 2017-09-18 03:25:11 +02:00
parent f5d5c13ad7
commit a51f6474d2
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4
2 changed files with 31 additions and 26 deletions

View File

@ -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;

View File

@ -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);