evolution-data-server: enable cross compilation (#366487)

This commit is contained in:
misuzu
2024-12-19 19:15:01 +02:00
committed by GitHub
@@ -1,6 +1,7 @@
{
stdenv,
lib,
buildPackages,
fetchurl,
pkg-config,
gnome,
@@ -133,25 +134,40 @@ stdenv.mkDerivation rec {
json-glib
];
cmakeFlags = [
"-DENABLE_VALA_BINDINGS=ON"
"-DENABLE_INTROSPECTION=ON"
"-DINCLUDE_INSTALL_DIR=${placeholder "dev"}/include"
"-DWITH_PHONENUMBER=ON"
"-DENABLE_GTK=${lib.boolToString withGtk3}"
"-DENABLE_EXAMPLES=${lib.boolToString withGtk3}"
"-DENABLE_CANBERRA=${lib.boolToString withGtk3}"
"-DENABLE_GTK4=${lib.boolToString withGtk4}"
"-DENABLE_OAUTH2_WEBKITGTK=${lib.boolToString (withGtk3 && enableOAuth2)}"
"-DENABLE_OAUTH2_WEBKITGTK4=${lib.boolToString (withGtk4 && enableOAuth2)}"
];
cmakeFlags =
[
"-DENABLE_VALA_BINDINGS=ON"
"-DENABLE_INTROSPECTION=ON"
"-DINCLUDE_INSTALL_DIR=${placeholder "dev"}/include"
"-DWITH_PHONENUMBER=ON"
"-DENABLE_GTK=${lib.boolToString withGtk3}"
"-DENABLE_EXAMPLES=${lib.boolToString withGtk3}"
"-DENABLE_CANBERRA=${lib.boolToString withGtk3}"
"-DENABLE_GTK4=${lib.boolToString withGtk4}"
"-DENABLE_OAUTH2_WEBKITGTK=${lib.boolToString (withGtk3 && enableOAuth2)}"
"-DENABLE_OAUTH2_WEBKITGTK4=${lib.boolToString (withGtk4 && enableOAuth2)}"
]
++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
(lib.cmakeFeature "CMAKE_CROSSCOMPILING_EMULATOR" (stdenv.hostPlatform.emulator buildPackages))
];
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace cmake/modules/SetupBuildFlags.cmake \
--replace "-Wl,--no-undefined" ""
substituteInPlace src/services/evolution-alarm-notify/e-alarm-notify.c \
--replace "G_OS_WIN32" "__APPLE__"
'';
strictDeps = true;
postPatch =
lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace cmake/modules/SetupBuildFlags.cmake \
--replace "-Wl,--no-undefined" ""
substituteInPlace src/services/evolution-alarm-notify/e-alarm-notify.c \
--replace "G_OS_WIN32" "__APPLE__"
''
+ lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
substituteInPlace src/addressbook/libebook-contacts/CMakeLists.txt --replace-fail \
'COMMAND ''${CMAKE_CURRENT_BINARY_DIR}/gen-western-table' \
'COMMAND ${stdenv.hostPlatform.emulator buildPackages} ''${CMAKE_CURRENT_BINARY_DIR}/gen-western-table'
substituteInPlace src/camel/CMakeLists.txt --replace-fail \
'COMMAND ''${CMAKE_CURRENT_BINARY_DIR}/camel-gen-tables' \
'COMMAND ${stdenv.hostPlatform.emulator buildPackages} ''${CMAKE_CURRENT_BINARY_DIR}/camel-gen-tables'
'';
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
ln -s $out/lib/evolution-data-server/*.dylib $out/lib/