From 44a46d003808657f41445a27056284586033c35a Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 18 Sep 2024 09:11:19 -0700 Subject: [PATCH 1/9] gn: re-synchronise Userland libraries This updates the build rules for GN to bring the library list in sync partially by removing libraries which no longer exist in the tree. This is required to make forward progress on building with GN (with the hope of using this to build for Windows). --- Meta/gn/secondary/Ladybird/BUILD.gn | 4 - .../secondary/Ladybird/RequestServer/BUILD.gn | 1 - .../gn/secondary/Ladybird/WebContent/BUILD.gn | 1 - Meta/gn/secondary/Ladybird/WebWorker/BUILD.gn | 2 - .../Tools/CodeGenerators/LibLocale/BUILD.gn | 1 - .../Userland/Libraries/LibCore/BUILD.gn | 1 - .../Userland/Libraries/LibCrypt/BUILD.gn | 8 - .../Userland/Libraries/LibJS/BUILD.gn | 2 - .../Userland/Libraries/LibLocale/BUILD.gn | 191 ------------------ .../Userland/Libraries/LibProtocol/BUILD.gn | 46 ----- .../Userland/Libraries/LibTimeZone/BUILD.gn | 84 -------- .../Userland/Libraries/LibVideo/BUILD.gn | 27 --- .../Userland/Libraries/LibWeb/BUILD.gn | 2 - .../Userland/Libraries/LibWebView/BUILD.gn | 1 - 14 files changed, 371 deletions(-) delete mode 100644 Meta/gn/secondary/Userland/Libraries/LibCrypt/BUILD.gn delete mode 100644 Meta/gn/secondary/Userland/Libraries/LibLocale/BUILD.gn delete mode 100644 Meta/gn/secondary/Userland/Libraries/LibProtocol/BUILD.gn delete mode 100644 Meta/gn/secondary/Userland/Libraries/LibTimeZone/BUILD.gn delete mode 100644 Meta/gn/secondary/Userland/Libraries/LibVideo/BUILD.gn diff --git a/Meta/gn/secondary/Ladybird/BUILD.gn b/Meta/gn/secondary/Ladybird/BUILD.gn index bdf955051c97..bd915751b359 100644 --- a/Meta/gn/secondary/Ladybird/BUILD.gn +++ b/Meta/gn/secondary/Ladybird/BUILD.gn @@ -69,7 +69,6 @@ executable("ladybird_executable") { "//Userland/Libraries/LibImageDecoderClient", "//Userland/Libraries/LibJS", "//Userland/Libraries/LibMain", - "//Userland/Libraries/LibProtocol", "//Userland/Libraries/LibURL", "//Userland/Libraries/LibWeb", "//Userland/Libraries/LibWebView", @@ -185,7 +184,6 @@ executable("headless-browser") { "//Userland/Libraries/LibImageDecoderClient", "//Userland/Libraries/LibJS", "//Userland/Libraries/LibMain", - "//Userland/Libraries/LibProtocol", "//Userland/Libraries/LibTLS", "//Userland/Libraries/LibURL", "//Userland/Libraries/LibWeb", @@ -397,7 +395,6 @@ if (current_os != "mac") { "//Userland/Libraries/LibJS", "//Userland/Libraries/LibLine", "//Userland/Libraries/LibMedia", - "//Userland/Libraries/LibProtocol", "//Userland/Libraries/LibRIFF", "//Userland/Libraries/LibRegex", "//Userland/Libraries/LibSyntax", @@ -405,7 +402,6 @@ if (current_os != "mac") { "//Userland/Libraries/LibTextCodec", "//Userland/Libraries/LibThreading", "//Userland/Libraries/LibURL", - "//Userland/Libraries/LibVideo", "//Userland/Libraries/LibWasm", "//Userland/Libraries/LibWeb", "//Userland/Libraries/LibWebSocket", diff --git a/Meta/gn/secondary/Ladybird/RequestServer/BUILD.gn b/Meta/gn/secondary/Ladybird/RequestServer/BUILD.gn index 54f634ab2839..abdee14ed9c4 100644 --- a/Meta/gn/secondary/Ladybird/RequestServer/BUILD.gn +++ b/Meta/gn/secondary/Ladybird/RequestServer/BUILD.gn @@ -12,7 +12,6 @@ executable("RequestServer") { "//Userland/Libraries/LibHTTP", "//Userland/Libraries/LibIPC", "//Userland/Libraries/LibMain", - "//Userland/Libraries/LibProtocol", "//Userland/Libraries/LibTLS", "//Userland/Libraries/LibThreading", "//Userland/Libraries/LibURL", diff --git a/Meta/gn/secondary/Ladybird/WebContent/BUILD.gn b/Meta/gn/secondary/Ladybird/WebContent/BUILD.gn index 4e7f02f57c6c..f0b1c48d9c33 100644 --- a/Meta/gn/secondary/Ladybird/WebContent/BUILD.gn +++ b/Meta/gn/secondary/Ladybird/WebContent/BUILD.gn @@ -46,7 +46,6 @@ executable("WebContent") { "//Userland/Libraries/LibImageDecoderClient", "//Userland/Libraries/LibJS", "//Userland/Libraries/LibMain", - "//Userland/Libraries/LibProtocol", "//Userland/Libraries/LibURL", "//Userland/Libraries/LibWeb", "//Userland/Libraries/LibWebSocket", diff --git a/Meta/gn/secondary/Ladybird/WebWorker/BUILD.gn b/Meta/gn/secondary/Ladybird/WebWorker/BUILD.gn index ec6bec47e6f3..ab240c4db781 100644 --- a/Meta/gn/secondary/Ladybird/WebWorker/BUILD.gn +++ b/Meta/gn/secondary/Ladybird/WebWorker/BUILD.gn @@ -12,9 +12,7 @@ executable("WebWorker") { "//Userland/Libraries/LibIPC", "//Userland/Libraries/LibImageDecoderClient", "//Userland/Libraries/LibJS", - "//Userland/Libraries/LibLocale", "//Userland/Libraries/LibMain", - "//Userland/Libraries/LibProtocol", "//Userland/Libraries/LibURL", "//Userland/Libraries/LibWeb", "//Userland/Libraries/LibWeb:WebWorkerClientEndpoint", diff --git a/Meta/gn/secondary/Meta/Lagom/Tools/CodeGenerators/LibLocale/BUILD.gn b/Meta/gn/secondary/Meta/Lagom/Tools/CodeGenerators/LibLocale/BUILD.gn index 86920251d1d1..2cf45e81fc9d 100644 --- a/Meta/gn/secondary/Meta/Lagom/Tools/CodeGenerators/LibLocale/BUILD.gn +++ b/Meta/gn/secondary/Meta/Lagom/Tools/CodeGenerators/LibLocale/BUILD.gn @@ -4,7 +4,6 @@ lagom_tool("GenerateDateTimeFormatData") { sources = [ "GenerateDateTimeFormatData.cpp" ] deps = [ "//Userland/Libraries/LibMain", - "//Userland/Libraries/LibTimeZone", ] } diff --git a/Meta/gn/secondary/Userland/Libraries/LibCore/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibCore/BUILD.gn index f6c713a1fac0..4a0004793d49 100644 --- a/Meta/gn/secondary/Userland/Libraries/LibCore/BUILD.gn +++ b/Meta/gn/secondary/Userland/Libraries/LibCore/BUILD.gn @@ -167,7 +167,6 @@ shared_library("LibCore") { ":sources", "//Meta/gn/build/libs/crypt", "//Meta/gn/build/libs/pthread", - "//Userland/Libraries/LibTimeZone", "//Userland/Libraries/LibURL", ] diff --git a/Meta/gn/secondary/Userland/Libraries/LibCrypt/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibCrypt/BUILD.gn deleted file mode 100644 index 6f92a1d3e98c..000000000000 --- a/Meta/gn/secondary/Userland/Libraries/LibCrypt/BUILD.gn +++ /dev/null @@ -1,8 +0,0 @@ -group("LibCrypt") { - deps = [] - libs = [] - - if (current_os == "linux") { - libs += [ "crypt" ] - } -} diff --git a/Meta/gn/secondary/Userland/Libraries/LibJS/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibJS/BUILD.gn index 065b81b786f4..17d178c943fa 100644 --- a/Meta/gn/secondary/Userland/Libraries/LibJS/BUILD.gn +++ b/Meta/gn/secondary/Userland/Libraries/LibJS/BUILD.gn @@ -12,10 +12,8 @@ shared_library("LibJS") { "//Userland/Libraries/LibCore", "//Userland/Libraries/LibCrypto", "//Userland/Libraries/LibFileSystem", - "//Userland/Libraries/LibLocale", "//Userland/Libraries/LibRegex", "//Userland/Libraries/LibSyntax", - "//Userland/Libraries/LibTimeZone", "//Userland/Libraries/LibUnicode", ] diff --git a/Meta/gn/secondary/Userland/Libraries/LibLocale/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibLocale/BUILD.gn deleted file mode 100644 index 4db59e566810..000000000000 --- a/Meta/gn/secondary/Userland/Libraries/LibLocale/BUILD.gn +++ /dev/null @@ -1,191 +0,0 @@ -import("//Meta/gn/build/compiled_action.gni") -import("//Meta/gn/build/download_cache.gni") -import("//Meta/gn/build/download_file.gni") -import("//Meta/gn/build/extract_archive_contents.gni") -import("//Userland/Libraries/LibUnicode/enable_unicode_download.gni") - -locale_cache = cache_path + "CLDR/" - -locale_version = "45.0.0" - -if (enable_unicode_database_download) { - download_file("locale_database_download") { - version = locale_version - url = "https://github.com/unicode-org/cldr-json/releases/download/$version/cldr-$version-json-modern.zip" - cache = locale_cache - output = "cldr.zip" - version_file = "version.txt" - sha256 = "ba934cdd40ad4fb6439004c7e746bef97fe2b597db1040fcaa6c7d0647742c1b" - } - - extract_archive_contents("locale_database_files") { - deps = [ ":locale_database_download" ] - archive = get_target_outputs(":locale_database_download") - directory = locale_cache - paths = [ - "cldr-bcp47", - "cldr-core", - "cldr-dates-modern", - "cldr-localenames-modern", - "cldr-misc-modern", - "cldr-numbers-modern", - "cldr-units-modern", - ] - } - - compiled_action("generate_datetime_format_sources") { - tool = - "//Meta/Lagom/Tools/CodeGenerators/LibLocale:GenerateDateTimeFormatData" - deps = [ ":locale_database_files" ] - outputs = [ - "$target_gen_dir/DateTimeFormatData.h", - "$target_gen_dir/DateTimeFormatData.cpp", - ] - args = [ - "-h", - rebase_path(outputs[0], root_build_dir), - "-c", - rebase_path(outputs[1], root_build_dir), - "-r", - rebase_path(locale_cache + "cldr-core", root_build_dir), - "-d", - rebase_path(locale_cache + "cldr-dates-modern", root_build_dir), - ] - } - - compiled_action("generate_locale_sources") { - tool = "//Meta/Lagom/Tools/CodeGenerators/LibLocale:GenerateLocaleData" - deps = [ ":locale_database_files" ] - outputs = [ - "$target_gen_dir/LocaleData.h", - "$target_gen_dir/LocaleData.cpp", - ] - args = [ - "-h", - rebase_path(outputs[0], root_build_dir), - "-c", - rebase_path(outputs[1], root_build_dir), - "-b", - rebase_path(locale_cache + "cldr-bcp47", root_build_dir), - "-r", - rebase_path(locale_cache + "cldr-core", root_build_dir), - "-l", - rebase_path(locale_cache + "cldr-localenames-modern", root_build_dir), - "-m", - rebase_path(locale_cache + "cldr-misc-modern", root_build_dir), - "-n", - rebase_path(locale_cache + "cldr-numbers-modern", root_build_dir), - "-d", - rebase_path(locale_cache + "cldr-dates-modern", root_build_dir), - ] - } - - compiled_action("generate_number_format_sources") { - tool = - "//Meta/Lagom/Tools/CodeGenerators/LibLocale:GenerateNumberFormatData" - deps = [ ":locale_database_files" ] - outputs = [ - "$target_gen_dir/NumberFormatData.h", - "$target_gen_dir/NumberFormatData.cpp", - ] - args = [ - "-h", - rebase_path(outputs[0], root_build_dir), - "-c", - rebase_path(outputs[1], root_build_dir), - "-r", - rebase_path(locale_cache + "cldr-core", root_build_dir), - "-n", - rebase_path(locale_cache + "cldr-numbers-modern", root_build_dir), - "-u", - rebase_path(locale_cache + "cldr-units-modern", root_build_dir), - ] - } - - compiled_action("generate_plural_rules_sources") { - tool = "//Meta/Lagom/Tools/CodeGenerators/LibLocale:GeneratePluralRulesData" - deps = [ ":locale_database_files" ] - outputs = [ - "$target_gen_dir/PluralRulesData.h", - "$target_gen_dir/PluralRulesData.cpp", - ] - args = [ - "-h", - rebase_path(outputs[0], root_build_dir), - "-c", - rebase_path(outputs[1], root_build_dir), - "-r", - rebase_path(locale_cache + "cldr-core", root_build_dir), - "-l", - rebase_path(locale_cache + "cldr-localenames-modern", root_build_dir), - ] - } - - compiled_action("generate_relative_time_format_sources") { - tool = "//Meta/Lagom/Tools/CodeGenerators/LibLocale:GenerateRelativeTimeFormatData" - deps = [ ":locale_database_files" ] - outputs = [ - "$target_gen_dir/RelativeTimeFormatData.h", - "$target_gen_dir/RelativeTimeFormatData.cpp", - ] - args = [ - "-h", - rebase_path(outputs[0], root_build_dir), - "-c", - rebase_path(outputs[1], root_build_dir), - "-d", - rebase_path(locale_cache + "cldr-dates-modern", root_build_dir), - ] - } - - source_set("locale_data_sources") { - include_dirs = [ - "//Userland/Libraries", - "$target_gen_dir/..", - ] - cflags_cc = [ - "-g0", - "-Os", - "-Wno-parentheses-equality", - ] - deps = [ - ":generate_datetime_format_sources", - ":generate_locale_sources", - ":generate_number_format_sources", - ":generate_plural_rules_sources", - ":generate_relative_time_format_sources", - "//AK", - ] - public_deps = [ "//Userland/Libraries/LibTimeZone" ] - sources = get_target_outputs(":generate_datetime_format_sources") - sources += get_target_outputs(":generate_locale_sources") - sources += get_target_outputs(":generate_number_format_sources") - sources += get_target_outputs(":generate_plural_rules_sources") - sources += get_target_outputs(":generate_relative_time_format_sources") - } -} - -source_set("LibLocale") { - output_name = "locale" - include_dirs = [ - "//Userland/Libraries", - "$target_gen_dir/..", - ] - sources = [ - "DateTimeFormat.cpp", - "Locale.cpp", - "NumberFormat.cpp", - "PluralRules.cpp", - "RelativeTimeFormat.cpp", - ] - deps = [ - "//AK", - "//Userland/Libraries/LibUnicode", - ] - if (enable_unicode_database_download) { - deps += [ ":locale_data_sources" ] - defines = [ "ENABLE_UNICODE_DATA=1" ] - } else { - defines = [ "ENABLE_UNICODE_DATA=0" ] - } -} diff --git a/Meta/gn/secondary/Userland/Libraries/LibProtocol/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibProtocol/BUILD.gn deleted file mode 100644 index a97e61c5a6f1..000000000000 --- a/Meta/gn/secondary/Userland/Libraries/LibProtocol/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -import("//Meta/gn/build/compiled_action.gni") - -compiled_action("RequestClientEndpoint") { - tool = "//Meta/Lagom/Tools/CodeGenerators/IPCCompiler" - inputs = [ "//Userland/Services/RequestServer/RequestClient.ipc" ] - outputs = [ "$root_gen_dir/RequestServer/RequestClientEndpoint.h" ] - args = [ - rebase_path(inputs[0], root_build_dir), - "-o", - rebase_path(outputs[0], root_build_dir), - ] -} - -compiled_action("RequestServerEndpoint") { - tool = "//Meta/Lagom/Tools/CodeGenerators/IPCCompiler" - inputs = [ "//Userland/Services/RequestServer/RequestServer.ipc" ] - outputs = [ "$root_gen_dir/RequestServer/RequestServerEndpoint.h" ] - args = [ - rebase_path(inputs[0], root_build_dir), - "-o", - rebase_path(outputs[0], root_build_dir), - ] -} - -shared_library("LibProtocol") { - output_name = "protocol" - include_dirs = [ - "//Userland/Libraries", - "//Userland/Services", - ] - deps = [ - ":RequestClientEndpoint", - ":RequestServerEndpoint", - "//AK", - "//Userland/Libraries/LibCore", - "//Userland/Libraries/LibIPC", - "//Userland/Libraries/LibURL", - ] - sources = [ - "Request.cpp", - "RequestClient.cpp", - "WebSocket.cpp", - ] - sources += get_target_outputs(":RequestClientEndpoint") + - get_target_outputs(":RequestServerEndpoint") -} diff --git a/Meta/gn/secondary/Userland/Libraries/LibTimeZone/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibTimeZone/BUILD.gn deleted file mode 100644 index 3c7c60d97bdf..000000000000 --- a/Meta/gn/secondary/Userland/Libraries/LibTimeZone/BUILD.gn +++ /dev/null @@ -1,84 +0,0 @@ -import("//Meta/gn/build/compiled_action.gni") -import("//Meta/gn/build/download_cache.gni") -import("//Meta/gn/build/download_file.gni") -import("//Meta/gn/build/extract_archive_contents.gni") - -declare_args() { - # If true, Download tzdata from data.iana.org and use it in LibTimeZone - # Data will be downloaded to $cache_path/TZDB - enable_timezone_database_download = true -} - -tzdb_cache = cache_path + "TZDB/" - -tzdb_version = "2024a" - -if (enable_timezone_database_download) { - download_file("timezone_database_download") { - version = tzdb_version - url = "https://data.iana.org/time-zones/releases/tzdata$version.tar.gz" - cache = tzdb_cache - output = "tzdb.tar.gz" - version_file = "version.txt" - sha256 = "0d0434459acbd2059a7a8da1f3304a84a86591f6ed69c6248fffa502b6edffe3" - } - extract_archive_contents("timezone_database_files") { - deps = [ ":timezone_database_download" ] - archive = get_target_outputs(":timezone_database_download") - directory = tzdb_cache - - # NOSORT - files = [ - "zone1970.tab", - "africa", - "antarctica", - "asia", - "australasia", - "backward", - "etcetera", - "europe", - "northamerica", - "southamerica", - ] - } - compiled_action("generate_timezone_sources") { - tool = "//Meta/Lagom/Tools/CodeGenerators/LibTimeZone:GenerateTimeZoneData" - deps = [ ":timezone_database_files" ] - inputs = get_target_outputs(":timezone_database_files") - outputs = [ - "$target_gen_dir/TimeZoneData.h", - "$target_gen_dir/TimeZoneData.cpp", - ] - args = [ - "-h", - rebase_path(outputs[0], root_build_dir), - "-c", - rebase_path(outputs[1], root_build_dir), - "-z", - - # NOTE: Coordinates file must be inputs[0] - ] - foreach(data_file, inputs) { - args += [ rebase_path(data_file, root_build_dir) ] - } - } -} - -source_set("LibTimeZone") { - output_name = "timezone" - include_dirs = [ - "//Userland/Libraries", - "$target_gen_dir/..", - ] - sources = [ - "Forward.h", - "TimeZone.cpp", - "TimeZone.h", - ] - deps = [ "//AK" ] - - if (enable_timezone_database_download) { - deps += [ ":generate_timezone_sources" ] - sources += get_target_outputs(":generate_timezone_sources") - } -} diff --git a/Meta/gn/secondary/Userland/Libraries/LibVideo/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibVideo/BUILD.gn deleted file mode 100644 index 6b458a07d7c6..000000000000 --- a/Meta/gn/secondary/Userland/Libraries/LibVideo/BUILD.gn +++ /dev/null @@ -1,27 +0,0 @@ -shared_library("LibVideo") { - output_name = "video" - include_dirs = [ "//Userland/Libraries" ] - - deps = [ - "//AK", - "//Userland/Libraries/LibCore", - "//Userland/Libraries/LibGfx", - "//Userland/Libraries/LibIPC", - "//Userland/Libraries/LibMedia", - "//Userland/Libraries/LibThreading", - ] - sources = [ - "Color/ColorConverter.cpp", - "Color/ColorPrimaries.cpp", - "Color/TransferCharacteristics.cpp", - "Containers/Matroska/MatroskaDemuxer.cpp", - "Containers/Matroska/Reader.cpp", - "PlaybackManager.cpp", - "VP9/Decoder.cpp", - "VP9/Parser.cpp", - "VP9/ProbabilityTables.cpp", - "VP9/SyntaxElementCounter.cpp", - "VP9/TreeParser.cpp", - "VideoFrame.cpp", - ] -} diff --git a/Meta/gn/secondary/Userland/Libraries/LibWeb/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibWeb/BUILD.gn index 3682db1b6684..decbfa3050d6 100644 --- a/Meta/gn/secondary/Userland/Libraries/LibWeb/BUILD.gn +++ b/Meta/gn/secondary/Userland/Libraries/LibWeb/BUILD.gn @@ -351,7 +351,6 @@ shared_library("LibWeb") { "//Userland/Libraries/LibIDL", "//Userland/Libraries/LibIPC", "//Userland/Libraries/LibJS", - "//Userland/Libraries/LibLocale", "//Userland/Libraries/LibMedia", "//Userland/Libraries/LibRegex", "//Userland/Libraries/LibSyntax", @@ -359,7 +358,6 @@ shared_library("LibWeb") { "//Userland/Libraries/LibTextCodec", "//Userland/Libraries/LibURL", "//Userland/Libraries/LibUnicode", - "//Userland/Libraries/LibVideo", "//Userland/Libraries/LibWasm", "//Userland/Libraries/LibXML", ] + idl_sources_targets diff --git a/Meta/gn/secondary/Userland/Libraries/LibWebView/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibWebView/BUILD.gn index 250a03d13802..a72ff4ddd270 100644 --- a/Meta/gn/secondary/Userland/Libraries/LibWebView/BUILD.gn +++ b/Meta/gn/secondary/Userland/Libraries/LibWebView/BUILD.gn @@ -135,7 +135,6 @@ shared_library("LibWebView") { "//Userland/Libraries/LibGfx", "//Userland/Libraries/LibIPC", "//Userland/Libraries/LibJS", - "//Userland/Libraries/LibProtocol", "//Userland/Libraries/LibURL", "//Userland/Libraries/LibWeb", ] From 71a563fc851a622257c77a908ba884dc201921fc Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 18 Sep 2024 09:30:51 -0700 Subject: [PATCH 2/9] gn: remove emoji file list processing This file seems to be removed from the source tree. Remove the associated data processing for the build. --- Meta/gn/secondary/Ladybird/BUILD.gn | 18 ----------- .../Userland/Libraries/LibUnicode/BUILD.gn | 32 ------------------- 2 files changed, 50 deletions(-) diff --git a/Meta/gn/secondary/Ladybird/BUILD.gn b/Meta/gn/secondary/Ladybird/BUILD.gn index bd915751b359..b777b90462a7 100644 --- a/Meta/gn/secondary/Ladybird/BUILD.gn +++ b/Meta/gn/secondary/Ladybird/BUILD.gn @@ -155,7 +155,6 @@ executable("ladybird_executable") { data_deps += [ ":ladybird_copy_cacert", ":ladybird_copy_config_resources", - ":ladybird_copy_emoji", ":ladybird_copy_fonts", ":ladybird_copy_icons_16x16", ":ladybird_copy_icons_32x32", @@ -198,13 +197,6 @@ 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/SerenitySans-Regular.ttf" ] icons_16x16 = [ @@ -287,11 +279,6 @@ 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}}" ] @@ -442,11 +429,6 @@ 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}}" ] diff --git a/Meta/gn/secondary/Userland/Libraries/LibUnicode/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibUnicode/BUILD.gn index 0592b8ee0ca6..321d10ee57d2 100644 --- a/Meta/gn/secondary/Userland/Libraries/LibUnicode/BUILD.gn +++ b/Meta/gn/secondary/Userland/Libraries/LibUnicode/BUILD.gn @@ -116,36 +116,6 @@ if (enable_unicode_database_download) { ] } - compiled_action("generate_emoji_sources") { - tool = "//Meta/Lagom/Tools/CodeGenerators/LibUnicode:GenerateEmojiData" - deps = [ ":emoji_test_download" ] - inputs = get_target_outputs(":emoji_test_download") - outputs = [ - "$target_gen_dir/EmojiData.h", - "$target_gen_dir/EmojiData.cpp", - ] - args = [ - "-h", - rebase_path(outputs[0], root_build_dir), - "-c", - rebase_path(outputs[1], root_build_dir), - "-e", - rebase_path(inputs[0], root_build_dir), - "-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: - # "//Base/home/anon/Documents/emoji-serenity.txt" - # "//Base/res/emoji" - # "//Meta/emoji-file-list.txt" - } - compiled_action("generate_idna_sources") { tool = "//Meta/Lagom/Tools/CodeGenerators/LibUnicode:GenerateIDNAData" deps = [ ":idna_mapping_table_download" ] @@ -186,12 +156,10 @@ 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 { From f835f04d5467868a943b219f028172426699250c Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 18 Sep 2024 09:35:35 -0700 Subject: [PATCH 3/9] gn: remove duplicated source file input (NFC) --- Meta/gn/secondary/Userland/Libraries/LibGfx/BUILD.gn | 1 - 1 file changed, 1 deletion(-) diff --git a/Meta/gn/secondary/Userland/Libraries/LibGfx/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibGfx/BUILD.gn index 57ea6d761215..8184b5a03e31 100644 --- a/Meta/gn/secondary/Userland/Libraries/LibGfx/BUILD.gn +++ b/Meta/gn/secondary/Userland/Libraries/LibGfx/BUILD.gn @@ -47,7 +47,6 @@ shared_library("LibGfx") { "Font/OpenType/Tables.cpp", "Font/ScaledFont.cpp", "Font/Typeface.cpp", - "Font/Typeface.cpp", "Font/WOFF/Font.cpp", "Font/WOFF2/Font.cpp", "FontCascadeList.cpp", From 7b9658c126c101173b73be61050e3ce729bda3fb Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 18 Sep 2024 09:42:11 -0700 Subject: [PATCH 4/9] gn: remove LibThreading tests from tests This library is not built with GN yet, so remove the reference. --- Meta/gn/secondary/Tests/BUILD.gn | 1 - 1 file changed, 1 deletion(-) diff --git a/Meta/gn/secondary/Tests/BUILD.gn b/Meta/gn/secondary/Tests/BUILD.gn index 71b30a7e7cd9..e28f7cd26cac 100644 --- a/Meta/gn/secondary/Tests/BUILD.gn +++ b/Meta/gn/secondary/Tests/BUILD.gn @@ -2,7 +2,6 @@ group("Tests") { deps = [ "//Tests/AK", "//Tests/LibJS", - "//Tests/LibThreading", "//Tests/LibURL", "//Tests/LibWeb", ] From 6354c36cc8356842ac8892a65cc6c8ebd4b67f1f Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 18 Sep 2024 09:54:50 -0700 Subject: [PATCH 5/9] gn: remove generator tools for Unicode data These are no longer in the tree, remove the references to them and the use of them. --- .../Tools/CodeGenerators/LibUnicode/BUILD.gn | 10 --- .../Userland/Libraries/LibUnicode/BUILD.gn | 77 ------------------- 2 files changed, 87 deletions(-) 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 acb2012ac7fb..1c2013db93b5 100644 --- a/Meta/gn/secondary/Meta/Lagom/Tools/CodeGenerators/LibUnicode/BUILD.gn +++ b/Meta/gn/secondary/Meta/Lagom/Tools/CodeGenerators/LibUnicode/BUILD.gn @@ -1,16 +1,6 @@ import("//Meta/Lagom/Tools/lagom_tool.gni") -lagom_tool("GenerateUnicodeData") { - sources = [ "GenerateUnicodeData.cpp" ] - deps = [ "//Userland/Libraries/LibMain" ] -} - 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/LibUnicode/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibUnicode/BUILD.gn index 321d10ee57d2..f7691b7e108d 100644 --- a/Meta/gn/secondary/Userland/Libraries/LibUnicode/BUILD.gn +++ b/Meta/gn/secondary/Userland/Libraries/LibUnicode/BUILD.gn @@ -62,77 +62,6 @@ if (enable_unicode_database_download) { "auxiliary/SentenceBreakProperty.txt", ] } - - compiled_action("generate_unicode_sources") { - tool = "//Meta/Lagom/Tools/CodeGenerators/LibUnicode:GenerateUnicodeData" - deps = [ ":unicode_database_files" ] - inputs = get_target_outputs(":unicode_database_files") - outputs = [ - "$target_gen_dir/UnicodeData.h", - "$target_gen_dir/UnicodeData.cpp", - ] - - args = [ - "-h", - rebase_path(outputs[0], root_build_dir), - "-c", - rebase_path(outputs[1], root_build_dir), - "-u", - rebase_path(inputs[0], root_build_dir), - "-s", - rebase_path(inputs[1], root_build_dir), - "-o", - rebase_path(inputs[2], root_build_dir), - "-g", - rebase_path(inputs[3], root_build_dir), - "-p", - rebase_path(inputs[4], root_build_dir), - "-d", - rebase_path(inputs[5], root_build_dir), - "-b", - rebase_path(inputs[6], root_build_dir), - "-a", - rebase_path(inputs[7], root_build_dir), - "-v", - rebase_path(inputs[8], root_build_dir), - "-r", - rebase_path(inputs[9], root_build_dir), - "-x", - rebase_path(inputs[10], root_build_dir), - "-k", - rebase_path(inputs[11], root_build_dir), - "-e", - rebase_path(inputs[12], root_build_dir), - "-m", - rebase_path(inputs[13], root_build_dir), - "-n", - rebase_path(inputs[14], root_build_dir), - "-f", - rebase_path(inputs[15], root_build_dir), - "-w", - rebase_path(inputs[16], root_build_dir), - "-i", - rebase_path(inputs[17], root_build_dir), - ] - } - - 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") { @@ -155,12 +84,6 @@ source_set("LibUnicode") { deps = [ "//AK" ] if (enable_unicode_database_download) { - deps += [ - ":generate_idna_sources", - ":generate_unicode_sources", - ] - sources += get_target_outputs(":generate_unicode_sources") - sources += get_target_outputs(":generate_idna_sources") defines = [ "ENABLE_UNICODE_DATA=1" ] } else { defines = [ "ENABLE_UNICODE_DATA=0" ] From a0bf8049f09a191cb96c55b74198af7f271d05c2 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 18 Sep 2024 10:46:00 -0700 Subject: [PATCH 6/9] gn: partially synchronise library source sets These libraries referenced files which no longer are present in the source tree preventing an initial run of ninja to identify commands. Update them to match the current tree layout. With this, we can get `ninja -C Build\ladybird` to start. --- .../Userland/Libraries/LibGfx/BUILD.gn | 30 ++++++++----------- .../Userland/Libraries/LibUnicode/BUILD.gn | 15 +++++++--- .../Userland/Libraries/LibWeb/Infra/BUILD.gn | 1 - 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Meta/gn/secondary/Userland/Libraries/LibGfx/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibGfx/BUILD.gn index 8184b5a03e31..8528a23d3132 100644 --- a/Meta/gn/secondary/Userland/Libraries/LibGfx/BUILD.gn +++ b/Meta/gn/secondary/Userland/Libraries/LibGfx/BUILD.gn @@ -33,29 +33,21 @@ shared_library("LibGfx") { "DeprecatedPainter.cpp", "DeprecatedPath.cpp", "EdgeFlagPathRasterizer.cpp", - "Filters/ColorBlindnessFilter.cpp", - "Filters/FastBoxBlurFilter.cpp", - "Filters/LumaFilter.cpp", - "Filters/StackBlurFilter.cpp", - "Font/Emoji.cpp", "Font/Font.cpp", + "Font/FontData.cpp", "Font/FontDatabase.cpp", - "Font/OpenType/Cmap.cpp", - "Font/OpenType/Font.cpp", - "Font/OpenType/Glyf.cpp", - "Font/OpenType/Hinting/Opcodes.cpp", - "Font/OpenType/Tables.cpp", "Font/ScaledFont.cpp", + "Font/ScaledFontSkia.cpp", "Font/Typeface.cpp", - "Font/WOFF/Font.cpp", - "Font/WOFF2/Font.cpp", + "Font/WOFF/Loader.cpp", + "Font/WOFF2/Loader.cpp", "FontCascadeList.cpp", "GradientPainting.cpp", "ICC/BinaryWriter.cpp", "ICC/Enums.cpp", "ICC/Profile.cpp", - "ICC/TagTypes.cpp", "ICC/Tags.cpp", + "ICC/TagTypes.cpp", "ICC/WellKnownProfiles.cpp", "ImageFormats/AnimationWriter.cpp", "ImageFormats/BMPLoader.cpp", @@ -63,30 +55,32 @@ shared_library("LibGfx") { "ImageFormats/BooleanDecoder.cpp", "ImageFormats/CCITTDecoder.cpp", "ImageFormats/GIFLoader.cpp", + "ImageFormats/GIFWriter.cpp", "ImageFormats/ICOLoader.cpp", "ImageFormats/ImageDecoder.cpp", "ImageFormats/JPEGLoader.cpp", - "ImageFormats/JPEGWriter.cpp", "ImageFormats/JPEGXLLoader.cpp", + "ImageFormats/JPEGWriter.cpp", "ImageFormats/PNGLoader.cpp", "ImageFormats/PNGWriter.cpp", "ImageFormats/TIFFLoader.cpp", "ImageFormats/TinyVGLoader.cpp", "ImageFormats/WebPLoader.cpp", - "ImageFormats/WebPLoaderLossless.cpp", - "ImageFormats/WebPLoaderLossy.cpp", "ImageFormats/WebPSharedLossless.cpp", "ImageFormats/WebPWriter.cpp", "ImageFormats/WebPWriterLossless.cpp", + "ImageFormats/AVIFLoader.cpp", "ImmutableBitmap.cpp", + "MedianCut.cpp", "Palette.cpp", - "PathClipper.cpp", + "Path.cpp", + "PathSkia.cpp", + "Painter.cpp", "Point.cpp", "Rect.cpp", "ShareableBitmap.cpp", "Size.cpp", "SystemTheme.cpp", - "TextDirection.cpp", "TextLayout.cpp", "Triangle.cpp", "VectorGraphic.cpp", diff --git a/Meta/gn/secondary/Userland/Libraries/LibUnicode/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibUnicode/BUILD.gn index f7691b7e108d..57018ba8bd93 100644 --- a/Meta/gn/secondary/Userland/Libraries/LibUnicode/BUILD.gn +++ b/Meta/gn/secondary/Userland/Libraries/LibUnicode/BUILD.gn @@ -72,14 +72,21 @@ source_set("LibUnicode") { ] sources = [ "CharacterTypes.cpp", + "Collator.cpp", "CurrencyCode.cpp", - "Emoji.cpp", + "DateTimeFormat.cpp", + "DisplayNames.cpp", + "DurationFormat.cpp", + "ICU.cpp", "IDNA.cpp", "Normalize.cpp", - "Punycode.cpp", - "Segmentation.cpp", + "NumberFormat.cpp", + "PluralRules.cpp", + "RelativeTimeFormat.cpp", + "Segmenter.cpp", "String.cpp", - "UnicodeUtils.cpp", + "TimeZone.cpp", + "UnicodeKeywords.cpp", ] deps = [ "//AK" ] diff --git a/Meta/gn/secondary/Userland/Libraries/LibWeb/Infra/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibWeb/Infra/BUILD.gn index 5acdfaa9a5d2..11537bcb6871 100644 --- a/Meta/gn/secondary/Userland/Libraries/LibWeb/Infra/BUILD.gn +++ b/Meta/gn/secondary/Userland/Libraries/LibWeb/Infra/BUILD.gn @@ -2,7 +2,6 @@ source_set("Infra") { configs += [ "//Userland/Libraries/LibWeb:configs" ] deps = [ "//Userland/Libraries/LibWeb:all_generated" ] sources = [ - "Base64.cpp", "ByteSequences.cpp", "JSON.cpp", "Strings.cpp", From bbe9b041cc916bdb5b64b4115cb5727f46b0d807 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 18 Sep 2024 10:50:31 -0700 Subject: [PATCH 7/9] gn: update environment variables for `ak_debug_gen` This updates the environment variables that are passed along to the tool to run this build command. --- Meta/gn/secondary/AK/BUILD.gn | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Meta/gn/secondary/AK/BUILD.gn b/Meta/gn/secondary/AK/BUILD.gn index 35eea6f7437f..15d25f4f4f18 100644 --- a/Meta/gn/secondary/AK/BUILD.gn +++ b/Meta/gn/secondary/AK/BUILD.gn @@ -243,6 +243,7 @@ write_cmake_config("ak_debug_gen") { "LEXER_DEBUG=", "LIBWEB_CSS_ANIMATION_DEBUG=", "LIBWEB_CSS_DEBUG=", + "LIBWEB_WASM_DEBUG=", "LINE_EDITOR_DEBUG=", "LZMA_DEBUG=", "LZW_DEBUG=", @@ -263,6 +264,7 @@ write_cmake_config("ak_debug_gen") { "RSA_PARSE_DEBUG=", "SHARED_QUEUE_DEBUG=", "SPAM_DEBUG=", + "STYLE_INVALIDATION_DEBUG=", "SYNTAX_HIGHLIGHTING_DEBUG=", "TEXTEDITOR_DEBUG=", "TIFF_DEBUG=", @@ -280,6 +282,7 @@ write_cmake_config("ak_debug_gen") { "WEBDRIVER_DEBUG=", "WEBDRIVER_ROUTE_DEBUG=", "WEBGL_CONTEXT_DEBUG=", + "WEBVIEW_PROCESS_DEBUG=", "WEB_FETCH_DEBUG=", "WEB_WORKER_DEBUG=", "WEBP_DEBUG=", From 9d7886609eddd7e6ce4aa973e03ec20e737bbee5 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 18 Sep 2024 10:56:08 -0700 Subject: [PATCH 8/9] gn: add an option for building against AppKit The build assumed QT or AppKit are the only build UI frameworks. This extends the default assumption away from that to start experimenting with building on other platforms. --- Meta/gn/secondary/Ladybird/BUILD.gn | 3 ++- Meta/gn/secondary/Ladybird/enable_appkit.gni | 5 +++++ Meta/gn/secondary/Ladybird/enable_qt.gni | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 Meta/gn/secondary/Ladybird/enable_appkit.gni diff --git a/Meta/gn/secondary/Ladybird/BUILD.gn b/Meta/gn/secondary/Ladybird/BUILD.gn index b777b90462a7..915c87be53fa 100644 --- a/Meta/gn/secondary/Ladybird/BUILD.gn +++ b/Meta/gn/secondary/Ladybird/BUILD.gn @@ -1,5 +1,6 @@ import("//Ladybird/compile_qt_resource_file.gni") import("//Ladybird/enable_qt.gni") +import("//Ladybird/enable_appkit.gni") import("//Ladybird/link_qt.gni") import("//Ladybird/moc_qt_objects.gni") @@ -109,7 +110,7 @@ executable("ladybird_executable") { ":compile_resource_file", ":generate_moc", ] - } else { + } else if (enable_appkit) { sources += [ "AppKit/Application/Application.mm", "AppKit/Application/ApplicationBridge.cpp", diff --git a/Meta/gn/secondary/Ladybird/enable_appkit.gni b/Meta/gn/secondary/Ladybird/enable_appkit.gni new file mode 100644 index 000000000000..5e5bbe9d7e8e --- /dev/null +++ b/Meta/gn/secondary/Ladybird/enable_appkit.gni @@ -0,0 +1,5 @@ +declare_args() { + # Build the Ladybird application using the AppKit chrome. + enable_appkit = current_os == "mac" +} + diff --git a/Meta/gn/secondary/Ladybird/enable_qt.gni b/Meta/gn/secondary/Ladybird/enable_qt.gni index f88108a8010e..43a917d23549 100644 --- a/Meta/gn/secondary/Ladybird/enable_qt.gni +++ b/Meta/gn/secondary/Ladybird/enable_qt.gni @@ -1,4 +1,4 @@ declare_args() { # Build the Ladybird application using the Qt chrome. - enable_qt = current_os != "mac" + enable_qt = current_os != "mac" && current_os != "win" } From baf63e61a035acdaeba9e9f3349883834b1f8a64 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 18 Sep 2024 11:24:49 -0700 Subject: [PATCH 9/9] gn: make `download_file` work on Windows The file is not committed to disk until the close which occurs at the termination of the scope. Extract the `rename` to outside the scope allowing this to work on Windows. --- Meta/gn/build/download_file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Meta/gn/build/download_file.py b/Meta/gn/build/download_file.py index bf3eda82b952..29f1e804eb48 100644 --- a/Meta/gn/build/download_file.py +++ b/Meta/gn/build/download_file.py @@ -70,7 +70,7 @@ def main(): try: with tempfile.NamedTemporaryFile(delete=False, dir=output_file.parent) as out: out.write(f.read()) - os.rename(out.name, output_file) + os.rename(out.name, output_file) except IOError: os.unlink(out.name)