public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Anthony G. Basile" <blueness@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/hardened-dev:uclibc commit in: dev-libs/icu/, dev-libs/icu/files/
Date: Wed, 26 Sep 2012 22:29:48 +0000 (UTC)	[thread overview]
Message-ID: <1348698572.af57bd45f2a3cf577ad528b77e5c37dc8d0ac9ff.blueness@gentoo> (raw)

commit:     af57bd45f2a3cf577ad528b77e5c37dc8d0ac9ff
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 26 22:29:32 2012 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Wed Sep 26 22:29:32 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=af57bd45

dev-libs/icu: fix timezone glibc-ism

---
 .../icu/files/icu-4.8.1-fix_binformat_fonts.patch  |   14 +++
 dev-libs/icu/files/icu-4.8.1.1-fix_ltr.patch       |   61 +++++++++++++
 .../icu/files/icu-49.1.2-fix_uclibc_timezone.patch |   12 +++
 dev-libs/icu/files/icu-49.1.2-platforms.patch      |   59 +++++++++++++
 dev-libs/icu/icu-49.1.2-r99.ebuild                 |   92 ++++++++++++++++++++
 dev-libs/icu/metadata.xml                          |    9 ++
 6 files changed, 247 insertions(+), 0 deletions(-)

diff --git a/dev-libs/icu/files/icu-4.8.1-fix_binformat_fonts.patch b/dev-libs/icu/files/icu-4.8.1-fix_binformat_fonts.patch
new file mode 100644
index 0000000..6e1a687
--- /dev/null
+++ b/dev-libs/icu/files/icu-4.8.1-fix_binformat_fonts.patch
@@ -0,0 +1,14 @@
+https://ssl.icu-project.org/trac/ticket/8800
+--- layout/LookupProcessor.cpp
++++ layout/LookupProcessor.cpp
+@@ -201,7 +201,9 @@
+ 
+     if (requiredFeatureIndex != 0xFFFF) {
+         requiredFeatureTable = featureListTable->getFeatureTable(requiredFeatureIndex, &requiredFeatureTag);
+-        featureReferences += SWAPW(featureTable->lookupCount);
++	if (requiredFeatureTable) {
++	        featureReferences += SWAPW(requiredFeatureTable->lookupCount);
++	}
+     }
+ 
+     lookupOrderArray = LE_NEW_ARRAY(le_uint16, featureReferences);

diff --git a/dev-libs/icu/files/icu-4.8.1.1-fix_ltr.patch b/dev-libs/icu/files/icu-4.8.1.1-fix_ltr.patch
new file mode 100644
index 0000000..15df6e2
--- /dev/null
+++ b/dev-libs/icu/files/icu-4.8.1.1-fix_ltr.patch
@@ -0,0 +1,61 @@
+https://ssl.icu-project.org/trac/ticket/8764
+--- layout/LESwaps.h
++++ layout/LESwaps.h
+@@ -45,8 +45,8 @@
+ public:
+ 
+     /**
+-     * Reads a big-endian 16-bit word and returns a native-endian value.
+-     * No-op on a big-endian platform, byte-swaps on a little-endian platform.
++     * This method does the byte swap required on little endian platforms
++     * to correctly access a (16-bit) word.
+      *
+      * @param value - the word to be byte swapped
+      *
+@@ -56,21 +56,12 @@
+      */
+     static le_uint16 swapWord(le_uint16 value)
+     {
+-#if (defined(U_IS_BIG_ENDIAN) && U_IS_BIG_ENDIAN) || \
+-    (defined(BYTE_ORDER) && defined(BIG_ENDIAN) && (BYTE_ORDER == BIG_ENDIAN)) || \
+-    defined(__BIG_ENDIAN__)
+-        // Fastpath when we know that the platform is big-endian.
+-        return value;
+-#else
+-        // Reads a big-endian value on any platform.
+-        const le_uint8 *p = reinterpret_cast<const le_uint8 *>(&value);
+-        return (le_uint16)((p[0] << 8) | p[1]);
+-#endif
++        return (le_uint16)((value << 8) | (value >> 8));
+     };
+ 
+     /**
+-     * Reads a big-endian 32-bit word and returns a native-endian value.
+-     * No-op on a big-endian platform, byte-swaps on a little-endian platform.
++     * This method does the byte swapping required on little endian platforms
++     * to correctly access a (32-bit) long.
+      *
+      * @param value - the long to be byte swapped
+      *
+@@ -80,16 +71,11 @@
+      */
+     static le_uint32 swapLong(le_uint32 value)
+     {
+-#if (defined(U_IS_BIG_ENDIAN) && U_IS_BIG_ENDIAN) || \
+-    (defined(BYTE_ORDER) && defined(BIG_ENDIAN) && (BYTE_ORDER == BIG_ENDIAN)) || \
+-    defined(__BIG_ENDIAN__)
+-        // Fastpath when we know that the platform is big-endian.
+-        return value;
+-#else
+-        // Reads a big-endian value on any platform.
+-        const le_uint8 *p = reinterpret_cast<const le_uint8 *>(&value);
+-        return (le_uint32)((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]);
+-#endif
++        return (le_uint32)(
++            (value << 24) |
++            ((value << 8) & 0xff0000) |
++            ((value >> 8) & 0xff00) |
++            (value >> 24));
+     };
+ 
+ private:

diff --git a/dev-libs/icu/files/icu-49.1.2-fix_uclibc_timezone.patch b/dev-libs/icu/files/icu-49.1.2-fix_uclibc_timezone.patch
new file mode 100644
index 0000000..f92bdac
--- /dev/null
+++ b/dev-libs/icu/files/icu-49.1.2-fix_uclibc_timezone.patch
@@ -0,0 +1,12 @@
+diff -Naur icu.orig/source/common/putil.cpp icu/source/common/putil.cpp
+--- icu.orig/source/common/putil.cpp	2012-06-01 10:52:46.000000000 -0400
++++ icu/source/common/putil.cpp	2012-09-26 18:22:04.074820300 -0400
+@@ -633,7 +633,7 @@
+ U_CAPI int32_t U_EXPORT2
+ uprv_timezone()
+ {
+-#ifdef U_TIMEZONE
++#if defined(U_TIMEZONE) && !defined(__UCLIBC__)
+     return U_TIMEZONE;
+ #else
+     time_t t, t1, t2;

diff --git a/dev-libs/icu/files/icu-49.1.2-platforms.patch b/dev-libs/icu/files/icu-49.1.2-platforms.patch
new file mode 100644
index 0000000..1aaf580
--- /dev/null
+++ b/dev-libs/icu/files/icu-49.1.2-platforms.patch
@@ -0,0 +1,59 @@
+https://ssl.icu-project.org/trac/ticket/9286
+https://ssl.icu-project.org/trac/ticket/9365
+https://ssl.icu-project.org/trac/changeset/31780
+https://ssl.icu-project.org/trac/changeset/31971
+https://ssl.icu-project.org/trac/changeset/32020
+https://ssl.icu-project.org/trac/changeset/32023
+
+--- common/putilimp.h
++++ common/putilimp.h
+@@ -117,6 +117,8 @@
+ #   define U_TIMEZONE __timezone
+ #elif U_PLATFORM_USES_ONLY_WIN32_API
+ #   define U_TIMEZONE _timezone
++#elif U_PLATFORM == U_PF_BSD && !defined(__NetBSD__)
++   /* not defined */
+ #elif U_PLATFORM == U_PF_OS400
+    /* not defined */
+ #else
+--- common/unicode/platform.h
++++ common/unicode/platform.h
+@@ -131,7 +131,7 @@
+ #   include <android/api-level.h>
+ #elif defined(linux) || defined(__linux__) || defined(__linux)
+ #   define U_PLATFORM U_PF_LINUX
+-#elif defined(BSD) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
++#elif defined(BSD) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__MirBSD__)
+ #   define U_PLATFORM U_PF_BSD
+ #elif defined(sun) || defined(__sun)
+     /* Check defined(__SVR4) || defined(__svr4__) to distinguish Solaris from SunOS? */
+@@ -268,6 +268,9 @@
+ #elif U_PLATFORM == U_PF_SOLARIS
+     /* Solaris has inttypes.h but not stdint.h. */
+ #   define U_HAVE_STDINT_H 0
++#elif U_PLATFORM == U_PF_AIX && !defined(_AIX51) && defined(_POWER)
++    /* PPC AIX <= 4.3 has inttypes.h but not stdint.h. */
++#   define U_HAVE_STDINT_H 0
+ #else
+ #   define U_HAVE_STDINT_H 1
+ #endif
+@@ -283,6 +286,9 @@
+ #elif U_PLATFORM == U_PF_SOLARIS
+     /* Solaris has inttypes.h but not stdint.h. */
+ #   define U_HAVE_INTTYPES_H 1
++#elif U_PLATFORM == U_PF_AIX && !defined(_AIX51) && defined(_POWER)
++    /* PPC AIX <= 4.3 has inttypes.h but not stdint.h. */
++#   define U_HAVE_INTTYPES_H 1
+ #else
+     /* Most platforms have both inttypes.h and stdint.h, or neither. */
+ #   define U_HAVE_INTTYPES_H U_HAVE_STDINT_H
+@@ -352,6 +358,9 @@
+ #elif defined(_PA_RISC1_0) || defined(_PA_RISC1_1) || defined(_PA_RISC2_0)
+     /* HPPA do not appear to predefine any endianness macros. */
+ #   define U_IS_BIG_ENDIAN 1
++#elif defined(sparc) || defined(__sparc) || defined(__sparc__)
++    /* Some sparc based systems (e.g. Linux) do not predefine any endianness macros. */
++#   define U_IS_BIG_ENDIAN 1
+ #else
+ #   define U_IS_BIG_ENDIAN 0
+ #endif

diff --git a/dev-libs/icu/icu-49.1.2-r99.ebuild b/dev-libs/icu/icu-49.1.2-r99.ebuild
new file mode 100644
index 0000000..c97814f
--- /dev/null
+++ b/dev-libs/icu/icu-49.1.2-r99.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/icu/icu-49.1.2.ebuild,v 1.7 2012/08/04 13:39:56 ago Exp $
+
+EAPI="4"
+
+inherit eutils versionator
+
+MAJOR_VERSION="$(get_version_component_range 1)"
+if [[ "${PV}" =~ ^[[:digit:]]+_rc[[:digit:]]*$ ]]; then
+	MINOR_VERSION="0"
+else
+	MINOR_VERSION="$(get_version_component_range 2)"
+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 ~amd64-fbsd ~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}.*"
+
+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}/${PN}-4.8.1-fix_binformat_fonts.patch"
+	epatch "${FILESDIR}/${PN}-4.8.1.1-fix_ltr.patch"
+	epatch "${FILESDIR}/${P}-platforms.patch"
+	epatch "${FILESDIR}/${P}-fix_uclibc_timezone.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
+}
+
+src_install() {
+	emake DESTDIR="${D}" install
+
+	dohtml ../readme.html
+	dodoc ../unicode-license.txt
+	if use doc; then
+		insinto /usr/share/doc/${PF}/html/api
+		doins -r "${WORKDIR}/docs/"*
+	fi
+}

diff --git a/dev-libs/icu/metadata.xml b/dev-libs/icu/metadata.xml
new file mode 100644
index 0000000..af64c71
--- /dev/null
+++ b/dev-libs/icu/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+    <herd>proxy-maintainers</herd>
+	<maintainer>
+		<email>arfrever.fta@gmail.com</email>
+		<name>Arfrever Frehtes Taifersar Arahesis</name>
+	</maintainer>
+</pkgmetadata>


             reply	other threads:[~2012-09-26 22:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-26 22:29 Anthony G. Basile [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-04-06 15:49 [gentoo-commits] proj/hardened-dev:uclibc commit in: dev-libs/icu/, dev-libs/icu/files/ Anthony G. Basile

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1348698572.af57bd45f2a3cf577ad528b77e5c37dc8d0ac9ff.blueness@gentoo \
    --to=blueness@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox