1{ stdenv, fetchFromGitHub, perl, pkgconfig, cmake, ninja, vala, gobject-introspection
2, python3, tzdata, gtk-doc, docbook_xsl, docbook_xml_dtd_43, glib, libxml2, icu }:
3
4stdenv.mkDerivation rec {
5 name = "libical-${version}";
6 version = "3.0.4";
7
8 outputs = [ "out" "dev" "devdoc" ];
9
10 src = fetchFromGitHub {
11 owner = "libical";
12 repo = "libical";
13 rev = "v${version}";
14 sha256 = "1qgpbdjd6jsivw87v5w52268kqp0rv780kli8cgb3ndlv592wlbm";
15 };
16
17 nativeBuildInputs = [
18 perl pkgconfig cmake ninja vala gobject-introspection
19 (python3.withPackages (pkgs: with pkgs; [ pygobject3 ])) # running libical-glib tests
20 gtk-doc docbook_xsl docbook_xml_dtd_43 # docs
21 ];
22 buildInputs = [ glib libxml2 icu ];
23
24 cmakeFlags = [
25 "-DGOBJECT_INTROSPECTION=True"
26 "-DICAL_GLIB_VAPI=True"
27 ];
28
29 patches = [
30 # TODO: upstream this patch
31 # https://github.com/libical/libical/issues/350
32 ./respect-env-tzdir.patch
33 ];
34
35 # Using install check so we do not have to manually set
36 # LD_LIBRARY_PATH and GI_TYPELIB_PATH variables
37 doInstallCheck = true;
38 enableParallelChecking = false;
39 installCheckPhase = ''
40 runHook preInstallCheck
41
42 export TZDIR=${tzdata}/share/zoneinfo
43 ctest --output-on-failure
44
45 runHook postInstallCheck
46 '';
47
48 meta = with stdenv.lib; {
49 homepage = https://github.com/libical/libical;
50 description = "An Open Source implementation of the iCalendar protocols";
51 license = licenses.mpl20;
52 platforms = platforms.unix;
53 };
54}