dev-libs/libutf8proc: fix tests
authorAkinori Hattori <hattya@gentoo.org>
Wed, 6 May 2020 12:35:55 +0000 (21:35 +0900)
committerAkinori Hattori <hattya@gentoo.org>
Wed, 6 May 2020 12:43:00 +0000 (21:43 +0900)
Package-Manager: Portage-2.3.89, Repoman-2.3.20
Signed-off-by: Akinori Hattori <hattya@gentoo.org>
dev-libs/libutf8proc/files/libutf8proc-2.3.0-tests-nofetch.patch [deleted file]
dev-libs/libutf8proc/files/libutf8proc-grapheme-test.patch [new file with mode: 0644]
dev-libs/libutf8proc/libutf8proc-2.4.0.ebuild

diff --git a/dev-libs/libutf8proc/files/libutf8proc-2.3.0-tests-nofetch.patch b/dev-libs/libutf8proc/files/libutf8proc-2.3.0-tests-nofetch.patch
deleted file mode 100644 (file)
index f438fdd..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-diff --git a/data/Makefile b/data/Makefile
-index f5d1dd9..60c09e3 100644
---- a/data/Makefile
-+++ b/data/Makefile
-@@ -10,6 +10,7 @@ PERL=perl
- MAKE=make
- JULIA=julia
- CURLFLAGS = --retry 5 --location
-+UDATA=${EPREFIX}/usr/share/unicode-data
- .PHONY: clean
-@@ -25,6 +26,7 @@ CharWidths.txt: charwidths.jl EastAsianWidth.txt
- UNICODE_VERSION=12.0.0
- UnicodeData.txt:
-+      cp $(UDATA)/$@ $@
-       $(CURL) $(CURLFLAGS) -o $@ -O http://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/UnicodeData.txt
- EastAsianWidth.txt:
-@@ -43,10 +45,10 @@ CaseFolding.txt:
-       $(CURL) $(CURLFLAGS) -o $@ -O $(URLCACHE)http://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/CaseFolding.txt
- NormalizationTest.txt:
--      $(CURL) $(CURLFLAGS) -o $@ -O $(URLCACHE)http://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/NormalizationTest.txt
-+      cp $(UDATA)/$@ $@
- GraphemeBreakTest.txt:
--      $(CURL) $(CURLFLAGS) $(URLCACHE)http://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/auxiliary/GraphemeBreakTest.txt | $(PERL) -pe 's,÷,/,g;s,×,+,g' > $@
-+      cat $(UDATA)/auxiliary/$@ | $(PERL) -pe 's,÷,/,g;s,×,+,g' > $@
- emoji-data.txt:
-       $(CURL) $(CURLFLAGS) -o $@ -O $(URLCACHE)http://unicode.org/Public/emoji/`echo $(UNICODE_VERSION) | cut -d. -f1-2`/emoji-data.txt
diff --git a/dev-libs/libutf8proc/files/libutf8proc-grapheme-test.patch b/dev-libs/libutf8proc/files/libutf8proc-grapheme-test.patch
new file mode 100644 (file)
index 0000000..64ebc26
--- /dev/null
@@ -0,0 +1,23 @@
+https://github.com/JuliaStrings/utf8proc/commit/11bb3d9dc796bb006c79c2962a7d19abcadfb3df
+
+Author: Steven G. Johnson <stevenj@alum.mit.edu>
+
+--- a/test/graphemetest.c
++++ b/test/graphemetest.c
+@@ -18,12 +18,12 @@ int main(int argc, char **argv)
+         while (buf[bi]) {
+             bi = skipspaces(buf, bi);
+-            if (buf[bi] == '/') { /* grapheme break */
++            if ((uint8_t)buf[bi] == 0xc3 && (uint8_t)buf[bi+1] == 0xb7) { /* U+00f7 = grapheme break */
+                 src[si++] = '/';
+-                bi++;
++                bi += 2;
+             }
+-            else if (buf[bi] == '+') { /* no break */
+-                bi++;
++            else if ((uint8_t)buf[bi] == 0xc3 && (uint8_t)buf[bi+1] == 0x97) { /* U+00d7 = no break */
++                bi += 2;
+             }
+             else if (buf[bi] == '#') { /* start of comments */
+                 break;
index 65b7342ae30b7c18f268eb7295cc6718ad7970d6..7998589fb90db8f45d5dcc6b13c1a1cfbf43aee4 100644 (file)
@@ -22,8 +22,7 @@ S="${WORKDIR}/${P#lib}"
 PATCHES=(
        # Don't build or install static libs
        "${FILESDIR}/${PN}-2.3.0-no-static.patch"
-       # use app-i18n/unicode-data for test data instead of curl
-       "${FILESDIR}/${PN}-2.3.0-tests-nofetch.patch"
+       "${FILESDIR}"/${PN}-grapheme-test.patch
 )
 
 src_compile() {
@@ -48,5 +47,7 @@ src_install() {
 }
 
 src_test() {
+       cp "${EPREFIX}"/usr/share/unicode-data/{Normalization,auxiliary/GraphemeBreak}Test.txt data || die
+
        emake CC="$(tc-getCC)" check
 }