Kaydet (Commit) 79a3c9b1 authored tarafından Eike Rathke's avatar Eike Rathke

partly revert 92a9b778 for ICU < 49

Re-enable build with ICU 4.6 and 4.8
ICU versions prior to 49 don't know Conditional_Japanese_Starter and
Hebrew_Letter

Also, the change in i18npool/CustomTarget_breakiterator.mk

- -e "s#\[:LineBreak = Close_Punctuation:\]#\[& \[:LineBreak = Close_Parenthesis:\]\]#" \

with i18npool/source/breakiterator/data/line.txt

-$CL = [:LineBreak = Close_Punctuation:] ;
+$CL = [:LineBreak = Close_Parenthesis:];

did not produce equivalent results. Instead use

$CP = [:LineBreak =  Close_Parenthesis:];
$CL = [[:LineBreak =  Close_Punctuation:] $CP];

Change-Id: I14fc14319ea34f23393264560452a79bb49fc3a7
üst 3b1102ad
...@@ -251,6 +251,8 @@ export ICU_MAJOR=@ICU_MAJOR@ ...@@ -251,6 +251,8 @@ export ICU_MAJOR=@ICU_MAJOR@
export ICU_MICRO=@ICU_MICRO@ export ICU_MICRO=@ICU_MICRO@
export ICU_MINOR=@ICU_MINOR@ export ICU_MINOR=@ICU_MINOR@
export ICU_RECLASSIFIED_PREPEND_SET_EMPTY=@ICU_RECLASSIFIED_PREPEND_SET_EMPTY@ export ICU_RECLASSIFIED_PREPEND_SET_EMPTY=@ICU_RECLASSIFIED_PREPEND_SET_EMPTY@
export ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER=@ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER@
export ICU_RECLASSIFIED_HEBREW_LETTER=@ICU_RECLASSIFIED_HEBREW_LETTER@
export ILIB=@ILIB@ export ILIB=@ILIB@
export INPATH=@INPATH@ export INPATH=@INPATH@
export INPATH_FOR_BUILD=@INPATH_FOR_BUILD@ export INPATH_FOR_BUILD=@INPATH_FOR_BUILD@
......
...@@ -8381,6 +8381,8 @@ ICU_MAJOR=49 ...@@ -8381,6 +8381,8 @@ ICU_MAJOR=49
ICU_MINOR=1 ICU_MINOR=1
ICU_MICRO=1 ICU_MICRO=1
ICU_RECLASSIFIED_PREPEND_SET_EMPTY="YES" ICU_RECLASSIFIED_PREPEND_SET_EMPTY="YES"
ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="YES"
ICU_RECLASSIFIED_HEBREW_LETTER="YES"
AC_MSG_CHECKING([which icu to use]) AC_MSG_CHECKING([which icu to use])
if test "$with_system_icu" = "yes"; then if test "$with_system_icu" = "yes"; then
AC_MSG_RESULT([external]) AC_MSG_RESULT([external])
...@@ -8442,8 +8444,12 @@ You can use --with-system-icu-for-build=force to use it anyway.]) ...@@ -8442,8 +8444,12 @@ You can use --with-system-icu-for-build=force to use it anyway.])
fi fi
if test "$ICU_MAJOR" -ge "49"; then if test "$ICU_MAJOR" -ge "49"; then
ICU_RECLASSIFIED_PREPEND_SET_EMPTY="YES" ICU_RECLASSIFIED_PREPEND_SET_EMPTY="YES"
ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="YES"
ICU_RECLASSIFIED_HEBREW_LETTER="YES"
else else
ICU_RECLASSIFIED_PREPEND_SET_EMPTY="NO" ICU_RECLASSIFIED_PREPEND_SET_EMPTY="NO"
ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="NO"
ICU_RECLASSIFIED_HEBREW_LETTER="NO"
fi fi
fi fi
...@@ -8463,6 +8469,8 @@ AC_SUBST(ICU_MAJOR) ...@@ -8463,6 +8469,8 @@ AC_SUBST(ICU_MAJOR)
AC_SUBST(ICU_MINOR) AC_SUBST(ICU_MINOR)
AC_SUBST(ICU_MICRO) AC_SUBST(ICU_MICRO)
AC_SUBST(ICU_RECLASSIFIED_PREPEND_SET_EMPTY) AC_SUBST(ICU_RECLASSIFIED_PREPEND_SET_EMPTY)
AC_SUBST(ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER)
AC_SUBST(ICU_RECLASSIFIED_HEBREW_LETTER)
AC_SUBST([MINGW_ICUDATA_DLL]) AC_SUBST([MINGW_ICUDATA_DLL])
AC_SUBST([MINGW_ICUI18N_DLL]) AC_SUBST([MINGW_ICUI18N_DLL])
AC_SUBST([MINGW_ICUUC_DLL]) AC_SUBST([MINGW_ICUUC_DLL])
......
...@@ -88,13 +88,29 @@ $(i18npool_BIDIR)/%.brk : $(i18npool_BIDIR)/%.txt $(call gb_ExternalExecutable_g ...@@ -88,13 +88,29 @@ $(i18npool_BIDIR)/%.brk : $(i18npool_BIDIR)/%.txt $(call gb_ExternalExecutable_g
$(call gb_ExternalExecutable_get_command,genbrk) -r $< -o $@ $(if $(findstring s,$(MAKEFLAGS)),> /dev/null)) $(call gb_ExternalExecutable_get_command,genbrk) -r $< -o $@ $(if $(findstring s,$(MAKEFLAGS)),> /dev/null))
# fdo#31271 ")" reclassified in more recent Unicode Standards / ICU 4.4 # fdo#31271 ")" reclassified in more recent Unicode Standards / ICU 4.4
# * Prepend set empty as of Unicode Version 6.1 / ICU 4.9, which bails out if used. # * Prepend set empty as of Unicode Version 6.1 / ICU 49, which bails out if used.
# NOTE: strips every line with _word_ 'Prepend', including $Prepend # NOTE: strips every line with _word_ 'Prepend', including $Prepend
# * Conditional_Japanese_Starter does not exist in ICU < 49, which bail out if used.
# * Hebrew_Letter does not exist in ICU < 49, which bail out if used.
# NOTE: I sincerely hope there is a better way to avoid problems than this abominable # NOTE: I sincerely hope there is a better way to avoid problems than this abominable
# sed substitution... # sed substitution...
$(i18npool_BIDIR)/%.txt : \ $(i18npool_BIDIR)/%.txt : \
$(SRCDIR)/i18npool/source/breakiterator/data/%.txt | $(i18npool_BIDIR)/.dir $(SRCDIR)/i18npool/source/breakiterator/data/%.txt | $(i18npool_BIDIR)/.dir
sed -e ': dummy' \ sed -e ': dummy' \
$(if $(filter-out YES,$(ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER)),\
-e '/\[:LineBreak = Conditional_Japanese_Starter:\]/d' \
-e 's# $$CJ##' \
) \
$(if $(filter-out YES,$(ICU_RECLASSIFIED_HEBREW_LETTER)),\
-e '/\[:LineBreak = Hebrew_Letter:\]/d' \
-e '/^$$HLcm =/d' \
-e '/^$$HLcm $$NUcm;/d' \
-e '/^$$NUcm $$HLcm;/d' \
-e '/^$$HL $$CM+;/d' \
-e 's# | $$HL\(cm\)\?##g' \
-e 's#$$HLcm ##g' \
-e 's# $$HL##g' \
) \
$(if $(filter YES,$(ICU_RECLASSIFIED_PREPEND_SET_EMPTY)),-e "/Prepend/d") \ $(if $(filter YES,$(ICU_RECLASSIFIED_PREPEND_SET_EMPTY)),-e "/Prepend/d") \
$< > $@ $< > $@
......
...@@ -74,7 +74,9 @@ public: ...@@ -74,7 +74,9 @@ public:
#endif #endif
CPPUNIT_TEST(testWordBoundaries); CPPUNIT_TEST(testWordBoundaries);
#if (U_ICU_VERSION_MAJOR_NUM > 4)
CPPUNIT_TEST(testKhmer); CPPUNIT_TEST(testKhmer);
#endif
CPPUNIT_TEST(testJapanese); CPPUNIT_TEST(testJapanese);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
...@@ -865,6 +867,10 @@ void TestBreakIterator::testNorthernThai() ...@@ -865,6 +867,10 @@ void TestBreakIterator::testNorthernThai()
} }
#endif #endif
#if (U_ICU_VERSION_MAJOR_NUM > 4)
// Not sure if any version earlier than 49 did have Khmer word boundary
// dictionaries, 4.6 does not.
//A test to ensure that our khmer word boundary detection is useful //A test to ensure that our khmer word boundary detection is useful
//https://bugs.freedesktop.org/show_bug.cgi?id=52020 //https://bugs.freedesktop.org/show_bug.cgi?id=52020
void TestBreakIterator::testKhmer() void TestBreakIterator::testKhmer()
...@@ -886,6 +892,7 @@ void TestBreakIterator::testKhmer() ...@@ -886,6 +892,7 @@ void TestBreakIterator::testKhmer()
CPPUNIT_ASSERT(aBounds.startPos == 3 && aBounds.endPos == 5); CPPUNIT_ASSERT(aBounds.startPos == 3 && aBounds.endPos == 5);
} }
#endif
void TestBreakIterator::testJapanese() void TestBreakIterator::testJapanese()
{ {
......
...@@ -62,7 +62,8 @@ $BK = [:LineBreak = Mandatory_Break:]; ...@@ -62,7 +62,8 @@ $BK = [:LineBreak = Mandatory_Break:];
$B2 = [:LineBreak = Break_Both:]; $B2 = [:LineBreak = Break_Both:];
$CB = [:LineBreak = Contingent_Break:]; $CB = [:LineBreak = Contingent_Break:];
$CJ = [:LineBreak = Conditional_Japanese_Starter:]; $CJ = [:LineBreak = Conditional_Japanese_Starter:];
$CL = [:LineBreak = Close_Parenthesis:]; $CP = [:LineBreak = Close_Parenthesis:];
$CL = [[:LineBreak = Close_Punctuation:] $CP];
$CM = [:LineBreak = Combining_Mark:]; $CM = [:LineBreak = Combining_Mark:];
$CR = [:LineBreak = Carriage_Return:]; $CR = [:LineBreak = Carriage_Return:];
$EX = [:LineBreak = Exclamation:]; $EX = [:LineBreak = Exclamation:];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment