From 9b7cb8be4dd055915da01cd023e98ef6c12db7d3 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Fri, 29 Jun 2018 12:49:33 +0200 Subject: [PATCH] =?UTF-8?q?libical:=202.0.0=20=E2=86=92=203.0.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../development/libraries/libical/default.nix | 36 +++++++++++++++---- .../libraries/libical/respect-env-tzdir.patch | 10 +++--- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/pkgs/development/libraries/libical/default.nix b/pkgs/development/libraries/libical/default.nix index fd9c8dc9a5e3..1efc16b2bf5c 100644 --- a/pkgs/development/libraries/libical/default.nix +++ b/pkgs/development/libraries/libical/default.nix @@ -1,29 +1,53 @@ -{ stdenv, fetchFromGitHub, perl, cmake }: +{ stdenv, fetchFromGitHub, perl, pkgconfig, cmake, ninja, vala, gobjectIntrospection +, python3, tzdata, gtk-doc, docbook_xsl, docbook_xml_dtd_43, glib, libxml2, icu }: stdenv.mkDerivation rec { name = "libical-${version}"; - version = "2.0.0"; + version = "3.0.3"; + + outputs = [ "out" "dev" "devdoc" ]; src = fetchFromGitHub { owner = "libical"; repo = "libical"; rev = "v${version}"; - sha256 = "0xsvqy1hzmwxn783wrb2k8p751544pzv39v9ynr9pj4yzkwjzsvb"; + sha256 = "0dhlfn6n136di4fbqd74gdaibyh5zz1vac5x8ii3bjc2d5h7hw8h"; }; - nativeBuildInputs = [ perl cmake ]; + nativeBuildInputs = [ + perl pkgconfig cmake ninja vala gobjectIntrospection + (python3.withPackages (pkgs: with pkgs; [ pygobject3 ])) # running libical-glib tests + gtk-doc docbook_xsl docbook_xml_dtd_43 # docs + ]; + buildInputs = [ glib libxml2 icu ]; + + cmakeFlags = [ + "-DGOBJECT_INTROSPECTION=True" + "-DICAL_GLIB_VAPI=True" + ]; patches = [ # TODO: upstream this patch + # https://github.com/libical/libical/issues/350 ./respect-env-tzdir.patch ]; - doCheck = false; # fails all the tests (ctest) + # Using install check so we do not have to manually set + # LD_LIBRARY_PATH and GI_TYPELIB_PATH variables + doInstallCheck = true; + installCheckPhase = '' + runHook preInstallCheck + + export TZDIR=${tzdata}/share/zoneinfo + ctest --output-on-failure + + runHook postInstallCheck + ''; meta = with stdenv.lib; { homepage = https://github.com/libical/libical; description = "An Open Source implementation of the iCalendar protocols"; - license = licenses.mpl10; + license = licenses.mpl20; platforms = platforms.unix; maintainers = with maintainers; [ wkennington ]; }; diff --git a/pkgs/development/libraries/libical/respect-env-tzdir.patch b/pkgs/development/libraries/libical/respect-env-tzdir.patch index 715ba1fa8426..59d23e490e5a 100644 --- a/pkgs/development/libraries/libical/respect-env-tzdir.patch +++ b/pkgs/development/libraries/libical/respect-env-tzdir.patch @@ -1,9 +1,9 @@ --- a/src/libical/icaltz-util.c +++ b/src/libical/icaltz-util.c -@@ -96,9 +96,9 @@ typedef struct - static char *zdir = NULL; +@@ -94,9 +94,9 @@ + static const char *zdir = NULL; - static char *search_paths[] = { + static const char *search_paths[] = { + "/etc/zoneinfo", "/usr/share/zoneinfo", "/usr/lib/zoneinfo", @@ -11,13 +11,13 @@ "/usr/share/lib/zoneinfo" }; -@@ -179,6 +179,15 @@ static void set_zonedir(void) +@@ -178,6 +178,15 @@ 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); ++ sprintf (file_path, "%s/%s", env_tzdir, fname); + if (!access (file_path, F_OK|R_OK)) { + zdir = env_tzdir; + return;