8 _experimental-update-script-combinators,
10 gobject-introspection,
26 gsettings-desktop-schemas,
33 enableOAuth2 ? stdenv.hostPlatform.isLinux,
44 gnome-online-accounts,
49 makeHardcodeGsettingsPatch,
52 stdenv.mkDerivation rec {
53 pname = "evolution-data-server";
62 url = "mirror://gnome/sources/evolution-data-server/${lib.versions.majorMinor version}/evolution-data-server-${version}.tar.xz";
63 hash = "sha256-UQjcOO5cwfjvkVXof2xBKflkRVCglixa4j/4B7V8uNA=";
67 # Avoid using wrapper function, which the hardcode gsettings
68 # patch generator cannot handle.
69 ./drop-tentative-settings-constructor.patch
73 substitute ${./hardcode-gsettings.patch} hardcode-gsettings.patch \
74 --subst-var-by EDS ${glib.makeSchemaPath "$out" "evolution-data-server-${version}"} \
75 --subst-var-by GDS ${glib.getSchemaPath gsettings-desktop-schemas}
76 patches="$patches $PWD/hardcode-gsettings.patch"
111 ++ lib.optionals stdenv.hostPlatform.isDarwin [
114 ++ lib.optionals withGtk3 [
117 ++ lib.optionals (withGtk3 && enableOAuth2) [
120 ++ lib.optionals withGtk4 [
123 ++ lib.optionals (withGtk4 && enableOAuth2) [
127 propagatedBuildInputs = [
139 "-DENABLE_VALA_BINDINGS=ON"
140 "-DENABLE_INTROSPECTION=ON"
141 "-DINCLUDE_INSTALL_DIR=${placeholder "dev"}/include"
142 "-DWITH_PHONENUMBER=ON"
143 "-DENABLE_GTK=${lib.boolToString withGtk3}"
144 "-DENABLE_EXAMPLES=${lib.boolToString withGtk3}"
145 "-DENABLE_CANBERRA=${lib.boolToString withGtk3}"
146 "-DENABLE_GTK4=${lib.boolToString withGtk4}"
147 "-DENABLE_OAUTH2_WEBKITGTK=${lib.boolToString (withGtk3 && enableOAuth2)}"
148 "-DENABLE_OAUTH2_WEBKITGTK4=${lib.boolToString (withGtk4 && enableOAuth2)}"
150 ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
151 (lib.cmakeFeature "CMAKE_CROSSCOMPILING_EMULATOR" (stdenv.hostPlatform.emulator buildPackages))
157 lib.optionalString stdenv.hostPlatform.isDarwin ''
158 substituteInPlace cmake/modules/SetupBuildFlags.cmake \
159 --replace "-Wl,--no-undefined" ""
160 substituteInPlace src/services/evolution-alarm-notify/e-alarm-notify.c \
161 --replace "G_OS_WIN32" "__APPLE__"
163 + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
164 substituteInPlace src/addressbook/libebook-contacts/CMakeLists.txt --replace-fail \
165 'COMMAND ''${CMAKE_CURRENT_BINARY_DIR}/gen-western-table' \
166 'COMMAND ${stdenv.hostPlatform.emulator buildPackages} ''${CMAKE_CURRENT_BINARY_DIR}/gen-western-table'
167 substituteInPlace src/camel/CMakeLists.txt --replace-fail \
168 'COMMAND ''${CMAKE_CURRENT_BINARY_DIR}/camel-gen-tables' \
169 'COMMAND ${stdenv.hostPlatform.emulator buildPackages} ''${CMAKE_CURRENT_BINARY_DIR}/camel-gen-tables'
172 postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
173 ln -s $out/lib/evolution-data-server/*.dylib $out/lib/
177 hardcodeGsettingsPatch = makeHardcodeGsettingsPatch {
178 schemaIdToVariableMapping = {
179 "org.gnome.Evolution.DefaultSources" = "EDS";
180 "org.gnome.evolution.shell.network-config" = "EDS";
181 "org.gnome.evolution-data-server.addressbook" = "EDS";
182 "org.gnome.evolution-data-server.calendar" = "EDS";
183 "org.gnome.evolution-data-server" = "EDS";
184 "org.gnome.desktop.interface" = "GDS";
190 updateSource = gnome.updateScript {
191 packageName = "evolution-data-server";
192 versionPolicy = "odd-unstable";
194 updatePatch = _experimental-update-script-combinators.copyAttrOutputToFile "evolution-data-server.hardcodeGsettingsPatch" ./hardcode-gsettings.patch;
196 _experimental-update-script-combinators.sequence [
203 description = "Unified backend for programs that work with contacts, tasks, and calendar information";
204 homepage = "https://gitlab.gnome.org/GNOME/evolution-data-server";
205 changelog = "https://gitlab.gnome.org/GNOME/evolution-data-server/-/blob/${version}/NEWS?ref_type=tags";
206 license = licenses.lgpl2Plus;
207 maintainers = teams.gnome.members;
208 platforms = platforms.linux; # requires libuuid