Bug 1899411 - Part 1. Update shell script and patch files for ICU4X 1.5. r=TYLin

Update script and patches for ICU4X 1.5

Differential Revision: https://phabricator.services.mozilla.com/D213006
This commit is contained in:
Makoto Kato 2024-06-17 02:03:23 +00:00
parent 232c521ae5
commit 259f753603
5 changed files with 13 additions and 351 deletions

View File

@ -1,7 +1,7 @@
--- a/intl/icu_capi/Cargo.toml 2023-11-23 00:55:29.801649858 +0900
+++ b/intl/icu_capi/Cargo.toml 2023-11-23 00:57:49.528753911 +0900
@@ -190,19 +190,7 @@
"icu_timezone?/serde",
@@ -190,19 +190,8 @@
"icu_experimental?/serde",
]
compiled_data = [
- "icu_calendar?/compiled_data",
@ -9,14 +9,14 @@
- "icu_collator?/compiled_data",
- "icu_datetime?/compiled_data",
- "icu_decimal?/compiled_data",
- "icu_displaynames?/compiled_data",
- "icu_list?/compiled_data",
- "icu_locid_transform?/compiled_data",
- "icu_normalizer?/compiled_data",
- "icu_plurals?/compiled_data",
- "icu_properties?/compiled_data",
"icu_properties?/compiled_data",
"icu_segmenter?/compiled_data",
- "icu_timezone?/compiled_data",
- "icu_experimental?/compiled_data",
]
cpp_default = ["logging"]
default = [

View File

@ -1,89 +0,0 @@
diff --git a/intl/icu_capi/cpp/include/diplomat_runtime.hpp b/intl/icu_capi/cpp/include/diplomat_runtime.hpp
--- a/intl/icu_capi/cpp/include/diplomat_runtime.hpp
+++ b/intl/icu_capi/cpp/include/diplomat_runtime.hpp
@@ -49,52 +49,60 @@ template<typename T> struct WriteableTra
template<> struct WriteableTrait<std::string> {
static inline capi::DiplomatWriteable Construct(std::string& t) {
return diplomat::WriteableFromString(t);
}
};
template<class T> struct Ok {
T inner;
- Ok(T&& i): inner(std::move(i)) {}
+ explicit Ok(T&& i): inner(std::move(i)) {}
// We don't want to expose an lvalue-capable constructor in general
// however there is no problem doing this for trivially copyable types
template<typename X = T, typename = typename std::enable_if<std::is_trivially_copyable<X>::value>::type>
- Ok(T i): inner(i) {}
+ explicit Ok(const T& i): inner(i) {}
Ok() = default;
Ok(Ok&&) noexcept = default;
Ok(const Ok &) = default;
Ok& operator=(const Ok&) = default;
Ok& operator=(Ok&&) noexcept = default;
};
template<class T> struct Err {
T inner;
- Err(T&& i): inner(std::move(i)) {}
+ explicit Err(T&& i): inner(std::move(i)) {}
// We don't want to expose an lvalue-capable constructor in general
// however there is no problem doing this for trivially copyable types
template<typename X = T, typename = typename std::enable_if<std::is_trivially_copyable<X>::value>::type>
- Err(T i): inner(i) {}
+ explicit Err(const T& i): inner(i) {}
Err() = default;
Err(Err&&) noexcept = default;
Err(const Err &) = default;
Err& operator=(const Err&) = default;
Err& operator=(Err&&) noexcept = default;
};
template<class T, class E>
class result {
private:
std::variant<Ok<T>, Err<E>> val;
public:
- result(Ok<T>&& v): val(std::move(v)) {}
- result(Err<E>&& v): val(std::move(v)) {}
+ explicit result(Ok<T>&& v): val(std::move(v)) {}
+ explicit result(Err<E>&& v): val(std::move(v)) {}
result() = default;
result(const result &) = default;
result& operator=(const result&) = default;
+ result& operator=(Ok<T>&& t) {
+ this->val = Ok<T>(std::move(t));
+ return *this;
+ }
+ result& operator=(Err<E>&& e) {
+ this->val = Err<E>(std::move(e));
+ return *this;
+ }
result& operator=(result&&) noexcept = default;
result(result &&) noexcept = default;
~result() = default;
bool is_ok() const {
return std::holds_alternative<Ok<T>>(this->val);
};
bool is_err() const {
return std::holds_alternative<Err<E>>(this->val);
@@ -142,17 +150,17 @@ template<class T> using span = std::span
// C++-17-compatible std::span
template<class T>
class span {
public:
constexpr span(T* data, size_t size)
: data_(data), size_(size) {}
template<size_t N>
- constexpr span(std::array<typename std::remove_const<T>::type, N>& arr)
+ explicit constexpr span(std::array<typename std::remove_const<T>::type, N>& arr)
: data_(const_cast<T*>(arr.data())), size_(N) {}
constexpr T* data() const noexcept {
return this->data_;
}
constexpr size_t size() const noexcept {
return this->size_;
}
private:

View File

@ -1,11 +1,10 @@
diff --git a/intl/icu_capi/src/data_struct.rs b/intl/icu_capi/src/data_struct.rs
index d66e20b117b58..60765cec2419a 100644
--- a/intl/icu_capi/src/data_struct.rs
+++ b/intl/icu_capi/src/data_struct.rs
@@ -20,7 +20,7 @@ pub mod ffi {
@@ -21,7 +21,7 @@ pub mod ffi {
///
/// This can be used to construct a StructDataProvider.
#[diplomat::attr(dart, disable)]
#[diplomat::attr(*, disable)]
- pub struct ICU4XDataStruct(pub(crate) AnyPayload);
+ pub struct ICU4XDataStruct(#[allow(dead_code)] AnyPayload);

View File

@ -1,242 +0,0 @@
diff --git a/intl/icu_capi/cpp/include/ICU4XDataProvider.hpp b/intl/icu_capi/cpp/include/ICU4XDataProvider.hpp
--- a/intl/icu_capi/cpp/include/ICU4XDataProvider.hpp
+++ b/intl/icu_capi/cpp/include/ICU4XDataProvider.hpp
@@ -109,17 +109,17 @@ class ICU4XDataProvider {
/**
* See the [Rust documentation for `new_with_fallbacker`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackProvider.html#method.new_with_fallbacker) for more information.
*
* Additional information: [1](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackProvider.html)
*/
diplomat::result<std::monostate, ICU4XError> enable_locale_fallback_with(const ICU4XLocaleFallbacker& fallbacker);
inline const capi::ICU4XDataProvider* AsFFI() const { return this->inner.get(); }
inline capi::ICU4XDataProvider* AsFFIMut() { return this->inner.get(); }
- inline ICU4XDataProvider(capi::ICU4XDataProvider* i) : inner(i) {}
+ inline explicit ICU4XDataProvider(capi::ICU4XDataProvider* i) : inner(i) {}
ICU4XDataProvider() = default;
ICU4XDataProvider(ICU4XDataProvider&&) noexcept = default;
ICU4XDataProvider& operator=(ICU4XDataProvider&& other) noexcept = default;
private:
std::unique_ptr<capi::ICU4XDataProvider, ICU4XDataProviderDeleter> inner;
};
#include "ICU4XLocaleFallbacker.hpp"
diff --git a/intl/icu_capi/cpp/include/ICU4XLineBreakIteratorLatin1.hpp b/intl/icu_capi/cpp/include/ICU4XLineBreakIteratorLatin1.hpp
--- a/intl/icu_capi/cpp/include/ICU4XLineBreakIteratorLatin1.hpp
+++ b/intl/icu_capi/cpp/include/ICU4XLineBreakIteratorLatin1.hpp
@@ -33,17 +33,17 @@ class ICU4XLineBreakIteratorLatin1 {
* Finds the next breakpoint. Returns -1 if at the end of the string or if the index is
* out of range of a 32-bit signed integer.
*
* See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.LineBreakIterator.html#method.next) for more information.
*/
int32_t next();
inline const capi::ICU4XLineBreakIteratorLatin1* AsFFI() const { return this->inner.get(); }
inline capi::ICU4XLineBreakIteratorLatin1* AsFFIMut() { return this->inner.get(); }
- inline ICU4XLineBreakIteratorLatin1(capi::ICU4XLineBreakIteratorLatin1* i) : inner(i) {}
+ inline explicit ICU4XLineBreakIteratorLatin1(capi::ICU4XLineBreakIteratorLatin1* i) : inner(i) {}
ICU4XLineBreakIteratorLatin1() = default;
ICU4XLineBreakIteratorLatin1(ICU4XLineBreakIteratorLatin1&&) noexcept = default;
ICU4XLineBreakIteratorLatin1& operator=(ICU4XLineBreakIteratorLatin1&& other) noexcept = default;
private:
std::unique_ptr<capi::ICU4XLineBreakIteratorLatin1, ICU4XLineBreakIteratorLatin1Deleter> inner;
};
diff --git a/intl/icu_capi/cpp/include/ICU4XLineBreakIteratorUtf16.hpp b/intl/icu_capi/cpp/include/ICU4XLineBreakIteratorUtf16.hpp
--- a/intl/icu_capi/cpp/include/ICU4XLineBreakIteratorUtf16.hpp
+++ b/intl/icu_capi/cpp/include/ICU4XLineBreakIteratorUtf16.hpp
@@ -33,17 +33,17 @@ class ICU4XLineBreakIteratorUtf16 {
* Finds the next breakpoint. Returns -1 if at the end of the string or if the index is
* out of range of a 32-bit signed integer.
*
* See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.LineBreakIterator.html#method.next) for more information.
*/
int32_t next();
inline const capi::ICU4XLineBreakIteratorUtf16* AsFFI() const { return this->inner.get(); }
inline capi::ICU4XLineBreakIteratorUtf16* AsFFIMut() { return this->inner.get(); }
- inline ICU4XLineBreakIteratorUtf16(capi::ICU4XLineBreakIteratorUtf16* i) : inner(i) {}
+ inline explicit ICU4XLineBreakIteratorUtf16(capi::ICU4XLineBreakIteratorUtf16* i) : inner(i) {}
ICU4XLineBreakIteratorUtf16() = default;
ICU4XLineBreakIteratorUtf16(ICU4XLineBreakIteratorUtf16&&) noexcept = default;
ICU4XLineBreakIteratorUtf16& operator=(ICU4XLineBreakIteratorUtf16&& other) noexcept = default;
private:
std::unique_ptr<capi::ICU4XLineBreakIteratorUtf16, ICU4XLineBreakIteratorUtf16Deleter> inner;
};
diff --git a/intl/icu_capi/cpp/include/ICU4XLocale.hpp b/intl/icu_capi/cpp/include/ICU4XLocale.hpp
--- a/intl/icu_capi/cpp/include/ICU4XLocale.hpp
+++ b/intl/icu_capi/cpp/include/ICU4XLocale.hpp
@@ -202,17 +202,17 @@ class ICU4XLocale {
/**
* Deprecated
*
* Use `create_from_string("bn").
*/
static ICU4XLocale create_bn();
inline const capi::ICU4XLocale* AsFFI() const { return this->inner.get(); }
inline capi::ICU4XLocale* AsFFIMut() { return this->inner.get(); }
- inline ICU4XLocale(capi::ICU4XLocale* i) : inner(i) {}
+ inline explicit ICU4XLocale(capi::ICU4XLocale* i) : inner(i) {}
ICU4XLocale() = default;
ICU4XLocale(ICU4XLocale&&) noexcept = default;
ICU4XLocale& operator=(ICU4XLocale&& other) noexcept = default;
private:
std::unique_ptr<capi::ICU4XLocale, ICU4XLocaleDeleter> inner;
};
diff --git a/intl/icu_capi/cpp/include/ICU4XLocaleFallbackIterator.hpp b/intl/icu_capi/cpp/include/ICU4XLocaleFallbackIterator.hpp
--- a/intl/icu_capi/cpp/include/ICU4XLocaleFallbackIterator.hpp
+++ b/intl/icu_capi/cpp/include/ICU4XLocaleFallbackIterator.hpp
@@ -40,17 +40,17 @@ class ICU4XLocaleFallbackIterator {
/**
* Performs one step of the fallback algorithm, mutating the locale.
*
* See the [Rust documentation for `step`](https://docs.rs/icu/latest/icu/locid_transform/fallback/struct.LocaleFallbackIterator.html#method.step) for more information.
*/
void step();
inline const capi::ICU4XLocaleFallbackIterator* AsFFI() const { return this->inner.get(); }
inline capi::ICU4XLocaleFallbackIterator* AsFFIMut() { return this->inner.get(); }
- inline ICU4XLocaleFallbackIterator(capi::ICU4XLocaleFallbackIterator* i) : inner(i) {}
+ inline explicit ICU4XLocaleFallbackIterator(capi::ICU4XLocaleFallbackIterator* i) : inner(i) {}
ICU4XLocaleFallbackIterator() = default;
ICU4XLocaleFallbackIterator(ICU4XLocaleFallbackIterator&&) noexcept = default;
ICU4XLocaleFallbackIterator& operator=(ICU4XLocaleFallbackIterator&& other) noexcept = default;
private:
std::unique_ptr<capi::ICU4XLocaleFallbackIterator, ICU4XLocaleFallbackIteratorDeleter> inner;
};
#include "ICU4XLocale.hpp"
diff --git a/intl/icu_capi/cpp/include/ICU4XLocaleFallbacker.hpp b/intl/icu_capi/cpp/include/ICU4XLocaleFallbacker.hpp
--- a/intl/icu_capi/cpp/include/ICU4XLocaleFallbacker.hpp
+++ b/intl/icu_capi/cpp/include/ICU4XLocaleFallbacker.hpp
@@ -53,17 +53,17 @@ class ICU4XLocaleFallbacker {
*
* See the [Rust documentation for `for_config`](https://docs.rs/icu/latest/icu/locid_transform/fallback/struct.LocaleFallbacker.html#method.for_config) for more information.
*
* Lifetimes: `this` must live at least as long as the output.
*/
diplomat::result<ICU4XLocaleFallbackerWithConfig, ICU4XError> for_config(ICU4XLocaleFallbackConfig config) const;
inline const capi::ICU4XLocaleFallbacker* AsFFI() const { return this->inner.get(); }
inline capi::ICU4XLocaleFallbacker* AsFFIMut() { return this->inner.get(); }
- inline ICU4XLocaleFallbacker(capi::ICU4XLocaleFallbacker* i) : inner(i) {}
+ inline explicit ICU4XLocaleFallbacker(capi::ICU4XLocaleFallbacker* i) : inner(i) {}
ICU4XLocaleFallbacker() = default;
ICU4XLocaleFallbacker(ICU4XLocaleFallbacker&&) noexcept = default;
ICU4XLocaleFallbacker& operator=(ICU4XLocaleFallbacker&& other) noexcept = default;
private:
std::unique_ptr<capi::ICU4XLocaleFallbacker, ICU4XLocaleFallbackerDeleter> inner;
};
#include "ICU4XDataProvider.hpp"
diff --git a/intl/icu_capi/cpp/include/ICU4XLocaleFallbackerWithConfig.hpp b/intl/icu_capi/cpp/include/ICU4XLocaleFallbackerWithConfig.hpp
--- a/intl/icu_capi/cpp/include/ICU4XLocaleFallbackerWithConfig.hpp
+++ b/intl/icu_capi/cpp/include/ICU4XLocaleFallbackerWithConfig.hpp
@@ -38,17 +38,17 @@ class ICU4XLocaleFallbackerWithConfig {
*
* See the [Rust documentation for `fallback_for`](https://docs.rs/icu/latest/icu/locid_transform/fallback/struct.LocaleFallbacker.html#method.fallback_for) for more information.
*
* Lifetimes: `this` must live at least as long as the output.
*/
ICU4XLocaleFallbackIterator fallback_for_locale(const ICU4XLocale& locale) const;
inline const capi::ICU4XLocaleFallbackerWithConfig* AsFFI() const { return this->inner.get(); }
inline capi::ICU4XLocaleFallbackerWithConfig* AsFFIMut() { return this->inner.get(); }
- inline ICU4XLocaleFallbackerWithConfig(capi::ICU4XLocaleFallbackerWithConfig* i) : inner(i) {}
+ inline explicit ICU4XLocaleFallbackerWithConfig(capi::ICU4XLocaleFallbackerWithConfig* i) : inner(i) {}
ICU4XLocaleFallbackerWithConfig() = default;
ICU4XLocaleFallbackerWithConfig(ICU4XLocaleFallbackerWithConfig&&) noexcept = default;
ICU4XLocaleFallbackerWithConfig& operator=(ICU4XLocaleFallbackerWithConfig&& other) noexcept = default;
private:
std::unique_ptr<capi::ICU4XLocaleFallbackerWithConfig, ICU4XLocaleFallbackerWithConfigDeleter> inner;
};
#include "ICU4XLocale.hpp"
diff --git a/intl/icu_capi/cpp/include/ICU4XWordBreakIteratorLatin1.hpp b/intl/icu_capi/cpp/include/ICU4XWordBreakIteratorLatin1.hpp
--- a/intl/icu_capi/cpp/include/ICU4XWordBreakIteratorLatin1.hpp
+++ b/intl/icu_capi/cpp/include/ICU4XWordBreakIteratorLatin1.hpp
@@ -46,17 +46,17 @@ class ICU4XWordBreakIteratorLatin1 {
/**
* Return true when break boundary is word-like such as letter/number/CJK
*
* See the [Rust documentation for `is_word_like`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.is_word_like) for more information.
*/
bool is_word_like() const;
inline const capi::ICU4XWordBreakIteratorLatin1* AsFFI() const { return this->inner.get(); }
inline capi::ICU4XWordBreakIteratorLatin1* AsFFIMut() { return this->inner.get(); }
- inline ICU4XWordBreakIteratorLatin1(capi::ICU4XWordBreakIteratorLatin1* i) : inner(i) {}
+ inline explicit ICU4XWordBreakIteratorLatin1(capi::ICU4XWordBreakIteratorLatin1* i) : inner(i) {}
ICU4XWordBreakIteratorLatin1() = default;
ICU4XWordBreakIteratorLatin1(ICU4XWordBreakIteratorLatin1&&) noexcept = default;
ICU4XWordBreakIteratorLatin1& operator=(ICU4XWordBreakIteratorLatin1&& other) noexcept = default;
private:
std::unique_ptr<capi::ICU4XWordBreakIteratorLatin1, ICU4XWordBreakIteratorLatin1Deleter> inner;
};
diff --git a/intl/icu_capi/cpp/include/ICU4XWordBreakIteratorUtf16.hpp b/intl/icu_capi/cpp/include/ICU4XWordBreakIteratorUtf16.hpp
--- a/intl/icu_capi/cpp/include/ICU4XWordBreakIteratorUtf16.hpp
+++ b/intl/icu_capi/cpp/include/ICU4XWordBreakIteratorUtf16.hpp
@@ -46,17 +46,17 @@ class ICU4XWordBreakIteratorUtf16 {
/**
* Return true when break boundary is word-like such as letter/number/CJK
*
* See the [Rust documentation for `is_word_like`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.is_word_like) for more information.
*/
bool is_word_like() const;
inline const capi::ICU4XWordBreakIteratorUtf16* AsFFI() const { return this->inner.get(); }
inline capi::ICU4XWordBreakIteratorUtf16* AsFFIMut() { return this->inner.get(); }
- inline ICU4XWordBreakIteratorUtf16(capi::ICU4XWordBreakIteratorUtf16* i) : inner(i) {}
+ inline explicit ICU4XWordBreakIteratorUtf16(capi::ICU4XWordBreakIteratorUtf16* i) : inner(i) {}
ICU4XWordBreakIteratorUtf16() = default;
ICU4XWordBreakIteratorUtf16(ICU4XWordBreakIteratorUtf16&&) noexcept = default;
ICU4XWordBreakIteratorUtf16& operator=(ICU4XWordBreakIteratorUtf16&& other) noexcept = default;
private:
std::unique_ptr<capi::ICU4XWordBreakIteratorUtf16, ICU4XWordBreakIteratorUtf16Deleter> inner;
};
diff --git a/intl/icu_capi/cpp/include/ICU4XWordBreakIteratorUtf8.hpp b/intl/icu_capi/cpp/include/ICU4XWordBreakIteratorUtf8.hpp
--- a/intl/icu_capi/cpp/include/ICU4XWordBreakIteratorUtf8.hpp
+++ b/intl/icu_capi/cpp/include/ICU4XWordBreakIteratorUtf8.hpp
@@ -46,17 +46,17 @@ class ICU4XWordBreakIteratorUtf8 {
/**
* Return true when break boundary is word-like such as letter/number/CJK
*
* See the [Rust documentation for `is_word_like`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.is_word_like) for more information.
*/
bool is_word_like() const;
inline const capi::ICU4XWordBreakIteratorUtf8* AsFFI() const { return this->inner.get(); }
inline capi::ICU4XWordBreakIteratorUtf8* AsFFIMut() { return this->inner.get(); }
- inline ICU4XWordBreakIteratorUtf8(capi::ICU4XWordBreakIteratorUtf8* i) : inner(i) {}
+ inline explicit ICU4XWordBreakIteratorUtf8(capi::ICU4XWordBreakIteratorUtf8* i) : inner(i) {}
ICU4XWordBreakIteratorUtf8() = default;
ICU4XWordBreakIteratorUtf8(ICU4XWordBreakIteratorUtf8&&) noexcept = default;
ICU4XWordBreakIteratorUtf8& operator=(ICU4XWordBreakIteratorUtf8&& other) noexcept = default;
private:
std::unique_ptr<capi::ICU4XWordBreakIteratorUtf8, ICU4XWordBreakIteratorUtf8Deleter> inner;
};
diff --git a/intl/icu_capi/cpp/include/ICU4XWordSegmenter.hpp b/intl/icu_capi/cpp/include/ICU4XWordSegmenter.hpp
--- a/intl/icu_capi/cpp/include/ICU4XWordSegmenter.hpp
+++ b/intl/icu_capi/cpp/include/ICU4XWordSegmenter.hpp
@@ -88,17 +88,17 @@ class ICU4XWordSegmenter {
*
* See the [Rust documentation for `segment_latin1`](https://docs.rs/icu/latest/icu/segmenter/struct.WordSegmenter.html#method.segment_latin1) for more information.
*
* Lifetimes: `this`, `input` must live at least as long as the output.
*/
ICU4XWordBreakIteratorLatin1 segment_latin1(const diplomat::span<const uint8_t> input) const;
inline const capi::ICU4XWordSegmenter* AsFFI() const { return this->inner.get(); }
inline capi::ICU4XWordSegmenter* AsFFIMut() { return this->inner.get(); }
- inline ICU4XWordSegmenter(capi::ICU4XWordSegmenter* i) : inner(i) {}
+ inline explicit ICU4XWordSegmenter(capi::ICU4XWordSegmenter* i) : inner(i) {}
ICU4XWordSegmenter() = default;
ICU4XWordSegmenter(ICU4XWordSegmenter&&) noexcept = default;
ICU4XWordSegmenter& operator=(ICU4XWordSegmenter&& other) noexcept = default;
private:
std::unique_ptr<capi::ICU4XWordSegmenter, ICU4XWordSegmenterDeleter> inner;
};
#include "ICU4XDataProvider.hpp"

View File

@ -7,20 +7,20 @@ set -e
# Update the icu4x binary data for a given release:
# Usage: update-icu4x.sh <URL of ICU GIT> <release tag name> <CLDR version> <ICU release tag name> <ICU4X version of icu_capi>
# update-icu4x.sh https://github.com/unicode-org/icu4x.git icu@1.4.0 44.0.0 release-74-1 1.4.0
# update-icu4x.sh https://github.com/unicode-org/icu4x.git icu@1.5.0 45.0.0 release-75-1 1.5.0
#
# Update to the main branch:
# Usage: update-icu4x.sh <URL of ICU GIT> <branch> <CLDR version> <ICU release tag name> <ICU4X version of icu_capi>
# update-icu4x.sh https://github.com/unicode-org/icu4x.git main 44.0.0 release-74-1 1.4.0
# update-icu4x.sh https://github.com/unicode-org/icu4x.git main 45.0.0 release-75-1 1.5.0
# default
cldr=${3:-44.0.0}
icuexport=${4:-release-74-1}
icu4x_version=${5:-1.4.0}
cldr=${3:-45.0.0}
icuexport=${4:-release-75-1}
icu4x_version=${5:-1.5.0}
if [ $# -lt 2 ]; then
echo "Usage: update-icu4x.sh <URL of ICU4X GIT> <ICU4X release tag name> <CLDR version> <ICU release tag name> <ICU4X version for icu_capi>"
echo "Example: update-icu4x.sh https://github.com/unicode-org/icu4x.git icu@1.4.0 44.0.0 release-74-1 1.4.0"
echo "Example: update-icu4x.sh https://github.com/unicode-org/icu4x.git icu@1.5.0 45.0.0 release-75-1 1.5.0"
exit 1
fi
@ -71,10 +71,6 @@ log "Change the directory to the cloned repo"
log ${tmpclonedir}
cd ${tmpclonedir}
log "Patching line segmenter data to fix https://github.com/unicode-org/icu4x/pull/4389"
# This manually patch can be removed once we upgrade to ICU4X 1.5
wget --unlink -q -O ${tmpclonedir}/provider/datagen/data/segmenter/line.toml https://raw.githubusercontent.com/unicode-org/icu4x/e080ecd12e38d6aecc99cd0cfe8c21595c4ce6ff/provider/datagen/data/segmenter/line.toml
log "Copy icu_capi crate to local since we need a patched version"
rm -rf ${top_src_dir}/intl/icu_capi
wget -O icu_capi.tar.gz https://crates.io/api/v1/crates/icu_capi/${icu4x_version}/download
@ -85,9 +81,7 @@ rm -rf icu_capi_tar.gz
log "Patching icu_capi"
for patch in \
001-Cargo.toml.patch \
002-GH4109.patch \
003-explicit.patch \
004-dead-code.patch \
002-dead-code.patch \
; do
patch -d ${top_src_dir} -p1 --no-backup-if-mismatch < ${top_src_dir}/intl/icu4x-patches/$patch
done