7 , _experimental-update-script-combinators
9 , gobject-introspection
26 , gsettings-desktop-schemas
33 , enableOAuth2 ? stdenv.isLinux
43 , gnome-online-accounts
48 , makeHardcodeGsettingsPatch
51 stdenv.mkDerivation rec {
52 pname = "evolution-data-server";
55 outputs = [ "out" "dev" ];
58 url = "mirror://gnome/sources/evolution-data-server/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
59 hash = "sha256-6fbIDBQgM7GAG8yqYiHEU9406tTqCJsghrGQhvmpwuQ=";
64 src = ./fix-paths.patch;
68 # Avoid using wrapper function, which the hardcode gsettings
69 # patch generator cannot handle.
70 ./drop-tentative-settings-constructor.patch
74 substitute ${./hardcode-gsettings.patch} hardcode-gsettings.patch \
75 --subst-var-by EDS ${glib.makeSchemaPath "$out" "${pname}-${version}"} \
76 --subst-var-by GDS ${glib.getSchemaPath gsettings-desktop-schemas}
77 patches="$patches $PWD/hardcode-gsettings.patch"
109 ] ++ lib.optionals stdenv.isDarwin [
111 ] ++ lib.optionals withGtk3 [
113 ] ++ lib.optionals (withGtk3 && enableOAuth2) [
115 ] ++ lib.optionals withGtk4 [
117 ] ++ lib.optionals (withGtk4 && enableOAuth2) [
121 propagatedBuildInputs = [
132 "-DENABLE_VALA_BINDINGS=ON"
133 "-DENABLE_INTROSPECTION=ON"
134 "-DINCLUDE_INSTALL_DIR=${placeholder "dev"}/include"
135 "-DWITH_PHONENUMBER=ON"
136 "-DENABLE_GTK=${lib.boolToString withGtk3}"
137 "-DENABLE_EXAMPLES=${lib.boolToString withGtk3}"
138 "-DENABLE_CANBERRA=${lib.boolToString withGtk3}"
139 "-DENABLE_GTK4=${lib.boolToString withGtk4}"
140 "-DENABLE_OAUTH2_WEBKITGTK=${lib.boolToString (withGtk3 && enableOAuth2)}"
141 "-DENABLE_OAUTH2_WEBKITGTK4=${lib.boolToString (withGtk4 && enableOAuth2)}"
144 postPatch = lib.optionalString stdenv.isDarwin ''
145 substituteInPlace cmake/modules/SetupBuildFlags.cmake \
146 --replace "-Wl,--no-undefined" ""
147 substituteInPlace src/services/evolution-alarm-notify/e-alarm-notify.c \
148 --replace "G_OS_WIN32" "__APPLE__"
151 postInstall = lib.optionalString stdenv.isDarwin ''
152 ln -s $out/lib/${pname}/*.dylib $out/lib/
156 hardcodeGsettingsPatch = makeHardcodeGsettingsPatch {
157 schemaIdToVariableMapping = {
158 "org.gnome.Evolution.DefaultSources" = "EDS";
159 "org.gnome.evolution.shell.network-config" = "EDS";
160 "org.gnome.evolution-data-server.addressbook" = "EDS";
161 "org.gnome.evolution-data-server.calendar" = "EDS";
162 "org.gnome.evolution-data-server" = "EDS";
163 "org.gnome.desktop.interface" = "GDS";
169 updateSource = gnome.updateScript {
170 packageName = "evolution-data-server";
171 versionPolicy = "odd-unstable";
173 updatePatch = _experimental-update-script-combinators.copyAttrOutputToFile "evolution-data-server.hardcodeGsettingsPatch" ./hardcode-gsettings.patch;
175 _experimental-update-script-combinators.sequence [
182 description = "Unified backend for programs that work with contacts, tasks, and calendar information";
183 homepage = "https://gitlab.gnome.org/GNOME/evolution-data-server";
184 license = licenses.lgpl2Plus;
185 maintainers = teams.gnome.members;
186 platforms = platforms.unix;