dev-libs/libutf8proc: don't access internet during tests
authorVirgil Dupras <vdupras@gentoo.org>
Sun, 21 Apr 2019 19:17:24 +0000 (15:17 -0400)
committerVirgil Dupras <vdupras@gentoo.org>
Sun, 21 Apr 2019 19:18:46 +0000 (15:18 -0400)
Patch the test data makefile to use app-i18n/unicode-data instead of
fetching unicode data from the internet.

Closes: https://bugs.gentoo.org/682812
Signed-off-by: Virgil Dupras <vdupras@gentoo.org>
Package-Manager: Portage-2.3.62, Repoman-2.3.11

dev-libs/libutf8proc/files/libutf8proc-2.3.0-tests-nofetch.patch [new file with mode: 0644]
dev-libs/libutf8proc/libutf8proc-2.3.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
new file mode 100644 (file)
index 0000000..5750b43
--- /dev/null
@@ -0,0 +1,33 @@
+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=/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
index ea48c910201a4b241ff04209acdee8e520f8e8d1..3b3b3a532031e66859206895033d098b8e2eaa07 100644 (file)
@@ -13,13 +13,17 @@ SRC_URI="https://github.com/JuliaStrings/utf8proc/archive/v${PV}.tar.gz -> ${P}.
 LICENSE="MIT"
 SLOT="0/${PV}"
 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
-IUSE=""
+IUSE="test"
 
 S="${WORKDIR}/${MY_P}"
 
+BDEPEND="test? ( =app-i18n/unicode-data-12.0* )"
+
 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"
 )
 
 src_install() {