dev-go/go-tour: new package
authorZac Medico <zmedico@gentoo.org>
Thu, 11 Feb 2016 09:22:55 +0000 (01:22 -0800)
committerZac Medico <zmedico@gentoo.org>
Thu, 11 Feb 2016 09:25:02 +0000 (01:25 -0800)
Package-Manager: portage-2.2.27

dev-go/go-tour/Manifest [new file with mode: 0644]
dev-go/go-tour/go-tour-0_p20160209.ebuild [new file with mode: 0644]
dev-go/go-tour/metadata.xml [new file with mode: 0644]

diff --git a/dev-go/go-tour/Manifest b/dev-go/go-tour/Manifest
new file mode 100644 (file)
index 0000000..1b11d3f
--- /dev/null
@@ -0,0 +1 @@
+DIST go-tour-0_p20160209.tar.gz 275272 SHA256 f50ce5a75f1dd9d625830c0907a5b611455b052ed1e287f5d2f9428759e14223 SHA512 bc9131e6173f72ea01c3062454a47a90301ad01bc1ea356ef09b81ad2d887759671ee9700f2c6b47821fc02c49297b8797d732ae0e9b414205e483d30579d2e9 WHIRLPOOL a2e117e2f50c83013604e85fb03919a25eacc1494dce9c53929d6bcbb22367d88f7b073d292261909767c91fda8f5a10380f452938ac3bba78c5939634206e9c
diff --git a/dev-go/go-tour/go-tour-0_p20160209.ebuild b/dev-go/go-tour/go-tour-0_p20160209.ebuild
new file mode 100644 (file)
index 0000000..10593aa
--- /dev/null
@@ -0,0 +1,36 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+EGO_PN="golang.org/x/tour/..."
+
+EGIT_COMMIT="6b2e5b35ce8ed092eaedc3d2a2294373a639f122"
+ARCHIVE_URI="https://github.com/golang/tour/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+KEYWORDS="~amd64"
+inherit golang-vcs-snapshot golang-build
+
+DESCRIPTION="A Tour of Go"
+HOMEPAGE="https://tour.golang.org"
+SRC_URI="${ARCHIVE_URI}"
+LICENSE="BSD"
+SLOT="0"
+IUSE=""
+
+src_compile() {
+       # Create a writable GOROOT in order to avoid sandbox violations.
+       cp -sR "$(go env GOROOT)" "${T}/goroot" || die
+       rm -rf "${T}/goroot/src/${EGO_PN%/*}" || die
+       GOROOT="${T}/goroot" GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" \
+               go build -v -work -x ${EGO_BUILD_FLAGS} "${EGO_PN}"
+       [[ -x $(find "${T}" -name a.out) ]] || die "a.out not found"
+}
+
+src_install() {
+       GOROOT="${T}/goroot" GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" \
+               go install -v -work -x ${EGO_BUILD_FLAGS} "${EGO_PN}"
+       exeinto "$(go env GOTOOLDIR)"
+       newexe bin/gotour tour
+       insinto "$(go env GOROOT)"
+       doins -r src
+}
diff --git a/dev-go/go-tour/metadata.xml b/dev-go/go-tour/metadata.xml
new file mode 100644 (file)
index 0000000..4677727
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <maintainer type="person">
+    <email>zmedico@gentoo.org</email>
+  </maintainer>
+  <upstream>
+    <remote-id type="github">golang/tour</remote-id>
+  </upstream>
+</pkgmetadata>