Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=a97fc160acecc6e53964864433e5286c973dcb76

commit a97fc160acecc6e53964864433e5286c973dcb76
Author: crazy <cr...@frugalware.org>
Date:   Thu Dec 1 13:28:54 2016 +0100

icu4c-58.1-3-x86_64
* added backport patch for #12827
* see: http://bugs.icu-project.org/trac/ticket/12827
http://bugs.icu-project.org/trac/ticket/12814
* this should fix all weird segfaults from ucol_getKeywordValuesForLocale()
* so probably ff && tbird will start working again with system icu

diff --git a/source/lib/icu4c/FrugalBuild b/source/lib/icu4c/FrugalBuild
index 8c40c31..aa46df8 100644
--- a/source/lib/icu4c/FrugalBuild
+++ b/source/lib/icu4c/FrugalBuild
@@ -3,7 +3,7 @@

pkgname=icu4c
pkgver=58.1
-pkgrel=2
+pkgrel=3
pkgdesc="International Components for Unicode library"
url="http://site.icu-project.org/";
groups=('lib')
@@ -13,8 +13,18 @@ depends=('libstdc++>=6.2.1-5')
## do not remove .. it produce crappy code with ccache - crazy -
options+=('noccache' 'force')
up2date="lynx -dump http://site.icu-project.org/download |grep 
[0-9].[0-9].[0-9] |sed -ne 's/.*\].*]\(.*\) \[.*/\1/;1p'"
-source=(http://download.icu-project.org/files/icu4c/$pkgver/icu4c-`echo 
$pkgver|sed 's/\./_/g'`-src.tgz)
-sha1sums=('0739f45f985e4dfd0fcda978aecbb0de4d7ddaa6')
-_F_cd_path="icu/source"
+source=(http://download.icu-project.org/files/icu4c/$pkgver/icu4c-`echo 
$pkgver|sed 's/\./_/g'`-src.tgz \
+       upstream-bug-12827-fix.patch)
+sha1sums=('0739f45f985e4dfd0fcda978aecbb0de4d7ddaa6' \
+          '899aca6d2ed552ebe3d66df5333e21b6e5f78a87')
+#_F_cd_path="icu/source"
+_Fbuild_no_patch="yes"

+build() {
+
+       Fcd icu
+       Fpatchall
+       cd source || Fdie
+       Fbuild
+}
# optimization OK
diff --git a/source/lib/icu4c/upstream-bug-12827-fix.patch 
b/source/lib/icu4c/upstream-bug-12827-fix.patch
new file mode 100644
index 0000000..827040b
--- /dev/null
+++ b/source/lib/icu4c/upstream-bug-12827-fix.patch
@@ -0,0 +1,142 @@
+diff -Naur icu/source/common/ulist.c icu-12827/source/common/ulist.c
+--- icu/source/common/ulist.c  2016-06-15 20:58:17.000000000 +0200
++++ icu-12827/source/common/ulist.c    2016-12-01 13:18:46.948853794 +0100
+@@ -29,7 +29,6 @@
+     UListNode *tail;
+
+     int32_t size;
+-    int32_t currentIndex;
+ };
+
+ static void ulist_addFirstItem(UList *list, UListNode *newItem);
+@@ -51,7 +50,6 @@
+     newList->head = NULL;
+     newList->tail = NULL;
+     newList->size = 0;
+-    newList->currentIndex = -1;
+
+     return newList;
+ }
+@@ -80,8 +78,9 @@
+     } else {
+         p->next->previous = p->previous;
+     }
+-    list->curr = NULL;
+-    list->currentIndex = 0;
++    if (p == list->curr) {
++        list->curr = p->next;
++    }
+     --list->size;
+     if (p->forceDelete) {
+         uprv_free(p->data);
+@@ -150,7 +149,6 @@
+         newItem->next = list->head;
+         list->head->previous = newItem;
+         list->head = newItem;
+-        list->currentIndex++;
+     }
+
+     list->size++;
+@@ -193,7 +191,6 @@
+
+     curr = list->curr;
+     list->curr = curr->next;
+-    list->currentIndex++;
+
+     return curr->data;
+ }
+@@ -209,7 +206,6 @@
+ U_CAPI void U_EXPORT2 ulist_resetList(UList *list) {
+     if (list != NULL) {
+         list->curr = list->head;
+-        list->currentIndex = 0;
+     }
+ }
+
+@@ -272,4 +268,3 @@
+ U_CAPI UList * U_EXPORT2 ulist_getListFromEnum(UEnumeration *en) {
+     return (UList *)(en->context);
+ }
+-
+diff -Naur icu/source/i18n/ucol_res.cpp icu-12827/source/i18n/ucol_res.cpp
+--- icu/source/i18n/ucol_res.cpp       2016-09-28 04:26:02.000000000 +0200
++++ icu-12827/source/i18n/ucol_res.cpp 2016-12-01 13:18:46.949853794 +0100
+@@ -680,6 +680,7 @@
+         return NULL;
+     }
+     memcpy(en, &defaultKeywordValues, sizeof(UEnumeration));
++    ulist_resetList(sink.values);  // Initialize the iterator.
+     en->context = sink.values;
+     sink.values = NULL;  // Avoid deletion in the sink destructor.
+     return en;
+diff -Naur icu/source/test/intltest/apicoll.cpp 
icu-12827/source/test/intltest/apicoll.cpp
+--- icu/source/test/intltest/apicoll.cpp       2016-09-20 06:30:06.000000000 
+0200
++++ icu-12827/source/test/intltest/apicoll.cpp 2016-12-01 13:18:46.950853794 
+0100
+@@ -81,17 +81,10 @@
+     logln("Test ctors : ");
+     col = Collator::createInstance(Locale::getEnglish(), success);
+     if (U_FAILURE(success)){
+-        errcheckln(success, "Default Collator creation failed. - %s", 
u_errorName(success));
++        errcheckln(success, "English Collator creation failed. - %s", 
u_errorName(success));
+         return;
+     }
+
+-    StringEnumeration* kwEnum = col->getKeywordValuesForLocale("", 
Locale::getEnglish(),true,success);
+-    if (U_FAILURE(success)){
+-        errcheckln(success, "Get Keyword Values for Locale failed. - %s", 
u_errorName(success));
+-        return;
+-    }
+-    delete kwEnum;
+-
+     col->getVersion(versionArray);
+     // Check for a version greater than some value rather than equality
+     // so that we need not update the expected version each time.
+@@ -231,6 +224,29 @@
+     delete junk;
+ }
+
++void CollationAPITest::TestKeywordValues() {
++    IcuTestErrorCode errorCode(*this, "TestKeywordValues");
++    LocalPointer<Collator> col(Collator::createInstance(Locale::getEnglish(), 
errorCode));
++    if (errorCode.logIfFailureAndReset("English Collator creation failed")) {
++        return;
++    }
++
++    LocalPointer<StringEnumeration> kwEnum(
++        col->getKeywordValuesForLocale("collation", Locale::getEnglish(), 
TRUE, errorCode));
++    if (errorCode.logIfFailureAndReset("Get Keyword Values for English 
Collator failed")) {
++        return;
++    }
++    assertTrue("expect at least one collation tailoring for English", 
kwEnum->count(errorCode) > 0);
++    const char *kw;
++    UBool hasStandard = FALSE;
++    while ((kw = kwEnum->next(NULL, errorCode)) != NULL) {
++        if (strcmp(kw, "standard") == 0) {
++            hasStandard = TRUE;
++        }
++    }
++    assertTrue("expect at least the 'standard' collation tailoring for 
English", hasStandard);
++}
++
+ void
+ CollationAPITest::TestRuleBasedColl()
+ {
+@@ -2466,6 +2482,7 @@
+     if (exec) logln("TestSuite CollationAPITest: ");
+     TESTCASE_AUTO_BEGIN;
+     TESTCASE_AUTO(TestProperty);
++    TESTCASE_AUTO(TestKeywordValues);
+     TESTCASE_AUTO(TestOperators);
+     TESTCASE_AUTO(TestDuplicate);
+     TESTCASE_AUTO(TestCompare);
+diff -Naur icu/source/test/intltest/apicoll.h 
icu-12827/source/test/intltest/apicoll.h
+--- icu/source/test/intltest/apicoll.h 2016-06-15 20:58:17.000000000 +0200
++++ icu-12827/source/test/intltest/apicoll.h   2016-12-01 13:18:46.951853794 
+0100
+@@ -35,6 +35,7 @@
+      * - displayable name in the desired locale
+      */
+     void TestProperty(/* char* par */);
++    void TestKeywordValues();
+
+     /**
+     * This tests the RuleBasedCollator
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to