summaryrefslogtreecommitdiff
blob: 776f2dc9a1e34b63535403540d76b35b6681ae22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI="7"

inherit toolchain-funcs

DESCRIPTION="A clean C Library for processing UTF-8 Unicode data"
HOMEPAGE="https://github.com/JuliaStrings/utf8proc"
SRC_URI="https://github.com/JuliaStrings/${PN#lib}/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="MIT"
SLOT="0/${PV}"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux"
IUSE="static-libs test"
RESTRICT="!test? ( test )"

BDEPEND="test? ( =app-i18n/unicode-data-13.0* )"
S="${WORKDIR}/${P#lib}"

PATCHES=( "${FILESDIR}"/${PN}-grapheme-test.patch )

src_compile() {
	emake \
		AR="$(tc-getAR)" \
		CC="$(tc-getCC)"
}

src_install() {
	emake \
		DESTDIR="${ED}" \
		prefix="/usr" \
		libdir="/usr/$(get_libdir)" \
		install
	use static-libs || find "${ED}" -name '*.a' -delete || die
}

src_test() {
	cp "${EPREFIX}"/usr/share/unicode-data/{Normalization,auxiliary/GraphemeBreak}Test.txt data || die

	emake CC="$(tc-getCC)" check
}