From 12e044755e9d9cf886ceb63ef7af3010303d31c4 Mon Sep 17 00:00:00 2001
From: Callum Prentice <callum@lindenlab.com>
Date: Mon, 10 Apr 2023 17:01:10 -0700
Subject: [PATCH] SL-19078: changes to autobuild to unpack the emoji/shortcode
 3p library and then copy the XML files to the right place in the Viewer dev
 tree (indra/newview/skins/xui/*/emoji_characters.xml)

---
 indra/cmake/ViewerMiscLibs.cmake |  1 +
 indra/newview/CMakeLists.txt     | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/indra/cmake/ViewerMiscLibs.cmake b/indra/cmake/ViewerMiscLibs.cmake
index 7eed456833e..cae68fbc119 100644
--- a/indra/cmake/ViewerMiscLibs.cmake
+++ b/indra/cmake/ViewerMiscLibs.cmake
@@ -20,3 +20,4 @@ use_prebuilt_binary(slvoice)
 
 use_prebuilt_binary(nanosvg)
 use_prebuilt_binary(viewer-fonts)
+use_prebuilt_binary(emoji_shortcodes)
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index b63100fc2bc..ab0c60a402b 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1917,6 +1917,22 @@ file(GLOB FONT_FILE_GLOB_LIST
 )
 file(COPY ${FONT_FILE_GLOB_LIST} DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/fonts")
 
+# Copy over the Emoji/shortcodes mapping XML files (and create dependency
+# if they are changed, CMake will run again and copy over new versions)
+message("Copying Emoji/shortcode mappings")
+set(emoji_mapping_src_folder ${AUTOBUILD_INSTALL_DIR}/xui)
+set(emoji_mapping_dst_folder ${CMAKE_CURRENT_SOURCE_DIR}/skins/default/xui)
+
+# Note Turkey is missing from this set (not available in Emoji package yet)
+set(country_codes "da;de;en;es;fr;it;ja;pl;pt;ru;zh")
+foreach(elem ${country_codes})
+   set(emoji_mapping_src_file
+      "${emoji_mapping_src_folder}/${elem}/emoji_characters.xml")
+   set(emoji_mapping_dst_file
+      "${emoji_mapping_dst_folder}/${elem}/emoji_characters.xml")      
+   configure_file(${emoji_mapping_src_file} ${emoji_mapping_dst_file} COPYONLY)
+endforeach()
+
 if (LINUX)
   set(product SecondLife-${ARCH}-${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION})
 
-- 
GitLab