Blame SOURCES/evolution-3.28.5-intltool-cache.patch

5d780a
From f315ca6a601e77220323bff4ac7782b54c862a0c Mon Sep 17 00:00:00 2001
5d780a
From: Milan Crha <mcrha@redhat.com>
5d780a
Date: Tue, 30 Oct 2018 15:50:58 +0100
5d780a
Subject: [PATCH] Make sure intltool-merge cache is created only once
5d780a
5d780a
Similar to https://gitlab.gnome.org/GNOME/evolution/issues/196
5d780a
when intltool-merge is called in parallel, it could either rewrite
5d780a
the ongoing attempt to build it or use an incomplete data, which
5d780a
results in broken output files (.desktop, .metainfo and so on).
5d780a
This change ensures the intltool-merge cache is created only once
5d780a
and any other requests which would use it will wait until it's created.
5d780a
---
5d780a
 cmake/modules/FindIntltool.cmake | 11 ++++++++++-
5d780a
 1 file changed, 10 insertions(+), 1 deletion(-)
5d780a
5d780a
diff --git a/cmake/modules/FindIntltool.cmake b/cmake/modules/FindIntltool.cmake
5d780a
index 2cda2549eb..8e223e9d7f 100644
5d780a
--- a/cmake/modules/FindIntltool.cmake
5d780a
+++ b/cmake/modules/FindIntltool.cmake
5d780a
@@ -176,9 +176,18 @@ macro(intltool_merge _in_filename _out_filename)
5d780a
 			DEPENDS ${_in}
5d780a
 		)
5d780a
 	else(_has_no_translations)
5d780a
+		if(NOT TARGET intltool-merge-cache)
5d780a
+			add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/po/.intltool-merge-cache
5d780a
+				COMMAND ${INTLTOOL_MERGE} ${_args} --quiet --cache="${CMAKE_BINARY_DIR}/po/.intltool-merge-cache" "${GETTEXT_PO_DIR}" "${_in}" "${_out}"
5d780a
+				DEPENDS ${_in}
5d780a
+			)
5d780a
+			add_custom_target(intltool-merge-cache ALL
5d780a
+				DEPENDS ${CMAKE_BINARY_DIR}/po/.intltool-merge-cache)
5d780a
+		endif(NOT TARGET intltool-merge-cache)
5d780a
+
5d780a
 		add_custom_command(OUTPUT ${_out}
5d780a
 			COMMAND ${INTLTOOL_MERGE} ${_args} --quiet --cache="${CMAKE_BINARY_DIR}/po/.intltool-merge-cache" "${GETTEXT_PO_DIR}" "${_in}" "${_out}"
5d780a
-			DEPENDS ${_in}
5d780a
+			DEPENDS ${_in} intltool-merge-cache
5d780a
 		)
5d780a
 	endif(_has_no_translations)
5d780a
 endmacro(intltool_merge)
5d780a
-- 
5d780a
2.18.1
5d780a