summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkinori Hattori <hattya@gentoo.org>2020-05-06 21:35:55 +0900
committerAkinori Hattori <hattya@gentoo.org>2020-05-06 21:43:00 +0900
commit3a3613389f96edbe77799355d947bd27e2f43a8f (patch)
tree384cbc778ed3a7be2a65c72a21fc2de121118664 /dev-libs/libutf8proc
parentmail-client/thunderbird-bin: security cleanup (diff)
downloadgentoo-3a3613389f96edbe77799355d947bd27e2f43a8f.tar.gz
gentoo-3a3613389f96edbe77799355d947bd27e2f43a8f.tar.bz2
gentoo-3a3613389f96edbe77799355d947bd27e2f43a8f.zip
dev-libs/libutf8proc: fix tests
Package-Manager: Portage-2.3.89, Repoman-2.3.20 Signed-off-by: Akinori Hattori <hattya@gentoo.org>
Diffstat (limited to 'dev-libs/libutf8proc')
-rw-r--r--dev-libs/libutf8proc/files/libutf8proc-2.3.0-tests-nofetch.patch33
-rw-r--r--dev-libs/libutf8proc/files/libutf8proc-grapheme-test.patch23
-rw-r--r--dev-libs/libutf8proc/libutf8proc-2.4.0.ebuild5
3 files changed, 26 insertions, 35 deletions
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
index f438fdd9779b..000000000000
--- a/dev-libs/libutf8proc/files/libutf8proc-2.3.0-tests-nofetch.patch
+++ /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
index 000000000000..64ebc26f671e
--- /dev/null
+++ b/dev-libs/libutf8proc/files/libutf8proc-grapheme-test.patch
@@ -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;
diff --git a/dev-libs/libutf8proc/libutf8proc-2.4.0.ebuild b/dev-libs/libutf8proc/libutf8proc-2.4.0.ebuild
index 65b7342ae30b..7998589fb90d 100644
--- a/dev-libs/libutf8proc/libutf8proc-2.4.0.ebuild
+++ b/dev-libs/libutf8proc/libutf8proc-2.4.0.ebuild
@@ -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
}