2020-10-07 09:15:18 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
2022-10-30 15:09:59 +00:00
|
|
|
, fetchurl
|
2020-10-07 09:15:18 +00:00
|
|
|
, buildPackages
|
2020-04-24 23:36:52 +00:00
|
|
|
, cmake
|
|
|
|
, glib
|
|
|
|
, icu
|
|
|
|
, libxml2
|
|
|
|
, ninja
|
|
|
|
, perl
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2020-10-07 09:15:18 +00:00
|
|
|
, libical
|
2020-04-24 23:36:52 +00:00
|
|
|
, python3
|
|
|
|
, tzdata
|
2021-05-20 23:08:51 +00:00
|
|
|
, fixDarwinDylibNames
|
|
|
|
, gobject-introspection
|
|
|
|
, vala
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libical";
|
2022-10-30 15:09:59 +00:00
|
|
|
version = "3.0.15";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "dev" ]; # "devdoc" ];
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "libical";
|
|
|
|
repo = "libical";
|
|
|
|
rev = "v${version}";
|
2022-10-30 15:09:59 +00:00
|
|
|
sha256 = "sha256-7M5GBteFKmKCB6556XXV4s6iIC/+3c3Ck17s/QX3Jus=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
strictDeps = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
ninja
|
|
|
|
perl
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config
|
2022-08-12 12:06:08 +00:00
|
|
|
gobject-introspection
|
|
|
|
vala
|
2020-04-24 23:36:52 +00:00
|
|
|
# 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-10-07 09:15:18 +00:00
|
|
|
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
|
|
|
# provides ical-glib-src-generator that runs during build
|
|
|
|
libical
|
2021-05-20 23:08:51 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
fixDarwinDylibNames
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
installCheckInputs = [
|
|
|
|
# running libical-glib tests
|
2022-08-12 12:06:08 +00:00
|
|
|
(python3.pythonForBuild.withPackages (pkgs: with pkgs; [
|
2020-04-24 23:36:52 +00:00
|
|
|
pygobject3
|
|
|
|
]))
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
glib
|
|
|
|
libxml2
|
|
|
|
icu
|
2022-05-18 14:49:53 +00:00
|
|
|
gobject-introspection
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DENABLE_GTK_DOC=False"
|
2022-08-12 12:06:08 +00:00
|
|
|
"-DGOBJECT_INTROSPECTION=True"
|
|
|
|
"-DICAL_GLIB_VAPI=True"
|
2020-10-07 09:15:18 +00:00
|
|
|
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
2021-03-09 03:18:52 +00:00
|
|
|
"-DIMPORT_ICAL_GLIB_SRC_GENERATOR=${lib.getDev buildPackages.libical}/lib/cmake/LibIcal/IcalGlibSrcGenerator.cmake"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Will appear in 3.1.0
|
|
|
|
# https://github.com/libical/libical/issues/350
|
|
|
|
./respect-env-tzdir.patch
|
2022-10-30 15:09:59 +00:00
|
|
|
|
|
|
|
# Fixes tests with 32-bit time_t
|
|
|
|
# Remove with next version update (v3.0.16+)
|
|
|
|
(fetchurl {
|
|
|
|
url = "https://github.com/libical/libical/commit/4adc6f1d2b39a1cc3363b57215e12fa81076498b.patch";
|
|
|
|
sha256 = "1k3hav0z86kc1xd1sk23b57aqqjk4gf73574w7f1m66cyz98bxr3";
|
|
|
|
})
|
|
|
|
(fetchurl {
|
|
|
|
url = "https://github.com/libical/libical/commit/cce20bd051408b00521385c0bfb616ba068450d3.patch";
|
|
|
|
sha256 = "097hqmagl0q5p38r1kvx0592cfac2y7jbdqlis6m8gbs812pbqfc";
|
|
|
|
})
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# Using install check so we do not have to manually set
|
|
|
|
# LD_LIBRARY_PATH and GI_TYPELIB_PATH variables
|
2022-07-14 12:49:19 +00:00
|
|
|
# Musl does not support TZDIR.
|
|
|
|
doInstallCheck = !stdenv.hostPlatform.isMusl;
|
2020-04-24 23:36:52 +00:00
|
|
|
enableParallelChecking = false;
|
2021-05-20 23:08:51 +00:00
|
|
|
preInstallCheck = if stdenv.isDarwin then ''
|
|
|
|
for testexe in $(find ./src/test -maxdepth 1 -type f -executable); do
|
|
|
|
for lib in $(cd lib && ls *.3.dylib); do
|
|
|
|
install_name_tool -change $lib $out/lib/$lib $testexe
|
|
|
|
done
|
|
|
|
done
|
|
|
|
'' else null;
|
2020-04-24 23:36:52 +00:00
|
|
|
installCheckPhase = ''
|
|
|
|
runHook preInstallCheck
|
|
|
|
|
|
|
|
export TZDIR=${tzdata}/share/zoneinfo
|
2020-11-12 09:05:59 +00:00
|
|
|
ctest --output-on-failure
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
runHook postInstallCheck
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/libical/libical";
|
|
|
|
description = "An Open Source implementation of the iCalendar protocols";
|
|
|
|
license = licenses.mpl20;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|