Meta: Handle removed and renamed libraries in gn build

This commit is contained in:
Andrew Kaster 2024-09-25 12:26:00 -06:00 committed by Andrew Kaster
parent 8636a49f47
commit 8aac8f25ba
Notes: github-actions[bot] 2024-09-27 16:16:49 +00:00
19 changed files with 32 additions and 339 deletions

View file

@ -70,7 +70,7 @@ executable("ladybird_executable") {
"//Userland/Libraries/LibImageDecoderClient",
"//Userland/Libraries/LibJS",
"//Userland/Libraries/LibMain",
"//Userland/Libraries/LibProtocol",
"//Userland/Libraries/LibRequests",
"//Userland/Libraries/LibURL",
"//Userland/Libraries/LibWeb",
"//Userland/Libraries/LibWebView",
@ -185,7 +185,7 @@ executable("headless-browser") {
"//Userland/Libraries/LibImageDecoderClient",
"//Userland/Libraries/LibJS",
"//Userland/Libraries/LibMain",
"//Userland/Libraries/LibProtocol",
"//Userland/Libraries/LibRequests",
"//Userland/Libraries/LibTLS",
"//Userland/Libraries/LibURL",
"//Userland/Libraries/LibWeb",
@ -389,9 +389,9 @@ if (current_os != "mac") {
"//Userland/Libraries/LibJS",
"//Userland/Libraries/LibLine",
"//Userland/Libraries/LibMedia",
"//Userland/Libraries/LibProtocol",
"//Userland/Libraries/LibRIFF",
"//Userland/Libraries/LibRegex",
"//Userland/Libraries/LibRequests",
"//Userland/Libraries/LibSyntax",
"//Userland/Libraries/LibTLS",
"//Userland/Libraries/LibTextCodec",
@ -420,15 +420,14 @@ if (current_os != "mac") {
"$root_out_dir/lib/liblagom-js.dylib",
"$root_out_dir/lib/liblagom-line.dylib",
"$root_out_dir/lib/liblagom-media.dylib",
"$root_out_dir/lib/liblagom-protocol.dylib",
"$root_out_dir/lib/liblagom-regex.dylib",
"$root_out_dir/lib/liblagom-requests.dylib",
"$root_out_dir/lib/liblagom-riff.dylib",
"$root_out_dir/lib/liblagom-syntax.dylib",
"$root_out_dir/lib/liblagom-textcodec.dylib",
"$root_out_dir/lib/liblagom-threading.dylib",
"$root_out_dir/lib/liblagom-tls.dylib",
"$root_out_dir/lib/liblagom-url.dylib",
"$root_out_dir/lib/liblagom-video.dylib",
"$root_out_dir/lib/liblagom-wasm.dylib",
"$root_out_dir/lib/liblagom-web.dylib",
"$root_out_dir/lib/liblagom-websocket.dylib",

View file

@ -12,7 +12,7 @@ executable("RequestServer") {
"//Userland/Libraries/LibHTTP",
"//Userland/Libraries/LibIPC",
"//Userland/Libraries/LibMain",
"//Userland/Libraries/LibProtocol",
"//Userland/Libraries/LibRequests",
"//Userland/Libraries/LibTLS",
"//Userland/Libraries/LibThreading",
"//Userland/Libraries/LibURL",

View file

@ -46,7 +46,7 @@ executable("WebContent") {
"//Userland/Libraries/LibImageDecoderClient",
"//Userland/Libraries/LibJS",
"//Userland/Libraries/LibMain",
"//Userland/Libraries/LibProtocol",
"//Userland/Libraries/LibRequests",
"//Userland/Libraries/LibURL",
"//Userland/Libraries/LibWeb",
"//Userland/Libraries/LibWebSocket",

View file

@ -12,9 +12,8 @@ executable("WebWorker") {
"//Userland/Libraries/LibIPC",
"//Userland/Libraries/LibImageDecoderClient",
"//Userland/Libraries/LibJS",
"//Userland/Libraries/LibLocale",
"//Userland/Libraries/LibMain",
"//Userland/Libraries/LibProtocol",
"//Userland/Libraries/LibRequests",
"//Userland/Libraries/LibURL",
"//Userland/Libraries/LibWeb",
"//Userland/Libraries/LibWeb:WebWorkerClientEndpoint",

View file

@ -2,7 +2,6 @@ group("Tests") {
deps = [
"//Tests/AK",
"//Tests/LibJS",
"//Tests/LibThreading",
"//Tests/LibURL",
"//Tests/LibWeb",
]

View file

@ -8,8 +8,6 @@ shared_library("minimal") {
sources = [
"ArgsParser.cpp",
"ArgsParser.h",
"ConfigFile.cpp",
"ConfigFile.h",
"DirIterator.cpp",
"DirIterator.h",
"Directory.cpp",
@ -21,8 +19,6 @@ shared_library("minimal") {
"File.cpp",
"File.h",
"Forward.h",
"SessionManagement.cpp",
"SessionManagement.h",
"StandardPaths.cpp",
"StandardPaths.h",
"System.cpp",
@ -42,6 +38,8 @@ source_set("sources") {
"AnonymousBuffer.h",
"Command.cpp",
"Command.h",
"ConfigFile.cpp",
"ConfigFile.h",
"DateTime.cpp",
"DateTime.h",
"Debounce.h",
@ -64,8 +62,6 @@ source_set("sources") {
"MappedFile.h",
"MimeData.cpp",
"MimeData.h",
"NetworkJob.cpp",
"NetworkJob.h",
"NetworkResponse.h",
"Notifier.cpp",
"Notifier.h",
@ -78,12 +74,15 @@ source_set("sources") {
"Promise.h",
"Proxy.h",
"Resource.cpp",
"Resource.h",
"ResourceImplementation.cpp",
"ResourceImplementationFile.cpp",
"SOCKSProxyClient.cpp",
"SOCKSProxyClient.h",
"SecretString.cpp",
"SecretString.h",
"SessionManagement.cpp",
"SessionManagement.h",
"SharedCircularQueue.h",
"Socket.cpp",
"Socket.h",
@ -167,8 +166,8 @@ shared_library("LibCore") {
":sources",
"//Meta/gn/build/libs/crypt",
"//Meta/gn/build/libs/pthread",
"//Userland/Libraries/LibTimeZone",
"//Userland/Libraries/LibURL",
"//Userland/Libraries/LibUnicode",
]
public_deps = [ ":minimal" ]

View file

@ -1,8 +0,0 @@
group("LibCrypt") {
deps = []
libs = []
if (current_os == "linux") {
libs += [ "crypt" ]
}
}

View file

@ -5,7 +5,6 @@ shared_library("LibCrypto") {
deps = [
"//AK",
"//Userland/Libraries/LibCore",
"//Userland/Libraries/LibFileSystem",
]
sources = [
"AEAD/ChaCha20Poly1305.cpp",
@ -26,6 +25,7 @@ shared_library("LibCrypto") {
"BigInt/UnsignedBigInteger.cpp",
"Checksum/Adler32.cpp",
"Checksum/CRC32.cpp",
"Checksum/cksum.cpp",
"Cipher/AES.cpp",
"Cipher/ChaCha20.cpp",
"Curves/Curve25519.cpp",

View file

@ -22,6 +22,7 @@ shared_library("LibIPC") {
deps = [
"//AK",
"//Userland/Libraries/LibCore",
"//Userland/Libraries/LibThreading",
"//Userland/Libraries/LibURL",
]
}

View file

@ -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",
]

View file

@ -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" ]
}
}

View file

@ -8,13 +8,19 @@ shared_library("LibMedia") {
"Audio/Loader.cpp",
"Audio/MP3Loader.cpp",
"Audio/Metadata.cpp",
"Audio/OggLoader.cpp",
"Audio/PlaybackStream.cpp",
"Audio/QOALoader.cpp",
"Audio/QOATypes.cpp",
"Audio/SampleFormats.cpp",
"Audio/VorbisComment.cpp",
"Audio/WavLoader.cpp",
"Color/ColorConverter.cpp",
"Color/ColorPrimaries.cpp",
"Color/TransferCharacteristics.cpp",
"Containers/Matroska/MatroskaDemuxer.cpp",
"Containers/Matroska/Reader.cpp",
"PlaybackManager.cpp",
"VideoFrame.cpp",
]
if (enable_pulseaudio) {
sources += [
@ -31,9 +37,11 @@ shared_library("LibMedia") {
"//Meta/gn/build/libs/pulse",
"//Userland/Libraries/LibCore",
"//Userland/Libraries/LibCrypto",
"//Userland/Libraries/LibGfx",
"//Userland/Libraries/LibIPC",
"//Userland/Libraries/LibRIFF",
"//Userland/Libraries/LibThreading",
"//Userland/Libraries/LibUnicode",
]
output_name = "media"
}

View file

@ -22,8 +22,8 @@ compiled_action("RequestServerEndpoint") {
]
}
shared_library("LibProtocol") {
output_name = "protocol"
shared_library("LibRequests") {
output_name = "requests"
include_dirs = [
"//Userland/Libraries",
"//Userland/Services",
@ -34,7 +34,6 @@ shared_library("LibProtocol") {
"//AK",
"//Userland/Libraries/LibCore",
"//Userland/Libraries/LibIPC",
"//Userland/Libraries/LibURL",
]
sources = [
"Request.cpp",

View file

@ -28,8 +28,10 @@ shared_library("LibTextCodec") {
deps = [
":generate_encoding_indexes",
"//AK",
"//Userland/Libraries/LibUnicode",
]
sources = [ "Decoder.cpp" ]
sources = [
"Decoder.cpp",
"Encoder.cpp",
]
sources += get_target_outputs(":generate_encoding_indexes")
}

View file

@ -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")
}
}

View file

@ -10,6 +10,7 @@ shared_library("LibURL") {
]
deps = [
"//AK",
"//Userland/Libraries/LibTextCodec",
"//Userland/Libraries/LibUnicode",
]
}

View file

@ -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",
]
}

View file

@ -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

View file

@ -135,7 +135,7 @@ shared_library("LibWebView") {
"//Userland/Libraries/LibGfx",
"//Userland/Libraries/LibIPC",
"//Userland/Libraries/LibJS",
"//Userland/Libraries/LibProtocol",
"//Userland/Libraries/LibRequests",
"//Userland/Libraries/LibURL",
"//Userland/Libraries/LibWeb",
]