18 withIntrospection ? stdenv.hostPlatform.emulatorAvailable pkgsBuildHost,
19 gobject-introspection,
23 stdenv.mkDerivation rec {
32 src = fetchFromGitHub {
36 sha256 = "sha256-32FNnCybXO67Vtg1LM6miJUaK+r0mlfjxgLQg1LD8Es=";
41 depsBuildBuild = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
42 # provides ical-glib-src-generator that runs during build
54 ++ lib.optionals withIntrospection [
57 # Docs building fails:
58 # https://github.com/NixOS/nixpkgs/pull/67204
59 # previously with https://github.com/NixOS/nixpkgs/pull/61657#issuecomment-495579489
60 # gtk-doc docbook_xsl docbook_xml_dtd_43 # for docs
62 ++ lib.optionals stdenv.hostPlatform.isDarwin [
65 nativeInstallCheckInputs = [
66 # running libical-glib tests
67 (python3.pythonOnBuildForHost.withPackages (
82 "-DENABLE_GTK_DOC=False"
83 "-DGOBJECT_INTROSPECTION=${if withIntrospection then "True" else "False"}"
84 "-DICAL_GLIB_VAPI=${if withIntrospection then "True" else "False"}"
86 ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
87 "-DIMPORT_ICAL_GLIB_SRC_GENERATOR=${lib.getDev pkgsBuildBuild.libical}/lib/cmake/LibIcal/IcalGlibSrcGenerator.cmake"
91 # Will appear in 3.1.0
92 # https://github.com/libical/libical/issues/350
93 ./respect-env-tzdir.patch
97 # Fix typo in test env setup
98 # https://github.com/libical/libical/commit/03c02ced21494413920744a400c638b0cb5d493f
99 substituteInPlace src/test/libical-glib/CMakeLists.txt \
100 --replace-fail "''${CMAKE_BINARY_DIR}/src/libical-glib;\$ENV{GI_TYPELIB_PATH}" "''${CMAKE_BINARY_DIR}/src/libical-glib:\$ENV{GI_TYPELIB_PATH}" \
101 --replace-fail "''${LIBRARY_OUTPUT_PATH};\$ENV{LD_LIBRARY_PATH}" "''${LIBRARY_OUTPUT_PATH}:\$ENV{LD_LIBRARY_PATH}"
104 # Using install check so we do not have to manually set
105 # LD_LIBRARY_PATH and GI_TYPELIB_PATH variables
106 # Musl does not support TZDIR.
107 doInstallCheck = !stdenv.hostPlatform.isMusl;
108 enableParallelChecking = false;
110 if stdenv.hostPlatform.isDarwin then
112 for testexe in $(find ./src/test -maxdepth 1 -type f -executable); do
113 for lib in $(cd lib && ls *.3.dylib); do
114 install_name_tool -change $lib $out/lib/$lib $testexe
120 installCheckPhase = ''
121 runHook preInstallCheck
123 export TZDIR=${tzdata}/share/zoneinfo
124 ctest --output-on-failure
126 runHook postInstallCheck
130 homepage = "https://github.com/libical/libical";
131 description = "Open Source implementation of the iCalendar protocols";
132 changelog = "https://github.com/libical/libical/raw/v${version}/ReleaseNotes.txt";
133 license = licenses.mpl20;
134 platforms = platforms.unix;