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

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