From c83392e3b749fdb29bdb9cf34001725202a5b778 Mon Sep 17 00:00:00 2001 From: Justin Wind Date: Sat, 20 Feb 2021 14:21:04 -0800 Subject: [PATCH] add dev-libs/icu/icu-65.1 --- dev-libs/icu/Manifest | 8 + .../icu-64.1-data_archive_generation.patch | 14 ++ dev-libs/icu/files/icu-64.2-darwin.patch | 56 +++++ .../icu/files/icu-65.1-integer-overflow.patch | 118 ++++++++++ .../icu/files/icu-65.1-remove-bashisms.patch | 207 ++++++++++++++++++ dev-libs/icu/files/icu-68.1-nonunicode.patch | 12 + dev-libs/icu/icu-65.1-r1.ebuild | 143 ++++++++++++ dev-libs/icu/metadata.xml | 8 + 8 files changed, 566 insertions(+) create mode 100644 dev-libs/icu/Manifest create mode 100644 dev-libs/icu/files/icu-64.1-data_archive_generation.patch create mode 100644 dev-libs/icu/files/icu-64.2-darwin.patch create mode 100644 dev-libs/icu/files/icu-65.1-integer-overflow.patch create mode 100644 dev-libs/icu/files/icu-65.1-remove-bashisms.patch create mode 100644 dev-libs/icu/files/icu-68.1-nonunicode.patch create mode 100644 dev-libs/icu/icu-65.1-r1.ebuild create mode 100644 dev-libs/icu/metadata.xml diff --git a/dev-libs/icu/Manifest b/dev-libs/icu/Manifest new file mode 100644 index 0000000..8ef0f3e --- /dev/null +++ b/dev-libs/icu/Manifest @@ -0,0 +1,8 @@ +AUX icu-64.1-data_archive_generation.patch 473 BLAKE2B 88e77149ec92a316d5e534a6aba8808829ebdef16978fc7130bb4fba80f2bcc7886bafe3c944ff83f56cbf5f02860a35cb0a655722ce305e5e6b05dae15d5254 SHA512 3cf34c7ffaa200f841d605f11ee8145d70f2975be2ae5282a6de2fb5caf6bd8ae67e05cf652b0714023087fa145b4e5fdd4e4287dc331334ec347d957674d291 +AUX icu-64.2-darwin.patch 2136 BLAKE2B 3c54a15e351a97f7c423128e493ed158e56191738b988eb449138c7c88f30c9781286a6a490278f1d8dc59b99725370e63757329bdf180604ec4e9d2b47684ce SHA512 69f281d363c8dab769701a6715cd21ec6958376fa7bac3b5eb5b8b3dc011a354fb439905d68e6aad67129eb01b8a306b184b94a86a5401ded1fe0002e8cdaa5b +AUX icu-65.1-integer-overflow.patch 4191 BLAKE2B 3163c1237e4943c2d46b10381cb16ef3f2abbdec218a4908e843e03c874d1998784156f8d9f61a57754b70c8f9b5f48c369bb25366d66a6ca355ef58c68754d8 SHA512 1e141588cd6f3685cd8e0a4c232c95cacd14d02e1fa8ff87c5159432ec01a95c7dd832050c74d6fb51c01cd4fb2291a374b3df6334f509472a8b2d2f990f2bfb +AUX icu-65.1-remove-bashisms.patch 4963 BLAKE2B fb781741a7a908638876729d573a73e42b7b3f0f3e692b54799fed0dac006ecb731583d90d849ea06be47259a0a236933fa7a78a96b3a8107ee85f916dc2000a SHA512 67e60068c356ca8d93b137eadeef2562ff7d8f38153babc97edd92a2c38d7113396d63d4a09364dacefc612b4b3ea28872a4f767c4f38d3e725943b32f98c5bc +AUX icu-68.1-nonunicode.patch 477 BLAKE2B 5e74142e5adbf8f3fffa23c8fb08657b5b75d12941db39980abea1fff2328c112196b62cc89d521e8cc2a1f7c11b58816401a838bb8fcbe50036e80d3d9e4343 SHA512 5d605cc1cbbd16221603a9509d07713d64201f4fc1a372d29c18f8d49a4618fcd7e0a0bb0a459024a288e5c2c339a9aa0849abe88691ee2cdb24b92c9b61e290 +DIST icu4c-65_1-src.tgz 24267934 BLAKE2B 3c62781201c02a2b1027c9b6db4586f8ccdfb339c0765301a381242d5218f3503a1cdbdc1dc9a1a23ffa657096adc4bf7f0b7fe702461f14beba293a7e82e02c SHA512 8f1ef33e1f4abc9a8ee870331c59f01b473d6da1251a19ce403f822f3e3871096f0791855d39c8f20c612fc49cda2c62c06864aa32ddab2dbd186d2b21ce9139 +EBUILD icu-65.1-r1.ebuild 3462 BLAKE2B 04532a55a94f00586ff0ac3ea92246878182f46831ce7f5196d365448110994c0d9d18679c2f4814191da4694538ebbbd05fd88b6a998406eba8b34378f2a4b5 SHA512 2934d6db4c50c9ea8f479a5d345aabdfb8136a3a2607103178431174da47e0290bd508f6a3e1de71e9c1f384aaa08ccc561551edcb06845740a0be459295e2f9 +MISC metadata.xml 255 BLAKE2B 9b8486730bea2158e8be5cbbe0552c5460d1b18e2236a68e3f11d85ce4eeb96eb0e746f44a10cb7cdcf1bf498190a512ef42f47852c6843b9a3c937ceabc338d SHA512 ac646e8ac676faf0aac283e4be31c5f2b29e98ccf07327073ed05e688ce696caf639bdfea63e4aed141a90e84c0a86892bc717a52b95cdf1739aaa15240013c3 diff --git a/dev-libs/icu/files/icu-64.1-data_archive_generation.patch b/dev-libs/icu/files/icu-64.1-data_archive_generation.patch new file mode 100644 index 0000000..3bb7673 --- /dev/null +++ b/dev-libs/icu/files/icu-64.1-data_archive_generation.patch @@ -0,0 +1,14 @@ +https://bugs.gentoo.org/682170 + +--- a/data/Makefile.in ++++ b/data/Makefile.in +@@ -148,7 +148,8 @@ + # and convert it to the current type. + ifneq ($(ICUDATA_ARCHIVE),) + ICUDATA_SOURCE_ARCHIVE = $(OUTDIR)/$(ICUDATA_PLATFORM_NAME).dat +-$(ICUDATA_SOURCE_ARCHIVE): $(ICUDATA_ARCHIVE) $(OUTDIR) ++$(ICUDATA_SOURCE_ARCHIVE): $(ICUDATA_ARCHIVE) ++ $(MKINSTALLDIRS) $(OUTDIR) + $(INVOKE) $(TOOLBINDIR)/icupkg -t$(ICUDATA_CHAR) $(ICUDATA_ARCHIVE) $(ICUDATA_SOURCE_ARCHIVE) + endif + else diff --git a/dev-libs/icu/files/icu-64.2-darwin.patch b/dev-libs/icu/files/icu-64.2-darwin.patch new file mode 100644 index 0000000..d0029fa --- /dev/null +++ b/dev-libs/icu/files/icu-64.2-darwin.patch @@ -0,0 +1,56 @@ +same as 4.7, but retargetted to apply with eapply + +forward-ported from v58.2 to v64.2 + +--- a/config/mh-darwin ++++ b/config/mh-darwin +@@ -6,6 +6,12 @@ + ## Copyright (c) 1999-2012 International Business Machines Corporation and + ## others. All Rights Reserved. + ++SO_TARGET = $(LIBDIR)/$(LIBICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX).$(SO) ++FINAL_SO_TARGET = $(LIBDIR)/$(LIBICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX).$(SO_TARGET_VERSION).$(SO) ++MIDDLE_SO_TARGET = $(LIBDIR)/$(LIBICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX).$(SO_TARGET_VERSION_MAJOR).$(SO) ++ ++IS_DARWIN = yes ++ + ## Flags for position independent code + SHAREDLIBCFLAGS = -dynamic + SHAREDLIBCXXFLAGS = -dynamic +@@ -33,7 +39,7 @@ + ifeq ($(ENABLE_RPATH),YES) + LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name $(libdir)/$(notdir $(MIDDLE_SO_TARGET)) + else +-LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name $(notdir $(MIDDLE_SO_TARGET)) $(PKGDATA_TRAILING_SPACE) ++LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name $(libdir)/$(notdir $(MIDDLE_SO_TARGET)) + endif + + ## Compiler switch to embed a runtime search path +--- a/stubdata/Makefile.in ++++ b/stubdata/Makefile.in +@@ -34,7 +34,11 @@ + + + ifneq ($(ENABLE_SHARED),) ++ifeq ($(IS_DARWIN),) + SO_TARGET = $(STUBDATA_LIBDIR)$(LIBICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX)$(STUB_SUFFIX).$(SO) ++else ++SO_TARGET = $(LIBDIR)/$(STUBDATA_LIBDIR)$(LIBICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX)$(STUB_SUFFIX).$(SO) ++endif + ALL_SO_TARGETS = $(FINAL_SO_TARGET) $(MIDDLE_SO_TARGET) $(SO_TARGET) $(BATCH_STUB_TARGET) $(SHARED_OBJECT) + endif + +--- a/tools/ctestfw/Makefile.in ++++ b/tools/ctestfw/Makefile.in +@@ -33,7 +33,11 @@ + endif + + ifneq ($(ENABLE_SHARED),) ++ifeq ($(IS_DARWIN),) + SO_TARGET = $(LIBICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX).$(SO) ++else ++SO_TARGET = $(LIBDIR)/$(LIBICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX).$(SO) ++endif + ALL_SO_TARGETS = $(SO_TARGET) $(MIDDLE_SO_TARGET) $(FINAL_SO_TARGET) $(SHARED_OBJECT) + endif + diff --git a/dev-libs/icu/files/icu-65.1-integer-overflow.patch b/dev-libs/icu/files/icu-65.1-integer-overflow.patch new file mode 100644 index 0000000..8e76a9f --- /dev/null +++ b/dev-libs/icu/files/icu-65.1-integer-overflow.patch @@ -0,0 +1,118 @@ +From b7d08bc04a4296982fcef8b6b8a354a9e4e7afca Mon Sep 17 00:00:00 2001 +From: Frank Tang +Date: Sat, 1 Feb 2020 02:39:04 +0000 +Subject: [PATCH] ICU-20958 Prevent SEGV_MAPERR in append + +See #971 +--- + common/unistr.cpp | 6 ++- + test/intltest/ustrtest.cpp | 62 +++++++++++++++++++++++++ + test/intltest/ustrtest.h | 1 + + 3 files changed, 68 insertions(+), 1 deletion(-) + +diff --git a/common/unistr.cpp b/common/unistr.cpp +index 901bb3358ba..077b4d6ef20 100644 +--- a/common/unistr.cpp ++++ b/common/unistr.cpp +@@ -1563,7 +1563,11 @@ UnicodeString::doAppend(const UChar *srcChars, int32_t srcStart, int32_t srcLeng + } + + int32_t oldLength = length(); +- int32_t newLength = oldLength + srcLength; ++ int32_t newLength; ++ if (uprv_add32_overflow(oldLength, srcLength, &newLength)) { ++ setToBogus(); ++ return *this; ++ } + + // Check for append onto ourself + const UChar* oldArray = getArrayStart(); +diff --git a/test/intltest/ustrtest.cpp b/test/intltest/ustrtest.cpp +index b6515ea813c..ad38bdf53a3 100644 +--- a/test/intltest/ustrtest.cpp ++++ b/test/intltest/ustrtest.cpp +@@ -67,6 +67,7 @@ void UnicodeStringTest::runIndexedTest( int32_t index, UBool exec, const char* & + TESTCASE_AUTO(TestWCharPointers); + TESTCASE_AUTO(TestNullPointers); + TESTCASE_AUTO(TestUnicodeStringInsertAppendToSelf); ++ TESTCASE_AUTO(TestLargeAppend); + TESTCASE_AUTO_END; + } + +@@ -2310,3 +2311,64 @@ void UnicodeStringTest::TestUnicodeStringInsertAppendToSelf() { + str.insert(2, sub); + assertEquals("", u"abbcdcde", str); + } ++ ++void UnicodeStringTest::TestLargeAppend() { ++ if(quick) return; ++ ++ IcuTestErrorCode status(*this, "TestLargeAppend"); ++ // Make a large UnicodeString ++ int32_t len = 0xAFFFFFF; ++ UnicodeString str; ++ char16_t *buf = str.getBuffer(len); ++ // A fast way to set buffer to valid Unicode. ++ // 4E4E is a valid unicode character ++ uprv_memset(buf, 0x4e, len * 2); ++ str.releaseBuffer(len); ++ UnicodeString dest; ++ // Append it 16 times ++ // 0xAFFFFFF times 16 is 0xA4FFFFF1, ++ // which is greater than INT32_MAX, which is 0x7FFFFFFF. ++ int64_t total = 0; ++ for (int32_t i = 0; i < 16; i++) { ++ dest.append(str); ++ total += len; ++ if (total <= INT32_MAX) { ++ assertFalse("dest is not bogus", dest.isBogus()); ++ } else { ++ assertTrue("dest should be bogus", dest.isBogus()); ++ } ++ } ++ dest.remove(); ++ total = 0; ++ for (int32_t i = 0; i < 16; i++) { ++ dest.append(str); ++ total += len; ++ if (total + len <= INT32_MAX) { ++ assertFalse("dest is not bogus", dest.isBogus()); ++ } else if (total <= INT32_MAX) { ++ // Check that a string of exactly the maximum size works ++ UnicodeString str2; ++ int32_t remain = INT32_MAX - total; ++ char16_t *buf2 = str2.getBuffer(remain); ++ if (buf2 == nullptr) { ++ // if somehow memory allocation fail, return the test ++ return; ++ } ++ uprv_memset(buf2, 0x4e, remain * 2); ++ str2.releaseBuffer(remain); ++ dest.append(str2); ++ total += remain; ++ assertEquals("When a string of exactly the maximum size works", (int64_t)INT32_MAX, total); ++ assertEquals("When a string of exactly the maximum size works", INT32_MAX, dest.length()); ++ assertFalse("dest is not bogus", dest.isBogus()); ++ ++ // Check that a string size+1 goes bogus ++ str2.truncate(1); ++ dest.append(str2); ++ total++; ++ assertTrue("dest should be bogus", dest.isBogus()); ++ } else { ++ assertTrue("dest should be bogus", dest.isBogus()); ++ } ++ } ++} +diff --git a/test/intltest/ustrtest.h b/test/intltest/ustrtest.h +index 218befdcc68..4a356a92c7a 100644 +--- a/test/intltest/ustrtest.h ++++ b/test/intltest/ustrtest.h +@@ -97,6 +97,7 @@ class UnicodeStringTest: public IntlTest { + void TestWCharPointers(); + void TestNullPointers(); + void TestUnicodeStringInsertAppendToSelf(); ++ void TestLargeAppend(); + }; + + #endif diff --git a/dev-libs/icu/files/icu-65.1-remove-bashisms.patch b/dev-libs/icu/files/icu-65.1-remove-bashisms.patch new file mode 100644 index 0000000..f052a06 --- /dev/null +++ b/dev-libs/icu/files/icu-65.1-remove-bashisms.patch @@ -0,0 +1,207 @@ +--- a/config/icu-config-bottom ++++ b/config/icu-config-bottom +@@ -218,65 +218,65 @@ + ;; + + --cflags) +- echo $ECHO_N "${CFLAGS} ${ECHO_C}" ++ printf "%s" "${CFLAGS} " + ;; + + --cc) +- echo $ECHO_N "${CC} ${ECHO_C}" ++ printf "%s" "${CC} " + ;; + + --cxx) +- echo $ECHO_N "${CXX} ${ECHO_C}" ++ printf "%s" "${CXX} " + ;; + + --cxxflags) +- echo $ECHO_N "${CXXFLAGS} ${ECHO_C}" ++ printf "%s" "${CXXFLAGS} " + ;; + + --cppflags) + # Don't echo the -I. - it's unneeded. +- echo $ECHO_N "${CPPFLAGS} ${ECHO_C}" | sed -e 's/-I. //' ++ printf "%s" "${CPPFLAGS} " | sed -e 's/-I. //' + ;; + + --cppflags-searchpath) +- echo $ECHO_N "-I${prefix}/include ${ECHO_C}" ++ printf "%s" "-I${prefix}/include " + ;; + + --cppflags-dynamic) +- echo $ECHO_N "${SHAREDLIBCPPFLAGS} ${ECHO_C}" ++ printf "%s" "${SHAREDLIBCPPFLAGS} " + ;; + + --cxxflags-dynamic) +- echo $ECHO_N "${SHAREDLIBCXXFLAGS} ${ECHO_C}" ++ printf "%s" "${SHAREDLIBCXXFLAGS} " + ;; + + --cflags-dynamic) +- echo $ECHO_N "${SHAREDLIBCFLAGS} ${ECHO_C}" ++ printf "%s" "${SHAREDLIBCFLAGS} " + ;; + + --ldflags-system) +- echo $ECHO_N "${LIBS} ${ECHO_C}" ++ printf "%s" "${LIBS} " + ;; + + --ldflags) +- echo $ECHO_N "${LDFLAGS} ${ICULIBS} ${ECHO_C}" ++ printf "%s" "${LDFLAGS} ${ICULIBS} " + # $RPATH_LDFLAGS + ;; + + --ldflags-libsonly) +- echo $ECHO_N "${ICULIBS_I18N} ${ICULIBS_COMMON} ${ICULIBS_DATA} ${ECHO_C}" ++ printf "%s" "${ICULIBS_I18N} ${ICULIBS_COMMON} ${ICULIBS_DATA} " + ;; + + --ldflags-icuio) +- echo $ECHO_N " ${ICULIBS_ICUIO} ${ECHO_C}" ++ printf "%s" " ${ICULIBS_ICUIO} " + ;; + + --ldflags-obsolete) +- echo $ECHO_N "${ICULIBS_OBSOLETE} ${ECHO_C}" ++ printf "%s" "${ICULIBS_OBSOLETE} " + ;; + + --ldflags-toolutil) +- echo $ECHO_N " ${ICULIBS_TOOLUTIL} ${ECHO_C}" ++ printf "%s" " ${ICULIBS_TOOLUTIL} " + ;; + + --ldflags-layout) +@@ -285,7 +285,7 @@ + ;; + + --ldflags-searchpath) +- echo $ECHO_N "-L${libdir} ${ECHO_C}" ++ printf "%s" "-L${libdir} " + ;; + + --detect-prefix) +@@ -321,47 +321,47 @@ + ;; + + --shared-datadir) +- echo $ECHO_N "${datadir} ${ECHO_C}" ++ printf "%s" "${datadir} " + ;; + + --incfile) +- echo $ECHO_N "${pkglibdir}/Makefile.inc ${ECHO_C}" ++ printf "%s" "${pkglibdir}/Makefile.inc " + ;; + + --incpkgdatafile) +- echo $ECHO_N "${pkglibdir}/pkgdata.inc ${ECHO_C}" ++ printf "%s" "${pkglibdir}/pkgdata.inc " + ;; + + --icudata) +- echo $ECHO_N "${ICUDATA_NAME} ${ECHO_C}" ++ printf "%s" "${ICUDATA_NAME} " + ;; + + --icudata-mode) +- echo $ECHO_N "${PKGDATA_MODE} ${ECHO_C}" ++ printf "%s" "${PKGDATA_MODE} " + ;; + + --icudata-install-dir) +- echo $ECHO_N "${ICUPKGDATA_DIR} ${ECHO_C}" ++ printf "%s" "${ICUPKGDATA_DIR} " + ;; + + --icudatadir) +- echo $ECHO_N "${ICUDATA_DIR} ${ECHO_C}" ++ printf "%s" "${ICUDATA_DIR} " + ;; + + --shlib-c) +- echo $ECHO_N "${SHLIB_c} ${ECHO_C}" ++ printf "%s" "${SHLIB_c} " + ;; + + --shlib-cc) +- echo $ECHO_N "${SHLIB_cc} ${ECHO_C}" ++ printf "%s" "${SHLIB_cc} " + ;; + + --version) +- echo $ECHO_N $VERSION ++ printf "%s" "$VERSION" + ;; + + --unicode-version) +- echo $ECHO_N $UNICODE_VERSION ++ printf "%s" "$UNICODE_VERSION" + ;; + + --host) +--- a/config/Makefile.inc.in ++++ b/config/Makefile.inc.in +@@ -124,12 +124,6 @@ + # with usually. Many applications will want to add $(ICULIBS_I18N) as well. + ICULIBS = $(ICULIBS_BASE) $(ICULIBS_I18N) $(ICULIBS_COMMON) $(ICULIBS_DATA) + +-# Proper echo newline handling is needed in icu-config +-ECHO_N=@ICU_ECHO_N@ +-ECHO_C=@ICU_ECHO_C@ +-# Not currently being used but good to have for proper tab handling +-ECHO_T=@ICU_ECHO_T@ +- + ################################################################## + ################################################################## + # +--- a/configure.ac ++++ b/configure.ac +@@ -26,24 +26,6 @@ + PACKAGE="icu" + AC_SUBST(PACKAGE) + +-# Use custom echo test for newline option +-# Current autoconf (2.65) gives incorrect echo newline option +-# for icu-config +-# This may be removed later - mow (June 17, 2010) +-ICU_ECHO_C= ICU_ECHO_N= ICU_ECHO_T= +-case `/bin/sh -c "echo -n x"` in +--n*) +- case `/bin/sh -c "echo 'x\c'"` in +- *c*) ICU_ECHO_T=' ';; # ECHO_T is single tab character. +- *) ICU_ECHO_C='\c';; +- esac;; +-*) +- ICU_ECHO_N='-n';; +-esac +-AC_SUBST(ICU_ECHO_N) +-AC_SUBST(ICU_ECHO_C) +-AC_SUBST(ICU_ECHO_T) +- + AC_MSG_CHECKING(for ICU version numbers) + + # Get the ICU version from uversion.h or other headers +--- a/icudefs.mk.in ++++ b/icudefs.mk.in +@@ -161,11 +161,6 @@ + ENABLE_STATIC = @ENABLE_STATIC@ + ENABLE_SHARED = @ENABLE_SHARED@ + +-# Echo w/o newline +- +-#ECHO_N = @ICU_ECHO_N@ +-#ECHO_C = @ICU_ECHO_C@ +- + # Commands to compile + COMPILE.c= $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c + COMPILE.cc= $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c diff --git a/dev-libs/icu/files/icu-68.1-nonunicode.patch b/dev-libs/icu/files/icu-68.1-nonunicode.patch new file mode 100644 index 0000000..e02c141 --- /dev/null +++ b/dev-libs/icu/files/icu-68.1-nonunicode.patch @@ -0,0 +1,12 @@ +diff -ruN a/common/unicode/platform.h b/common/unicode/platform.h +--- a/common/unicode/platform.h 2020-10-28 23:21:12.000000000 +0200 ++++ b/common/unicode/platform.h 2020-11-28 20:48:53.223629867 +0200 +@@ -649,7 +649,7 @@ + /* Use the predefined value. */ + #elif U_PLATFORM_IS_LINUX_BASED || U_PLATFORM_IS_DARWIN_BASED || \ + U_PLATFORM == U_PF_EMSCRIPTEN +-# define U_CHARSET_IS_UTF8 1 ++# define U_CHARSET_IS_UTF8 0 + #else + # define U_CHARSET_IS_UTF8 0 + #endif diff --git a/dev-libs/icu/icu-65.1-r1.ebuild b/dev-libs/icu/icu-65.1-r1.ebuild new file mode 100644 index 0000000..987a34d --- /dev/null +++ b/dev-libs/icu/icu-65.1-r1.ebuild @@ -0,0 +1,143 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{6,7} ) +inherit autotools flag-o-matic multilib-minimal python-any-r1 toolchain-funcs + +DESCRIPTION="International Components for Unicode" +HOMEPAGE="http://site.icu-project.org/" +SRC_URI="https://github.com/unicode-org/icu/releases/download/release-${PV//./-}/icu4c-${PV//./_}-src.tgz" + +LICENSE="BSD" + +SLOT="0/${PV}" + +KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt" +IUSE="debug doc examples static-libs" + +BDEPEND="${PYTHON_DEPS} + virtual/pkgconfig + doc? ( app-doc/doxygen[dot] ) +" + +S="${WORKDIR}/${PN}/source" + +MULTILIB_CHOST_TOOLS=( + /usr/bin/icu-config +) + +PATCHES=( + "${FILESDIR}/${PN}-65.1-remove-bashisms.patch" + "${FILESDIR}/${PN}-64.2-darwin.patch" + "${FILESDIR}/${PN}-64.1-data_archive_generation.patch" + "${FILESDIR}/${PN}-65.1-integer-overflow.patch" # bug 710758 +) + +src_prepare() { + default + + local variable + + # Disable renaming as it is stupid thing to do + sed -i \ + -e "s/#define U_DISABLE_RENAMING 0/#define U_DISABLE_RENAMING 1/" \ + common/unicode/uconfig.h || die + + # Fix linking of icudata + sed -i \ + -e "s:LDFLAGSICUDT=-nodefaultlibs -nostdlib:LDFLAGSICUDT=:" \ + config/mh-linux || die + + # Append doxygen configuration to configure + sed -i \ + -e 's:icudefs.mk:icudefs.mk Doxyfile:' \ + configure.ac || die + + eautoreconf +} + +src_configure() { + append-cxxflags -std=c++14 + + if tc-is-cross-compiler; then + mkdir "${WORKDIR}"/host || die + pushd "${WORKDIR}"/host >/dev/null || die + + CFLAGS="" CXXFLAGS="" ASFLAGS="" LDFLAGS="" \ + CC="$(tc-getBUILD_CC)" CXX="$(tc-getBUILD_CXX)" AR="$(tc-getBUILD_AR)" \ + RANLIB="$(tc-getBUILD_RANLIB)" LD="$(tc-getBUILD_LD)" \ + "${S}"/configure --disable-renaming --disable-debug \ + --disable-samples --enable-static || die + emake + + popd >/dev/null || die + fi + + multilib-minimal_src_configure +} + +multilib_src_configure() { + local myeconfargs=( + --disable-renaming + --disable-samples + --disable-layoutex + $(use_enable debug) + $(use_enable static-libs static) + $(multilib_native_use_enable examples samples) + ) + + tc-is-cross-compiler && myeconfargs+=( + --with-cross-build="${WORKDIR}"/host + ) + + # icu tries to use clang by default + tc-export CC CXX + + # make sure we configure with the same shell as we run icu-config + # with, or ECHO_N, ECHO_T and ECHO_C will be wrongly defined + export CONFIG_SHELL="${EPREFIX}/bin/sh" + # probably have no /bin/sh in prefix-chain + [[ -x ${CONFIG_SHELL} ]] || CONFIG_SHELL="${BASH}" + + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}" +} + +multilib_src_compile() { + default + + if multilib_is_native_abi && use doc; then + doxygen -u Doxyfile || die + doxygen Doxyfile || die + fi +} + +multilib_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 VERBOSE="1" check +} + +multilib_src_install() { + default + + if multilib_is_native_abi && use doc; then + docinto html + dodoc -r doc/html/* + fi +} + +multilib_src_install_all() { + einstalldocs + docinto html + dodoc ../readme.html +} diff --git a/dev-libs/icu/metadata.xml b/dev-libs/icu/metadata.xml new file mode 100644 index 0000000..13ce236 --- /dev/null +++ b/dev-libs/icu/metadata.xml @@ -0,0 +1,8 @@ + + + + + office@gentoo.org + Gentoo Office project + + -- 2.45.2