summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev-libs/icu/ChangeLog8
-rw-r--r--dev-libs/icu/files/icu-4.8.1-fix_nan.patch68
-rw-r--r--dev-libs/icu/icu-4.8.1-r2.ebuild91
3 files changed, 166 insertions, 1 deletions
diff --git a/dev-libs/icu/ChangeLog b/dev-libs/icu/ChangeLog
index e60a53b7d7ba..0fa5897b2df3 100644
--- a/dev-libs/icu/ChangeLog
+++ b/dev-libs/icu/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for dev-libs/icu
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-libs/icu/ChangeLog,v 1.159 2011/09/05 16:50:52 scarabeus Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/icu/ChangeLog,v 1.160 2011/10/12 22:04:09 phajdan.jr Exp $
+
+*icu-4.8.1-r2 (12 Oct 2011)
+
+ 12 Oct 2011; Pawel Hajdan jr <phajdan.jr@gentoo.org> +icu-4.8.1-r2.ebuild,
+ +files/icu-4.8.1-fix_nan.patch:
+ Backport an upstream patch to fix Gentoo bug #380827 by Piotr Mitas.
*icu-4.8.1-r1 (05 Sep 2011)
diff --git a/dev-libs/icu/files/icu-4.8.1-fix_nan.patch b/dev-libs/icu/files/icu-4.8.1-fix_nan.patch
new file mode 100644
index 000000000000..971d66d8bc30
--- /dev/null
+++ b/dev-libs/icu/files/icu-4.8.1-fix_nan.patch
@@ -0,0 +1,68 @@
+https://bugs.gentoo.org/show_bug.cgi?id=380827
+http://bugs.icu-project.org/trac/ticket/8561
+http://bugs.icu-project.org/trac/changeset/30689
+http://code.google.com/p/chromium/issues/detail?id=92847
+
+--- source/i18n/digitlst.cpp.orig 2011-07-19 23:16:00.000000000 +0200
++++ source/i18n/digitlst.cpp 2011-10-12 23:47:08.000000000 +0200
+@@ -60,6 +60,18 @@
+
+ U_NAMESPACE_BEGIN
+
++static void
++loadDecimalChar() {
++ if (gDecimal == 0) {
++ char rep[MAX_DIGITS];
++ // For machines that decide to change the decimal on you,
++ // and try to be too smart with localization.
++ // This normally should be just a '.'.
++ sprintf(rep, "%+1.1f", 1.0);
++ gDecimal = rep[2];
++ }
++}
++
+ // -------------------------------------
+ // default constructor
+
+@@ -408,15 +420,6 @@
+ }
+ DigitList *nonConstThis = const_cast<DigitList *>(this);
+
+- if (gDecimal == 0) {
+- char rep[MAX_DIGITS];
+- // For machines that decide to change the decimal on you,
+- // and try to be too smart with localization.
+- // This normally should be just a '.'.
+- sprintf(rep, "%+1.1f", 1.0);
+- gDecimal = rep[2];
+- }
+-
+ if (isZero()) {
+ nonConstThis->fDouble = 0.0;
+ if (decNumberIsNegative(fDecNumber)) {
+@@ -451,6 +454,7 @@
+ }
+ U_ASSERT(uprv_strlen(&s[0]) < MAX_DBL_DIGITS+18);
+
++ loadDecimalChar();
+ if (gDecimal != '.') {
+ char *decimalPt = strchr(s, '.');
+ if (decimalPt != NULL) {
+@@ -741,6 +745,17 @@
+ sprintf(rep, "%+1.*e", MAX_DBL_DIGITS - 1, source);
+ U_ASSERT(uprv_strlen(rep) < sizeof(rep));
+
++ // uprv_decNumberFromString() will parse the string expecting '.' as a
++ // decimal separator, however sprintf() can use ',' in certain locales.
++ // Overwrite a different decimal separator with '.' here before proceeding.
++ loadDecimalChar();
++ if (gDecimal != '.') {
++ char *decimalPt = strchr(rep, gDecimal);
++ if (decimalPt != NULL) {
++ *decimalPt = '.';
++ }
++ }
++
+ // Create a decNumber from the string.
+ uprv_decNumberFromString(fDecNumber, rep, &fContext);
+ uprv_decNumberTrim(fDecNumber);
diff --git a/dev-libs/icu/icu-4.8.1-r2.ebuild b/dev-libs/icu/icu-4.8.1-r2.ebuild
new file mode 100644
index 000000000000..5cbd8276bad2
--- /dev/null
+++ b/dev-libs/icu/icu-4.8.1-r2.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/icu/icu-4.8.1-r2.ebuild,v 1.1 2011/10/12 22:04:09 phajdan.jr Exp $
+
+EAPI="3"
+
+inherit versionator
+
+MAJOR_VERSION="$(get_version_component_range 1)"
+MINOR_VERSION="$(get_version_component_range 2)"
+if [[ "${PV}" =~ ^[[:digit:]]+\.[[:digit:]]+(_rc[[:digit:]]*)?$ ]]; then
+ MICRO_VERSION="0"
+else
+ MICRO_VERSION="$(get_version_component_range 3)"
+fi
+
+DESCRIPTION="International Components for Unicode"
+HOMEPAGE="http://www.icu-project.org/"
+
+BASE_URI="http://download.icu-project.org/files/icu4c/${PV/_/}"
+SRC_ARCHIVE="icu4c-${PV//./_}-src.tgz"
+DOCS_ARCHIVE="icu4c-${PV//./_}-docs.zip"
+
+SRC_URI="${BASE_URI}/${SRC_ARCHIVE}
+ doc? ( ${BASE_URI}/${DOCS_ARCHIVE} )"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="debug doc examples static-libs"
+
+DEPEND="doc? ( app-arch/unzip )"
+RDEPEND=""
+
+S="${WORKDIR}/${PN}/source"
+
+QA_DT_NEEDED="/usr/lib.*/libicudata\.so\.${MAJOR_VERSION}${MINOR_VERSION}\.${MICRO_VERSION}"
+
+src_unpack() {
+ unpack "${SRC_ARCHIVE}"
+ if use doc; then
+ mkdir docs
+ pushd docs > /dev/null
+ unpack "${DOCS_ARCHIVE}"
+ popd > /dev/null
+ fi
+}
+
+src_prepare() {
+ # Do not hardcode flags into icu-config.
+ # https://ssl.icu-project.org/trac/ticket/6102
+ local variable
+ for variable in CFLAGS CPPFLAGS CXXFLAGS FFLAGS LDFLAGS; do
+ sed -i -e "/^${variable} =.*/s:@${variable}@::" config/Makefile.inc.in || die "sed failed"
+ done
+
+ epatch "${FILESDIR}/icu-4.8.1-fix_binformat_fonts.patch"
+ epatch "${FILESDIR}/icu-4.8.1-fix_nan.patch"
+}
+
+src_configure() {
+ econf \
+ $(use_enable debug) \
+ $(use_enable examples samples) \
+ $(use_enable static-libs static)
+}
+
+src_test() {
+ # INTLTEST_OPTS: intltest options
+ # -e: Exhaustive testing
+ # -l: Reporting of memory leaks
+ # -v: Increased verbosity
+ # IOTEST_OPTS: iotest options
+ # -e: Exhaustive testing
+ # -v: Increased verbosity
+ # CINTLTST_OPTS: cintltst options
+ # -e: Exhaustive testing
+ # -v: Increased verbosity
+ emake -j1 check || die "emake check failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+
+ dohtml ../readme.html
+ dodoc ../unicode-license.txt
+ if use doc; then
+ insinto /usr/share/doc/${PF}/html/api
+ doins -r "${WORKDIR}/docs/"* || die "doins failed"
+ fi
+}