From 6e4d5b310f61ceb8d7eb6a72db03e43268eb2604 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Tue, 12 Dec 2023 20:25:27 -0700 Subject: [PATCH] Meta: Port recent changes to gn build 299d35aadc234d524e6771f05ace4f19ea4e8956 7d9fe440396f69b2a74cc2120ebf0a86c364ac97 58f08107b0711e1d242c6920a6ada60e579a6f4d 2cb0039a13deba1166d6e0bc9ab47e8fd3ed4e71 bc70144df1b29ba7e4fd5fd7873d6b927dc5cb8c 48a9d0ede87f2e23a17a86ea7276b94e79538c96 149e3827350441149286cf6ba9bfa2c6fd706855 --- .../Tools/CodeGenerators/LibUnicode/BUILD.gn | 5 +++ .../Userland/Libraries/LibELF/BUILD.gn | 22 ++++++++++ .../Userland/Libraries/LibGfx/BUILD.gn | 1 + .../Userland/Libraries/LibJIT/BUILD.gn | 9 ++++ .../Userland/Libraries/LibUnicode/BUILD.gn | 42 +++++++++++++++++-- 5 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 Meta/gn/secondary/Userland/Libraries/LibELF/BUILD.gn diff --git a/Meta/gn/secondary/Meta/Lagom/Tools/CodeGenerators/LibUnicode/BUILD.gn b/Meta/gn/secondary/Meta/Lagom/Tools/CodeGenerators/LibUnicode/BUILD.gn index 6812ba9565..acb2012ac7 100644 --- a/Meta/gn/secondary/Meta/Lagom/Tools/CodeGenerators/LibUnicode/BUILD.gn +++ b/Meta/gn/secondary/Meta/Lagom/Tools/CodeGenerators/LibUnicode/BUILD.gn @@ -9,3 +9,8 @@ lagom_tool("GenerateEmojiData") { sources = [ "GenerateEmojiData.cpp" ] deps = [ "//Userland/Libraries/LibMain" ] } + +lagom_tool("GenerateIDNAData") { + sources = [ "GenerateIDNAData.cpp" ] + deps = [ "//Userland/Libraries/LibMain" ] +} diff --git a/Meta/gn/secondary/Userland/Libraries/LibELF/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibELF/BUILD.gn new file mode 100644 index 0000000000..ba5621203e --- /dev/null +++ b/Meta/gn/secondary/Userland/Libraries/LibELF/BUILD.gn @@ -0,0 +1,22 @@ +shared_library("LibELF") { + output_name = "elf" + include_dirs = [ "//Userland/Libraries" ] + sources = [ + "AuxiliaryVector.h", + "Core.h", + "ELFABI.h", + "ELFBuild.cpp", + "ELFBuild.h", + "Hashes.h", + "Image.cpp", + "Image.h", + "Relocation.cpp", + "Relocation.h", + "Validation.cpp", + "Validation.h", + ] + deps = [ + "//AK", + "//Userland/Libraries/LibCore", + ] +} diff --git a/Meta/gn/secondary/Userland/Libraries/LibGfx/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibGfx/BUILD.gn index 8c6004fcdc..2667f9169f 100644 --- a/Meta/gn/secondary/Userland/Libraries/LibGfx/BUILD.gn +++ b/Meta/gn/secondary/Userland/Libraries/LibGfx/BUILD.gn @@ -53,6 +53,7 @@ shared_library("LibGfx") { "Font/Typeface.cpp", "Font/WOFF/Font.cpp", "Font/WOFF2/Font.cpp", + "FontCascadeList.cpp", "GradientPainting.cpp", "ICC/BinaryWriter.cpp", "ICC/Enums.cpp", diff --git a/Meta/gn/secondary/Userland/Libraries/LibJIT/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibJIT/BUILD.gn index de39ac9207..c8f0791ee4 100644 --- a/Meta/gn/secondary/Userland/Libraries/LibJIT/BUILD.gn +++ b/Meta/gn/secondary/Userland/Libraries/LibJIT/BUILD.gn @@ -4,9 +4,18 @@ shared_library("LibJIT") { sources = [ "Assembler.cpp", "Assembler.h", + "GDB.cpp", + "GDB.h", ] deps = [ "//AK", "//Userland/Libraries/LibCore", ] + + if (current_os == "mac") { + sources += [ "GDBUnsupported.cpp" ] + } else { + sources += [ "GDBElf.cpp" ] + deps += [ "//Userland/Libraries/LibELF" ] + } } diff --git a/Meta/gn/secondary/Userland/Libraries/LibUnicode/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibUnicode/BUILD.gn index c277beb1e4..32e818cd55 100644 --- a/Meta/gn/secondary/Userland/Libraries/LibUnicode/BUILD.gn +++ b/Meta/gn/secondary/Userland/Libraries/LibUnicode/BUILD.gn @@ -6,22 +6,33 @@ import("//Userland/Libraries/LibUnicode/enable_unicode_download.gni") unicode_cache = cache_path + "UCD/" emoji_cache = cache_path + "EMOJI/" +idna_cache = cache_path + "IDNA/" + +unicode_version = "15.1.0" +emoji_version = "15.1" if (enable_unicode_database_download) { download_file("unicode_database_download") { - version = "15.1.0" - url = "https://www.unicode.org/Public/" + version + "/ucd/UCD.zip" + version = unicode_version + url = "https://www.unicode.org/Public/$version/ucd/UCD.zip" cache = unicode_cache output = "UCD.zip" version_file = "version.txt" } download_file("emoji_test_download") { - version = "15.1" - url = "https://www.unicode.org/Public/emoji/" + version + "/emoji-test.txt" + version = emoji_version + url = "https://www.unicode.org/Public/emoji/$version/emoji-test.txt" cache = emoji_cache output = "emoji-test.txt" version_file = "emoji-test-version.txt" } + download_file("idna_mapping_table_download") { + version = unicode_version + url = "https://www.unicode.org/Public/idna/$version/IdnaMappingTable.txt" + cache = idna_cache + output = "IdnaMappingTable.txt" + version_file = "version.txt" + } extract_archive_contents("unicode_database_files") { deps = [ ":unicode_database_download" ] @@ -128,6 +139,24 @@ if (enable_unicode_database_download) { # "//Base/home/anon/Documents/emoji-serenity.txt" # and "//Base/res/emoji"? } + + compiled_action("generate_idna_sources") { + tool = "//Meta/Lagom/Tools/CodeGenerators/LibUnicode:GenerateIDNAData" + deps = [ ":idna_mapping_table_download" ] + inputs = get_target_outputs(":idna_mapping_table_download") + outputs = [ + "$target_gen_dir/IDNAData.h", + "$target_gen_dir/IDNAData.cpp", + ] + args = [ + "-h", + rebase_path(outputs[0], root_build_dir), + "-c", + rebase_path(outputs[1], root_build_dir), + "-m", + rebase_path(inputs[0], root_build_dir), + ] + } } source_set("LibUnicode") { @@ -140,9 +169,12 @@ source_set("LibUnicode") { "CharacterTypes.cpp", "CurrencyCode.cpp", "Emoji.cpp", + "IDNA.cpp", "Normalize.cpp", + "Punycode.cpp", "Segmentation.cpp", "String.cpp", + "URL.cpp", "UnicodeUtils.cpp", ] deps = [ @@ -152,10 +184,12 @@ source_set("LibUnicode") { if (enable_unicode_database_download) { deps += [ ":generate_emoji_sources", + ":generate_idna_sources", ":generate_unicode_sources", ] sources += get_target_outputs(":generate_unicode_sources") sources += get_target_outputs(":generate_emoji_sources") + sources += get_target_outputs(":generate_idna_sources") defines = [ "ENABLE_UNICODE_DATA=1" ] } else { defines = [ "ENABLE_UNICODE_DATA=0" ]