blob: be686cd1132fc5769ed842a5dbd0d488da800914 (
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
43
44
45
46
47
48
49
50
51
|
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-go/go-text/go-text-9999.ebuild,v 1.2 2015/05/21 05:31:35 zmedico Exp $
EAPI=5
inherit git-r3
KEYWORDS=""
DESCRIPTION="Go text processing support"
GO_PN=golang.org/x/${PN##*-}
HOMEPAGE="https://godoc.org/${GO_PN}"
EGIT_REPO_URI="https://go.googlesource.com/${PN##*-}"
LICENSE="BSD"
SLOT="0"
IUSE=""
DEPEND=">=dev-lang/go-1.4"
RDEPEND=""
S="${WORKDIR}/src/${GO_PN}"
EGIT_CHECKOUT_DIR="${S}"
STRIP_MASK="*.a"
src_compile() {
# Create a writable GOROOT in order to avoid sandbox violations.
GOROOT="${WORKDIR}/goroot"
cp -sR "${EPREFIX}"/usr/lib/go "${GOROOT}" || die
rm -rf "${GOROOT}/src/${GO_PN}" \
"${GOROOT}/pkg/linux_${ARCH}/${GO_PN}" || die
GOROOT="${GOROOT}" GOPATH=${WORKDIR} go install -v -x -work ${GO_PN}/... || die
}
src_test() {
GOROOT="${GOROOT}" GOPATH=${WORKDIR} \
go test -run "^(Example.*|"$(
echo -n 'Test(Flush|Insert|Decomposition|Composition|IterNext|'
echo -n 'IterSegmentation|DecomposeSegment|FirstBoundary|'
echo -n 'DecomposeToLastBoundary|LastBoundary|QuickSpan|IsNormal|'
echo -n 'IsNormalString|Append|AppendString|Bytes|String|Reader|'
echo -n 'Writer|Transform|TransformNorm|CharacterByCharacter|'
echo -n 'StandardTests|Performance|PlaceHolder|ExampleIter|Merge|'
echo -n 'Tables|Ambiguous|FoldSingleRunes|Fold|WidenSingleRunes|'
echo -n 'Widen|NarrowSingleRunes|Narrow))$') \
-x -v ${GO_PN}/... || die $?
}
src_install() {
exeinto /usr/lib/go/bin
doexe "${WORKDIR}"/bin/*
insinto /usr/lib/go
find "${WORKDIR}"/{pkg,src} -name '.git*' -exec rm -rf {} \; 2>/dev/null
doins -r "${WORKDIR}"/{pkg,src}
}
|