From 221507c567e7a20d5c19af6ac0e189058f262aba Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Sat, 8 Jun 2024 11:10:10 -0400 Subject: [PATCH] LibLocale: Install ICU package and link into LibLocale Rather than removing LibLocale entirely, we will use it as a wrapper around ICU (which has some C-like interfaces, and uses UTF-16 for its string types). Using ICU will provide better web compatibility overall, and will let us implement features we were previously unable to (e.g. Intl.Collator requires data that is not in the JSON export of the CLDR). --- .github/actions/setup/action.yml | 4 ++-- Documentation/BuildInstructionsLadybird.md | 4 ++-- Userland/Libraries/LibLocale/CMakeLists.txt | 4 ++++ vcpkg.json | 19 ++++++++++++------- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index afa1e473188..abe42f4c9fc 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -29,7 +29,7 @@ runs: sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update - sudo apt-get install ccache clang-18 clang++-18 clang-format-18 lld-18 gcc-13 g++-13 libstdc++-13-dev ninja-build unzip qt6-base-dev qt6-tools-dev-tools libqt6svg6-dev qt6-multimedia-dev libgl1-mesa-dev libpulse-dev libssl-dev libegl1-mesa-dev + sudo apt-get install autoconf autoconf-archive automake ccache clang-18 clang++-18 clang-format-18 lld-18 gcc-13 g++-13 libstdc++-13-dev ninja-build unzip qt6-base-dev qt6-tools-dev-tools libqt6svg6-dev qt6-multimedia-dev libgl1-mesa-dev libpulse-dev libssl-dev libegl1-mesa-dev sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 100 sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 100 @@ -59,7 +59,7 @@ runs: run: | set -e brew update - brew install coreutils bash ninja wabt ccache unzip qt llvm@18 + brew install autoconf autoconf-archive automake coreutils bash ninja wabt ccache unzip qt llvm@18 - name: 'Install vcpkg' shell: bash diff --git a/Documentation/BuildInstructionsLadybird.md b/Documentation/BuildInstructionsLadybird.md index e482426f6a1..886d923b236 100644 --- a/Documentation/BuildInstructionsLadybird.md +++ b/Documentation/BuildInstructionsLadybird.md @@ -9,7 +9,7 @@ NOTE: In all of the below lists of packages, the Qt6 multimedia package is not n On Debian/Ubuntu required packages include, but are not limited to: ``` -sudo apt install build-essential cmake libgl1-mesa-dev ninja-build qt6-base-dev qt6-tools-dev-tools qt6-multimedia-dev ccache fonts-liberation2 zip unzip curl tar +sudo apt install autoconf autoconf-archive automake build-essential cmake libgl1-mesa-dev ninja-build qt6-base-dev qt6-tools-dev-tools qt6-multimedia-dev ccache fonts-liberation2 zip unzip curl tar ``` For Ubuntu 20.04 and above, ensure that the Qt6 Wayland packages are available: @@ -56,7 +56,7 @@ Xcode 14 versions before 14.3 might crash while building ladybird. Xcode 14.3 or ``` xcode-select --install -brew install cmake ninja ccache +brew install autoconf autoconf-archive automake cmake ninja ccache ``` If you also plan to use the Qt chrome on macOS: diff --git a/Userland/Libraries/LibLocale/CMakeLists.txt b/Userland/Libraries/LibLocale/CMakeLists.txt index 35763eacf38..3f9df1ffcb0 100644 --- a/Userland/Libraries/LibLocale/CMakeLists.txt +++ b/Userland/Libraries/LibLocale/CMakeLists.txt @@ -21,6 +21,10 @@ serenity_lib(LibLocale locale) target_link_libraries(LibLocale PRIVATE LibUnicode) target_compile_definitions(LibLocale PRIVATE ENABLE_UNICODE_DATA=$) +find_package(ICU REQUIRED COMPONENTS data i18n uc) +target_include_directories(LibLocale PRIVATE ${ICU_INCLUDE_DIRS}) +target_link_libraries(LibLocale PUBLIC ${ICU_LIBRARIES}) + if (DEFINED LOCALE_DATA_SOURCES) target_link_libraries(LibLocale PRIVATE LibLocaleData) endif() diff --git a/vcpkg.json b/vcpkg.json index 5f7b0d1bce1..a54ffc64a4e 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,14 +1,23 @@ { "builtin-baseline": "01f602195983451bc83e72f4214af2cbc495aa94", "dependencies": [ - "sqlite3", - "woff2", { "name": "fontconfig", "platform": "linux | freebsd | openbsd" - } + }, + "icu", + "sqlite3", + "woff2" ], "overrides": [ + { + "name": "fontconfig", + "version": "2.14.2#1" + }, + { + "name": "icu", + "version": "74.2#1" + }, { "name": "sqlite3", "version": "3.45.3" @@ -16,10 +25,6 @@ { "name": "woff2", "version": "1.0.2#4" - }, - { - "name": "fontconfig", - "version": "2.14.2#1" } ] }