forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev-go/go-oauth2: version bump to 0_pre20160222, fix bug 575722
Package-Manager: portage-2.2.27
- Loading branch information
Showing
3 changed files
with
115 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
DIST gcloud-golang-872c736f496c2ba12786bedbb8325576bbdb33cf.tar.gz 217728 SHA256 d4dc2064cc999c9c527fe50a05c44357d3471379bea3f82a95bfebbaa5373552 SHA512 45f0533c842a59dfee3b6d3f1facb9535466119601644a9a2c8c8b4f573889713b1d82d0acdeef96ea246d47d79402d09592b25da3ffbf73953bd28bf5b92ed9 WHIRLPOOL fadd0c32fbfcca9c01ad0a11f64ea4625cda858e4d241bcad35cdc1292bf258a370f4fdd73ecb7bb613fc1f0e8a52154dc3582dbcd776517713468cb2ab7c18a | ||
DIST gcloud-golang-e34a32f9b0ecbc0784865fb2d47f3818c09521d4.tar.gz 168358 SHA256 817456c3b49ff6917604d201041d4f555e7f42328d5df036c68c26bf50c7455c SHA512 135124280cdbf0a9e62f811164b4b97f0ee5142736cc4a06efafd48162a89dd1a6f186264c925da27adc970c964ab0af75423025fd125b772ddb99320b816219 WHIRLPOOL 66a445585c17d0331b0ce24d9bde8c8942ba39d1d404e1b3b73cbaf173327ab0c43af5b7e980accf697100b12e3a544334a07f43f9f17ebac93ee7907b92b7ac | ||
DIST go-net-0_pre20160216.tar.gz 741192 SHA256 482a17771601dc706945eee7e0c3a339d57a140dc3cb8adaa86e99ef28a8ea71 SHA512 75db9098b33ede5621fce36645ebe946fad911c815dae219d74242b15714d1b9a3d8544f5f8c90b58989cea3a46b5688d20f705cb24a7d31f201ec218e69e78f WHIRLPOOL 2a7dca88766e6ba010ed6b274a48e7db5cfc9084cbc16f46e2806d59519f91b296d64dead8485f191aff50168bad5b4f62ac670d17b30b90850a9906d85c6708 | ||
DIST go-oauth2-0_pre20150701.tar.gz 32040 SHA256 ce9b602dd7f05c819002d6400585c2f09e8e1880a0fe358a4d4f56a6594ccedd SHA512 d809e1d63c7b5a4b388616d930cb22978b1653e2314b208d12679242bdd0e9d72f275f5ade7aa468b1dcf3960aa70ff94183ae1dd04325b24cdd20ef4834880a WHIRLPOOL 984438676de52f635206a3bb19b77e7f05c9c78a2ce6beabbe82cc22fb28fa0c7e3717a596a9b0c967615574ad6e53da0510bc1ecd0a38edd23680622320d6a0 | ||
DIST go-oauth2-0_pre20160220.tar.gz 32040 SHA256 ce9b602dd7f05c819002d6400585c2f09e8e1880a0fe358a4d4f56a6594ccedd SHA512 d809e1d63c7b5a4b388616d930cb22978b1653e2314b208d12679242bdd0e9d72f275f5ade7aa468b1dcf3960aa70ff94183ae1dd04325b24cdd20ef4834880a WHIRLPOOL 984438676de52f635206a3bb19b77e7f05c9c78a2ce6beabbe82cc22fb28fa0c7e3717a596a9b0c967615574ad6e53da0510bc1ecd0a38edd23680622320d6a0 | ||
DIST go-oauth2-0_pre20160222.tar.gz 34556 SHA256 cb4123249901235e6ebfd074a5b1547cb4e3a4a7060b399b29950e60882ecd2f SHA512 23fbc7744fe35f893d385a308428d2a3b8ddbf45fa12c5b43d3dc619e6bb422f30ce80774a25b88a8f74f9343c57280546183b45364456e1c60aee96aa6d0f77 WHIRLPOOL 67c42a0b21861e7cd34b25c4d59359f791faf4f03a2759c94ae70e48cfbe24f27ca005f7e7afbbe7c8221fb47aa8a08dc19c19dc8e53b680d6bcaaeff10d2308 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
# Copyright 1999-2016 Gentoo Foundation | ||
# Distributed under the terms of the GNU General Public License v2 | ||
# $Id$ | ||
|
||
EAPI=5 | ||
|
||
inherit eutils golang-base | ||
|
||
MY_PN=${PN##*-} | ||
EGO_PN="golang.org/x/${MY_PN}/..." | ||
EGIT_COMMIT="2cd4472c321b6cba78e029d99f0e7fe51032fd21" | ||
|
||
HOMEPAGE="https://godoc.org/${EGO_PN%/*}" | ||
DESCRIPTION="Go client implementation for OAuth 2.0 spec" | ||
SRC_URI=" | ||
https://github.com/golang/${MY_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz | ||
https://github.com/golang/net/archive/b6d7b1396ec874c3b00f6c84cd4301a17c56c8ed.tar.gz -> go-net-0_pre20160216.tar.gz | ||
https://github.com/GoogleCloudPlatform/gcloud-golang/archive/872c736f496c2ba12786bedbb8325576bbdb33cf.tar.gz -> gcloud-golang-872c736f496c2ba12786bedbb8325576bbdb33cf.tar.gz" | ||
|
||
SLOT="0/${PVR}" | ||
LICENSE="BSD" | ||
KEYWORDS="~amd64" | ||
IUSE="" | ||
|
||
DEPEND="dev-go/go-tools" | ||
RDEPEND="" | ||
|
||
EGIT_CHECKOUT_DIR="${S}" | ||
STRIP_MASK="*.a" | ||
|
||
get_archive_go_package() { | ||
local archive=${1} uri x | ||
case ${archive} in | ||
${PN}-*) echo "oauth2-* golang.org/x/oauth2"; return;; | ||
gcloud-golang-*) echo "gcloud-golang-* google.golang.org/cloud"; return;; | ||
go-net-*) echo "net-* golang.org/x/net"; return;; | ||
esac | ||
for x in ${SRC_URI}; do | ||
if [[ ${x} == http* ]]; then | ||
uri=${x} | ||
elif [[ ${x} == ${archive} ]]; then | ||
break | ||
fi | ||
done | ||
uri=${uri#https://} | ||
uri=${uri%/archive/*} | ||
echo "${uri##*/}-* ${uri}" | ||
} | ||
|
||
unpack_go_packages() { | ||
local go_package pattern x | ||
# Unpack packages to appropriate locations for GOPATH | ||
for x in ${A}; do | ||
unpack ${x} | ||
if [[ ${x} == *.tar.gz ]]; then | ||
go_package=$(get_archive_go_package ${x}) | ||
pattern=${go_package%% *} | ||
go_package=${go_package##* } | ||
if [[ ${x%.tar.gz} -ef ${S} ]]; then | ||
mv "${S}"{,_} || die | ||
mkdir -p "${S}/src/${go_package%/*}" || die | ||
mv "${S}"_ "${S}/src/${go_package}" || die || die | ||
else | ||
mkdir -p "${S}/src/${go_package%/*}" || die | ||
for x in ${pattern}; do | ||
if [[ ! ${x} -ef ${S} ]]; then | ||
mv "${x}" "${S}/src/${go_package}" || die | ||
fi | ||
done | ||
fi | ||
fi | ||
done | ||
} | ||
|
||
src_unpack() { | ||
unpack_go_packages | ||
|
||
# Create a writable GOROOT in order to avoid sandbox violations. | ||
# Omit $(get_golibdir_gopath) from GOPATH, in order to avoid | ||
# more sandbox violations (bug 575722). | ||
GOROOT="${WORKDIR}/goroot" GOPATH="${S}" | ||
cp -sR "$(go env GOROOT)" "${GOROOT}" || die | ||
rm -rf "${GOROOT}/src/${EGO_PN%/*}" || die | ||
export GOROOT GOPATH | ||
|
||
mkdir -p "${GOROOT}/src/google.golang.org" || die | ||
rm -rf "${GOROOT}/src/google.golang.org"/* || die | ||
rm -rf "${GOROOT}/pkg/${KERNEL}_${ARCH}/google.golang.org" || die | ||
} | ||
|
||
src_compile() { | ||
GOROOT="${GOROOT}" GOPATH="${GOPATH}" \ | ||
go install -v -work -x ${EGO_BUILD_FLAGS} "${EGO_PN}" || die | ||
} | ||
|
||
src_test() { | ||
# google/example_test.go imports appengine, introducing a circular dep | ||
mv src/${EGO_PN%/*}/google/example_test.go{,_} || die | ||
go test -x -v "${EGO_PN}" || die $? | ||
mv src/${EGO_PN%/*}/google/example_test.go{_,} || die | ||
} | ||
|
||
src_install() { | ||
golang_install_pkgs | ||
} | ||
|
||
golang_install_pkgs() { | ||
insinto $(dirname "${EPREFIX}$(get_golibdir)/src/${EGO_PN%/*}") | ||
rm -rf "${S}"/src/${EGO_PN%/*}/.git* | ||
doins -r "${S}"/src/${EGO_PN%/*} | ||
insinto $(dirname "${EPREFIX}$(get_golibdir)/pkg/$(go env GOOS)_$(go env GOARCH)/${EGO_PN%/*}") | ||
doins -r "${S}"/pkg/$(go env GOOS)_$(go env GOARCH)/${EGO_PN%/*}{,.a} | ||
} |