1 |
williamh 15/06/26 14:30:05 |
2 |
|
3 |
Modified: go-tools-9999.ebuild |
4 |
Log: |
5 |
Convert live ebuild to use the new eclasses |
6 |
|
7 |
(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key 0x30C46538) |
8 |
|
9 |
Revision Changes Path |
10 |
1.8 dev-go/go-tools/go-tools-9999.ebuild |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-go/go-tools/go-tools-9999.ebuild?rev=1.8&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-go/go-tools/go-tools-9999.ebuild?rev=1.8&content-type=text/plain |
14 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-go/go-tools/go-tools-9999.ebuild?r1=1.7&r2=1.8 |
15 |
|
16 |
Index: go-tools-9999.ebuild |
17 |
=================================================================== |
18 |
RCS file: /var/cvsroot/gentoo-x86/dev-go/go-tools/go-tools-9999.ebuild,v |
19 |
retrieving revision 1.7 |
20 |
retrieving revision 1.8 |
21 |
diff -u -r1.7 -r1.8 |
22 |
--- go-tools-9999.ebuild 9 Jun 2015 03:17:38 -0000 1.7 |
23 |
+++ go-tools-9999.ebuild 26 Jun 2015 14:30:05 -0000 1.8 |
24 |
@@ -1,97 +1,81 @@ |
25 |
# Copyright 1999-2015 Gentoo Foundation |
26 |
# Distributed under the terms of the GNU General Public License v2 |
27 |
-# $Header: /var/cvsroot/gentoo-x86/dev-go/go-tools/go-tools-9999.ebuild,v 1.7 2015/06/09 03:17:38 zmedico Exp $ |
28 |
+# $Header: /var/cvsroot/gentoo-x86/dev-go/go-tools/go-tools-9999.ebuild,v 1.8 2015/06/26 14:30:05 williamh Exp $ |
29 |
|
30 |
EAPI=5 |
31 |
-inherit git-r3 |
32 |
+inherit golang-build golang-vcs |
33 |
+EGO_PN=golang.org/x/tools/... |
34 |
+EGO_SRC=golang.org/x/tools |
35 |
+ICON_URI="http://golang.org/favicon.ico -> go-favicon.ico" |
36 |
|
37 |
-KEYWORDS="" |
38 |
DESCRIPTION="Go Tools" |
39 |
-MY_PN=${PN##*-} |
40 |
-GO_PN=golang.org/x/${MY_PN} |
41 |
-HOMEPAGE="https://godoc.org/${GO_PN}" |
42 |
-EGIT_REPO_URI="https://go.googlesource.com/${MY_PN}" |
43 |
-SRC_URI="http://golang.org/favicon.ico -> go-favicon.ico" |
44 |
+HOMEPAGE="https://godoc.org/x/tools" |
45 |
+SRC_URI="${ICON_URI}" |
46 |
LICENSE="BSD" |
47 |
SLOT="0" |
48 |
IUSE="" |
49 |
-DEPEND=">=dev-lang/go-1.4 |
50 |
- dev-go/go-net" |
51 |
+DEPEND="dev-go/go-net" |
52 |
RDEPEND="" |
53 |
-S="${WORKDIR}/src/${GO_PN}" |
54 |
-EGIT_CHECKOUT_DIR="${S}" |
55 |
-STRIP_MASK="*.a" |
56 |
- |
57 |
-src_unpack() { |
58 |
- git-r3_src_unpack |
59 |
- cp "${DISTDIR}"/go-favicon.ico "${S}"/godoc/static/favicon.ico || die |
60 |
-} |
61 |
|
62 |
src_prepare() { |
63 |
# disable broken tests |
64 |
- sed -e 's:TestWeb(:_\0:' -i cmd/godoc/godoc_test.go || die |
65 |
- sed -e 's:TestVet(:_\0:' -i cmd/vet/vet_test.go || die |
66 |
- sed -e 's:TestImport(:_\0:' -i go/gcimporter/gcimporter_test.go || die |
67 |
- sed -e 's:TestImportStdLib(:_\0:' -i go/importer/import_test.go || die |
68 |
- sed -e 's:TestStdlib(:_\0:' -i go/loader/stdlib_test.go || die |
69 |
- sed -e 's:TestStdlib(:_\0:' -i go/ssa/stdlib_test.go || die |
70 |
+ sed -e 's:TestWeb(:_\0:' \ |
71 |
+ -i src/${EGO_SRC}/cmd/godoc/godoc_test.go || die |
72 |
+ sed -e 's:TestVet(:_\0:' \ |
73 |
+ -i src/${EGO_SRC}/cmd/vet/vet_test.go || die |
74 |
+ sed -e 's:TestImport(:_\0:' \ |
75 |
+ -i src/${EGO_SRC}/go/gcimporter/gcimporter_test.go || die |
76 |
+ sed -e 's:TestImportStdLib(:_\0:' \ |
77 |
+ -i src/${EGO_SRC}/go/importer/import_test.go || die |
78 |
+ sed -e 's:TestStdlib(:_\0:' \ |
79 |
+ -i src/${EGO_SRC}/go/loader/stdlib_test.go || die |
80 |
+ sed -e 's:TestStdlib(:_\0:' \ |
81 |
+ -i src/${EGO_SRC}/go/ssa/stdlib_test.go || die |
82 |
sed -e 's:TestGorootTest(:_\0:' \ |
83 |
-e 's:TestFoo(:_\0:' \ |
84 |
-e 's:TestTestmainPackage(:_\0:' \ |
85 |
- -i go/ssa/interp/interp_test.go || die |
86 |
+ -i src/${EGO_SRC}/go/ssa/interp/interp_test.go || die |
87 |
sed -e 's:TestBar(:_\0:' \ |
88 |
- -e 's:TestFoo(:_\0:' -i go/ssa/interp/testdata/a_test.go || die |
89 |
- sed -e 's:TestCheck(:_\0:' -i go/types/check_test.go || die |
90 |
+ -e 's:TestFoo(:_\0:' \ |
91 |
+ -i src/${EGO_SRC}/go/ssa/interp/testdata/a_test.go || die |
92 |
+ sed -e 's:TestCheck(:_\0:' \ |
93 |
+ -i src/${EGO_SRC}/go/types/check_test.go || die |
94 |
sed -e 's:TestStdlib(:_\0:' \ |
95 |
-e 's:TestStdFixed(:_\0:' \ |
96 |
- -e 's:TestStdKen(:_\0:' -i go/types/stdlib_test.go || die |
97 |
- sed -e 's:TestRepoRootForImportPath(:_\0:' -i go/vcs/vcs_test.go || die |
98 |
- sed -e 's:TestStdlib(:_\0:' -i refactor/lexical/lexical_test.go || die |
99 |
+ -e 's:TestStdKen(:_\0:' \ |
100 |
+ -i src/${EGO_SRC}/go/types/stdlib_test.go || die |
101 |
+ sed -e 's:TestRepoRootForImportPath(:_\0:' \ |
102 |
+ -i src/${EGO_SRC}/go/vcs/vcs_test.go || die |
103 |
+ sed -e 's:TestStdlib(:_\0:' \ |
104 |
+ -i src/${EGO_SRC}/refactor/lexical/lexical_test.go || die |
105 |
|
106 |
# Add favicon to the godoc web interface (bug 551030) |
107 |
- sed -e 's:"example.html",:\0\n\t"favicon.ico",:' -i godoc/static/makestatic.go || die |
108 |
- sed -e 's:<link type="text/css":<link rel="icon" type="image/png" href="/lib/godoc/favicon.ico">\n\0:' -i \ |
109 |
- godoc/static/godoc.html || die |
110 |
+ cp "${DISTDIR}"/go-favicon.ico "src/${EGO_SRC}/godoc/static/favicon.ico" || |
111 |
+ die |
112 |
+ sed -e 's:"example.html",:\0\n\t"favicon.ico",:' \ |
113 |
+ -i src/${EGO_SRC}/godoc/static/makestatic.go || die |
114 |
+ sed -e 's:<link type="text/css":<link rel="icon" type="image/png" href="/lib/godoc/favicon.ico">\n\0:' \ |
115 |
+ -i src/${EGO_SRC}/godoc/static/godoc.html || die |
116 |
} |
117 |
|
118 |
src_compile() { |
119 |
- # Create a writable GOROOT in order to avoid sandbox violations. |
120 |
- GOROOT="${WORKDIR}/goroot" |
121 |
- cp -sR "${EPREFIX}"/usr/lib/go "${GOROOT}" || die |
122 |
- rm -rf "${GOROOT}/src/${GO_PN}" \ |
123 |
- "${GOROOT}/pkg/linux_${ARCH}/${GO_PN}" || die |
124 |
- |
125 |
# Generate static.go with favicon included |
126 |
- pushd godoc/static >/dev/null |
127 |
- GOROOT="${GOROOT}" GOPATH=${WORKDIR} go run makestatic.go || die |
128 |
+ pushd src/golang.org/x/tools/godoc/static >/dev/null || die |
129 |
+ go run makestatic.go || die |
130 |
popd >/dev/null |
131 |
|
132 |
- GOROOT="${GOROOT}" GOPATH=${WORKDIR} go install -v -x -work ${GO_PN}/... || die |
133 |
-} |
134 |
- |
135 |
-src_test() { |
136 |
- GOROOT="${GOROOT}" GOPATH=${WORKDIR} \ |
137 |
- go test -x -v ${GO_PN}/... || die $? |
138 |
+ golang-build_src_compile |
139 |
} |
140 |
|
141 |
src_install() { |
142 |
- local x |
143 |
- exeinto /usr/lib/go/bin |
144 |
- doexe "${WORKDIR}"/bin/* |
145 |
- |
146 |
- # godoc ends up in ${GOROOT}/bin |
147 |
- dodir /usr/bin |
148 |
- while read -r -d '' x; do |
149 |
- doexe "${x}" |
150 |
- ln "${ED}"usr/{lib/go/bin,bin}/${x##*/} || die |
151 |
- done < <(find "${GOROOT}/bin" -type f -print0) |
152 |
- |
153 |
- # cover and vet end up in ${GOROOT}/pkg/tool/linux_amd64 |
154 |
- exeinto /usr/lib/go/pkg/tool/linux_amd64 |
155 |
- find "${GOROOT}/pkg/tool/linux_amd64" -type f -exec doexe {} \; |
156 |
- |
157 |
- insinto /usr/lib/go |
158 |
- find "${WORKDIR}"/{pkg,src} -name '.git*' -exec rm -rf {} \; 2>/dev/null |
159 |
- insopts -m0644 -p # preserve timestamps for bug 551486 |
160 |
- doins -r "${WORKDIR}"/{pkg,src} |
161 |
+ # Create a writable GOROOT in order to avoid sandbox violations. |
162 |
+ cp -sR "$(go env GOROOT)" "${T}/goroot" || die |
163 |
+ |
164 |
+ GOROOT="${T}/goroot" golang-build_src_install |
165 |
+ dobin bin/* "${T}/goroot/bin/godoc" |
166 |
+ |
167 |
+ exeinto "$(go env GOTOOLDIR)" |
168 |
+ exeopts -m0755 -p # preserve timestamps for bug 551486 |
169 |
+ doexe "${T}/goroot/pkg/tool/$(go env GOOS)_$(go env GOARCH)/cover" |
170 |
+ doexe "${T}/goroot/pkg/tool/$(go env GOOS)_$(go env GOARCH)/vet" |
171 |
} |