2020-09-26 02:42:39 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2019-08-21 15:25:24 +01:00
|
|
|
, fetchFromGitHub
|
2020-09-26 02:42:39 +01:00
|
|
|
, fetchpatch
|
|
|
|
, buildPackages
|
2019-08-21 15:25:24 +01:00
|
|
|
, cmake
|
|
|
|
, glib
|
|
|
|
, icu
|
|
|
|
, libxml2
|
|
|
|
, ninja
|
|
|
|
, perl
|
|
|
|
, pkgconfig
|
2020-09-26 02:42:39 +01:00
|
|
|
, libical
|
2019-08-21 15:25:24 +01:00
|
|
|
, python3
|
|
|
|
, tzdata
|
2020-09-26 02:42:39 +01:00
|
|
|
, introspectionSupport ? stdenv.buildPlatform == stdenv.hostPlatform
|
|
|
|
, gobject-introspection ? null
|
|
|
|
, vala ? null
|
2019-08-21 15:25:24 +01:00
|
|
|
}:
|
2009-02-18 20:57:36 +00:00
|
|
|
|
2020-09-26 02:42:39 +01:00
|
|
|
assert introspectionSupport -> gobject-introspection != null && vala != null;
|
|
|
|
|
2011-11-07 16:48:40 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "libical";
|
2020-03-07 21:25:02 +00:00
|
|
|
version = "3.0.8";
|
2018-06-29 11:49:33 +01:00
|
|
|
|
2019-08-21 15:25:24 +01:00
|
|
|
outputs = [ "out" "dev" ]; # "devdoc" ];
|
2015-03-27 00:29:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "libical";
|
|
|
|
repo = "libical";
|
|
|
|
rev = "v${version}";
|
2020-03-07 21:25:02 +00:00
|
|
|
sha256 = "0pkh74bfrgp1slv8wsv7lbmal2m7qkixwm5llpmfwaiv14njlp68";
|
2009-02-18 20:57:36 +00:00
|
|
|
};
|
2015-03-27 00:29:57 +00:00
|
|
|
|
2018-06-29 11:49:33 +01:00
|
|
|
nativeBuildInputs = [
|
2019-08-21 15:25:24 +01:00
|
|
|
cmake
|
|
|
|
ninja
|
|
|
|
perl
|
|
|
|
pkgconfig
|
|
|
|
# Docs building fails:
|
|
|
|
# https://github.com/NixOS/nixpkgs/pull/67204
|
|
|
|
# previously with https://github.com/NixOS/nixpkgs/pull/61657#issuecomment-495579489
|
|
|
|
# gtk-doc docbook_xsl docbook_xml_dtd_43 # for docs
|
2020-09-26 02:42:39 +01:00
|
|
|
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
|
|
|
# provides ical-glib-src-generator that runs during build
|
|
|
|
libical
|
|
|
|
] ++ lib.optionals introspectionSupport [
|
|
|
|
gobject-introspection
|
|
|
|
vala
|
2019-08-21 15:25:24 +01:00
|
|
|
];
|
|
|
|
installCheckInputs = [
|
|
|
|
# running libical-glib tests
|
|
|
|
(python3.withPackages (pkgs: with pkgs; [
|
|
|
|
pygobject3
|
|
|
|
]))
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
glib
|
|
|
|
libxml2
|
|
|
|
icu
|
2018-06-29 11:49:33 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
2019-08-21 15:25:24 +01:00
|
|
|
"-DENABLE_GTK_DOC=False"
|
2020-09-26 02:42:39 +01:00
|
|
|
] ++ lib.optionals introspectionSupport [
|
|
|
|
"-DGOBJECT_INTROSPECTION=True"
|
2018-06-29 11:49:33 +01:00
|
|
|
"-DICAL_GLIB_VAPI=True"
|
2020-09-26 02:42:39 +01:00
|
|
|
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
|
|
|
"-DIMPORT_GLIB_SRC_GENERATOR=${lib.getDev buildPackages.libical}/lib/cmake/LibIcal/GlibSrcGenerator.cmake"
|
2018-06-29 11:49:33 +01:00
|
|
|
];
|
2012-08-08 10:10:36 +01:00
|
|
|
|
2017-09-18 02:25:11 +01:00
|
|
|
patches = [
|
2019-08-21 15:25:24 +01:00
|
|
|
# Will appear in 3.1.0
|
2018-06-29 11:49:33 +01:00
|
|
|
# https://github.com/libical/libical/issues/350
|
2017-09-18 02:25:11 +01:00
|
|
|
./respect-env-tzdir.patch
|
2020-09-26 02:42:39 +01:00
|
|
|
# Export src-generator binary for use while cross-compiling
|
|
|
|
# https://github.com/libical/libical/pull/439
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/libical/libical/commit/1197d84b63dce179b55a6293cfd6d0523607baf1.patch";
|
|
|
|
sha256 = "18i1khnwmw488s7g5a1kf05sladf8dbyhfc69mbcf6dkc4nnc3dg";
|
|
|
|
})
|
2017-09-18 02:25:11 +01:00
|
|
|
];
|
2015-03-27 00:29:57 +00:00
|
|
|
|
2018-06-29 11:49:33 +01:00
|
|
|
# Using install check so we do not have to manually set
|
|
|
|
# LD_LIBRARY_PATH and GI_TYPELIB_PATH variables
|
|
|
|
doInstallCheck = true;
|
2018-11-24 17:39:13 +00:00
|
|
|
enableParallelChecking = false;
|
2018-06-29 11:49:33 +01:00
|
|
|
installCheckPhase = ''
|
|
|
|
runHook preInstallCheck
|
|
|
|
|
|
|
|
export TZDIR=${tzdata}/share/zoneinfo
|
2020-11-05 16:25:24 +00:00
|
|
|
ctest --output-on-failure
|
2018-06-29 11:49:33 +01:00
|
|
|
|
|
|
|
runHook postInstallCheck
|
|
|
|
'';
|
2018-04-25 04:20:18 +01:00
|
|
|
|
2015-03-27 00:29:57 +00:00
|
|
|
meta = with stdenv.lib; {
|
2020-03-07 21:25:02 +00:00
|
|
|
homepage = "https://github.com/libical/libical";
|
2016-06-20 11:53:46 +01:00
|
|
|
description = "An Open Source implementation of the iCalendar protocols";
|
2018-06-29 11:49:33 +01:00
|
|
|
license = licenses.mpl20;
|
2015-03-27 00:29:57 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2009-02-18 20:57:36 +00:00
|
|
|
}
|