mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
Ladybird: Ensure emoji files are installed into the Ladybird bundle
Otherwise, we are unable to render emoji on websites.
This commit is contained in:
parent
91cd43a7ac
commit
7463b31754
Notes:
sideshowbarker
2024-07-17 06:24:08 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/7463b31754 Pull-request: https://github.com/SerenityOS/serenity/pull/23643 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/nico
3 changed files with 32 additions and 3 deletions
|
@ -1,3 +1,6 @@
|
|||
file(STRINGS "${SERENITY_SOURCE_DIR}/Meta/emoji-file-list.txt" EMOJI)
|
||||
list(TRANSFORM EMOJI PREPEND "${SERENITY_SOURCE_DIR}/Base/res/emoji/")
|
||||
|
||||
set(FONTS
|
||||
CsillaBold10.font
|
||||
CsillaBold12.font
|
||||
|
@ -124,9 +127,12 @@ function(copy_resource_set subdir)
|
|||
endfunction()
|
||||
|
||||
function(copy_resources_to_build base_directory bundle_target)
|
||||
|
||||
add_custom_target("${bundle_target}_build_resource_files")
|
||||
|
||||
copy_resource_set(emoji RESOURCES ${EMOJI}
|
||||
DESTINATION ${base_directory} TARGET ${bundle_target}
|
||||
)
|
||||
|
||||
copy_resource_set(fonts RESOURCES ${FONTS}
|
||||
DESTINATION ${base_directory} TARGET ${bundle_target}
|
||||
)
|
||||
|
@ -167,6 +173,7 @@ function(copy_resources_to_build base_directory bundle_target)
|
|||
endfunction()
|
||||
|
||||
function(install_ladybird_resources destination component)
|
||||
install(FILES ${EMOJI} DESTINATION "${destination}/emoji" COMPONENT ${component})
|
||||
install(FILES ${FONTS} DESTINATION "${destination}/fonts" COMPONENT ${component})
|
||||
install(FILES ${16x16_ICONS} DESTINATION "${destination}/icons/16x16" COMPONENT ${component})
|
||||
install(FILES ${32x32_ICONS} DESTINATION "${destination}/icons/32x32" COMPONENT ${component})
|
||||
|
|
|
@ -144,6 +144,7 @@ executable("ladybird_executable") {
|
|||
if (current_os != "mac") {
|
||||
data_deps += [
|
||||
":ladybird_copy_config_resources",
|
||||
":ladybird_copy_emoji",
|
||||
":ladybird_copy_fonts",
|
||||
":ladybird_copy_icons_16x16",
|
||||
":ladybird_copy_icons_32x32",
|
||||
|
@ -188,6 +189,13 @@ executable("headless-browser") {
|
|||
]
|
||||
}
|
||||
|
||||
_emoji = read_file("//Meta/emoji-file-list.txt", "list lines")
|
||||
emoji = []
|
||||
|
||||
foreach(file, _emoji) {
|
||||
emoji += [ "//Base/res/emoji/" + file ]
|
||||
}
|
||||
|
||||
fonts = [
|
||||
"//Base/res/fonts/CsillaBold10.font",
|
||||
"//Base/res/fonts/CsillaBold12.font",
|
||||
|
@ -271,6 +279,11 @@ config_resources = [
|
|||
]
|
||||
|
||||
if (current_os != "mac") {
|
||||
copy("ladybird_copy_emoji") {
|
||||
sources = emoji
|
||||
outputs = [ "$root_out_dir/share/Lagom/emoji/{{source_file_part}}" ]
|
||||
}
|
||||
|
||||
copy("ladybird_copy_fonts") {
|
||||
sources = fonts
|
||||
outputs = [ "$root_out_dir/share/Lagom/fonts/{{source_file_part}}" ]
|
||||
|
@ -427,6 +440,11 @@ if (current_os != "mac") {
|
|||
outputs = [ "{{bundle_contents_dir}}/lib/{{source_file_part}}" ]
|
||||
}
|
||||
|
||||
bundle_data("ladybird_emoji") {
|
||||
sources = emoji
|
||||
outputs = [ "{{bundle_resources_dir}}/emoji/{{source_file_part}}" ]
|
||||
}
|
||||
|
||||
bundle_data("ladybird_fonts") {
|
||||
sources = fonts
|
||||
outputs = [ "{{bundle_resources_dir}}/fonts/{{source_file_part}}" ]
|
||||
|
@ -514,6 +532,7 @@ if (current_os != "mac") {
|
|||
":ladybird_bundle_info_plist",
|
||||
":ladybird_bundle_libs",
|
||||
":ladybird_config_resources",
|
||||
":ladybird_emoji",
|
||||
":ladybird_fonts",
|
||||
":ladybird_icon",
|
||||
":ladybird_icons_16x16",
|
||||
|
|
|
@ -131,13 +131,16 @@ if (enable_unicode_database_download) {
|
|||
"-s",
|
||||
rebase_path("//Base/home/anon/Documents/emoji-serenity.txt",
|
||||
root_build_dir),
|
||||
"-f",
|
||||
rebase_path("//Meta/emoji-file-list.txt", root_build_dir),
|
||||
"-r",
|
||||
rebase_path("//Base/res/emoji", root_build_dir),
|
||||
]
|
||||
|
||||
# FIXME: How to add file/directory dependencies on
|
||||
# FIXME: How to add file/directory dependencies on:
|
||||
# "//Base/home/anon/Documents/emoji-serenity.txt"
|
||||
# and "//Base/res/emoji"?
|
||||
# "//Base/res/emoji"
|
||||
# "//Meta/emoji-file-list.txt"
|
||||
}
|
||||
|
||||
compiled_action("generate_idna_sources") {
|
||||
|
|
Loading…
Reference in a new issue