diff options
author | Michael Hansen | 2017-05-02 17:54:14 -0700 |
---|---|---|
committer | Michael Hansen | 2017-05-02 17:54:14 -0700 |
commit | 45d4fa08da73a5f27a916d737146340b85725b83 (patch) | |
tree | 9f6423c6fb8a6b591b43b68bb22b3fd842b57b91 | |
parent | bb9fbb2639a339a7313713b6e55d5033344affff (diff) | |
download | aur-45d4fa08da73a5f27a916d737146340b85725b83.tar.gz |
Add patch for ICU 59
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 9 | ||||
-rw-r--r-- | icu59.patch | 100 |
3 files changed, 111 insertions, 4 deletions
@@ -1,9 +1,9 @@ # Generated by mksrcinfo v8 -# Thu Apr 27 21:36:51 UTC 2017 +# Wed May 3 00:53:45 UTC 2017 pkgbase = swift-language pkgdesc = The Swift programming language and debugger pkgver = 3.1.1 - pkgrel = 1 + pkgrel = 2 url = http://swift.org/ arch = i686 arch = x86_64 @@ -40,6 +40,7 @@ pkgbase = swift-language source = swift-corelibs-libdispatch-3.1.1-RELEASE.tar.gz::https://github.com/apple/swift-corelibs-libdispatch/archive/swift-3.1.1-RELEASE.tar.gz source = swift-integration-tests-3.1.1-RELEASE.tar.gz::https://github.com/apple/swift-integration-tests/archive/swift-3.1.1-RELEASE.tar.gz source = sourcekit_link_order.patch + source = icu59.patch sha256sums = 03eb54e7f89109a85c9b2a9bfdee88d2d7e1bdef73ae0385b30fe4661efaf407 sha256sums = fc6ac7c0c6afff344a8d4e5299b7417f414f1499cf374953e06c339d8177fc26 sha256sums = ed41f1231bae030a412455491a5244ede53a4761617194b2dda573f5776361ad @@ -52,6 +53,7 @@ pkgbase = swift-language sha256sums = b711a5afaf027ac2cfefc144cd3760dd1d6a99689864be6ecb73a62cbb21b04f sha256sums = fff8f596a7104ba5fc202dc5a80683032a33a298cf9ede7fdd12f7faf629a45c sha256sums = c9aa6e167a57ed31002471204d39bf24bb4ebecc38322571515ac73f02b237b6 + sha256sums = 3fedb626b375f6ad8b4601abd336f4560718a9c9134716f0c3a4e823b8c12857 pkgname = swift pkgdesc = The Swift programming language compiler and tools @@ -4,7 +4,7 @@ pkgbase=swift-language pkgname=(swift swift-lldb) _swiftver=3.1.1-RELEASE pkgver=${_swiftver//-RELEASE/} -pkgrel=1 +pkgrel=2 pkgdesc="The Swift programming language and debugger" arch=('i686' 'x86_64') url="http://swift.org/" @@ -27,6 +27,7 @@ source=( "swift-corelibs-libdispatch-${_swiftver}.tar.gz::https://github.com/apple/swift-corelibs-libdispatch/archive/swift-${_swiftver}.tar.gz" "swift-integration-tests-${_swiftver}.tar.gz::https://github.com/apple/swift-integration-tests/archive/swift-${_swiftver}.tar.gz" "sourcekit_link_order.patch" + "icu59.patch" ) sha256sums=('03eb54e7f89109a85c9b2a9bfdee88d2d7e1bdef73ae0385b30fe4661efaf407' 'fc6ac7c0c6afff344a8d4e5299b7417f414f1499cf374953e06c339d8177fc26' @@ -39,7 +40,8 @@ sha256sums=('03eb54e7f89109a85c9b2a9bfdee88d2d7e1bdef73ae0385b30fe4661efaf407' '86f1d57a38661a8186104440369a1e3657093ebc37716a31a0e539eadfad60e3' 'b711a5afaf027ac2cfefc144cd3760dd1d6a99689864be6ecb73a62cbb21b04f' 'fff8f596a7104ba5fc202dc5a80683032a33a298cf9ede7fdd12f7faf629a45c' - 'c9aa6e167a57ed31002471204d39bf24bb4ebecc38322571515ac73f02b237b6') + 'c9aa6e167a57ed31002471204d39bf24bb4ebecc38322571515ac73f02b237b6' + '3fedb626b375f6ad8b4601abd336f4560718a9c9134716f0c3a4e823b8c12857') prepare() { # Use python2 where appropriate @@ -69,6 +71,9 @@ prepare() { # Fix library link order for sourcekitd-test ( cd "${srcdir}/swift" && patch -p1 -i "${srcdir}/sourcekit_link_order.patch" ) + + # ICU 59 changed the type of UChar to char16_t + ( cd "${srcdir}/swift" && patch -p1 -i "${srcdir}/icu59.patch" ) } _common_build_params=( diff --git a/icu59.patch b/icu59.patch new file mode 100644 index 000000000000..1fe69f72b626 --- /dev/null +++ b/icu59.patch @@ -0,0 +1,100 @@ +diff -rupN a/stdlib/public/stubs/UnicodeNormalization.cpp b/stdlib/public/stubs/UnicodeNormalization.cpp +--- a/stdlib/public/stubs/UnicodeNormalization.cpp 2017-05-02 15:42:43.465819610 -0700 ++++ b/stdlib/public/stubs/UnicodeNormalization.cpp 2017-05-02 15:46:47.788404828 -0700 +@@ -86,11 +86,7 @@ private: + for (unsigned char c = 0; c < 128; ++c) { + UErrorCode ErrorCode = U_ZERO_ERROR; + intptr_t NumCollationElts = 0; +-#if defined(__CYGWIN__) || defined(_MSC_VER) + UChar Buffer[1]; +-#else +- uint16_t Buffer[1]; +-#endif + Buffer[0] = c; + + UCollationElements *CollationIterator = +@@ -127,18 +123,12 @@ swift::_swift_stdlib_unicode_compare_utf + int32_t LeftLength, + const uint16_t *RightString, + int32_t RightLength) { +-#if defined(__CYGWIN__) || defined(_MSC_VER) +- // ICU UChar type is platform dependent. In Cygwin, it is defined +- // as wchar_t which size is 2. It seems that the underlying binary ++ // ICU UChar type is always char16_t as of ICU 59. ++ // It seems that the underlying binary + // representation is same with swift utf16 representation. + return ucol_strcoll(GetRootCollator(), + reinterpret_cast<const UChar *>(LeftString), LeftLength, + reinterpret_cast<const UChar *>(RightString), RightLength); +-#else +- return ucol_strcoll(GetRootCollator(), +- LeftString, LeftLength, +- RightString, RightLength); +-#endif + } + + /// Compares the strings via the Unicode Collation Algorithm on the root locale. +@@ -156,12 +146,8 @@ swift::_swift_stdlib_unicode_compare_utf + UErrorCode ErrorCode = U_ZERO_ERROR; + + uiter_setUTF8(&LeftIterator, reinterpret_cast<const char *>(LeftString), LeftLength); +-#if defined(__CYGWIN__) || defined(_MSC_VER) + uiter_setString(&RightIterator, reinterpret_cast<const UChar *>(RightString), + RightLength); +-#else +- uiter_setString(&RightIterator, RightString, RightLength); +-#endif + + uint32_t Diff = ucol_strcollIter(GetRootCollator(), + &LeftIterator, &RightIterator, &ErrorCode); +@@ -199,14 +185,9 @@ swift::_swift_stdlib_unicode_compare_utf + void *swift::_swift_stdlib_unicodeCollationIterator_create( + const __swift_uint16_t *Str, __swift_uint32_t Length) { + UErrorCode ErrorCode = U_ZERO_ERROR; +-#if defined(__CYGWIN__) || defined(_MSC_VER) + UCollationElements *CollationIterator = ucol_openElements( + GetRootCollator(), reinterpret_cast<const UChar *>(Str), Length, + &ErrorCode); +-#else +- UCollationElements *CollationIterator = ucol_openElements( +- GetRootCollator(), Str, Length, &ErrorCode); +-#endif + if (U_FAILURE(ErrorCode)) { + swift::crash("_swift_stdlib_unicodeCollationIterator_create: ucol_openElements() failed."); + } +@@ -244,17 +225,11 @@ swift::_swift_stdlib_unicode_strToUpper( + const uint16_t *Source, + int32_t SourceLength) { + UErrorCode ErrorCode = U_ZERO_ERROR; +-#if defined(__CYGWIN__) || defined(_MSC_VER) + uint32_t OutputLength = u_strToUpper(reinterpret_cast<UChar *>(Destination), + DestinationCapacity, + reinterpret_cast<const UChar *>(Source), + SourceLength, + "", &ErrorCode); +-#else +- uint32_t OutputLength = u_strToUpper(Destination, DestinationCapacity, +- Source, SourceLength, +- "", &ErrorCode); +-#endif + if (U_FAILURE(ErrorCode) && ErrorCode != U_BUFFER_OVERFLOW_ERROR) { + swift::crash("u_strToUpper: Unexpected error uppercasing unicode string."); + } +@@ -271,17 +246,11 @@ swift::_swift_stdlib_unicode_strToLower( + const uint16_t *Source, + int32_t SourceLength) { + UErrorCode ErrorCode = U_ZERO_ERROR; +-#if defined(__CYGWIN__) || defined(_MSC_VER) + uint32_t OutputLength = u_strToLower(reinterpret_cast<UChar *>(Destination), + DestinationCapacity, + reinterpret_cast<const UChar *>(Source), + SourceLength, + "", &ErrorCode); +-#else +- uint32_t OutputLength = u_strToLower(Destination, DestinationCapacity, +- Source, SourceLength, +- "", &ErrorCode); +-#endif + if (U_FAILURE(ErrorCode) && ErrorCode != U_BUFFER_OVERFLOW_ERROR) { + swift::crash("u_strToLower: Unexpected error lowercasing unicode string."); + } |