You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-go/go-net/go-net-0_pre20150604.ebuild

58 lines
1.6 KiB

# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-go/go-net/go-net-0_pre20150604.ebuild,v 1.1 2015/07/01 20:24:19 williamh Exp $
EAPI=5
KEYWORDS="~amd64"
DESCRIPTION="Go supplementary network libraries"
MY_PN=${PN##*-}
GO_PN=golang.org/x/${MY_PN}
HOMEPAGE="https://godoc.org/${GO_PN}"
EGIT_COMMIT="dfe268fd2bb5c793f4c083803609fce9806c6f80"
SRC_URI="https://github.com/golang/${MY_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
LICENSE="BSD"
SLOT="0"
IUSE=""
DEPEND=">=dev-lang/go-1.4
dev-go/go-text"
RDEPEND=""
S="${WORKDIR}/src/${GO_PN}"
EGIT_CHECKOUT_DIR="${S}"
STRIP_MASK="*.a"
src_unpack() {
default
mkdir -p src/${GO_PN%/*} || die
mv ${MY_PN}-${EGIT_COMMIT} src/${GO_PN} || die
}
src_prepare() {
# disable broken tests
sed -e 's:TestReadProppatch(:_\0:' -i webdav/xml_test.go || die
sed -e 's:TestPingGoogle(:_\0:' \
-e 's:TestNonPrivilegedPing(:_\0:' \
-i icmp/ping_test.go || die
}
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 -x -v ${GO_PN}/... || die $?
}
src_install() {
insinto /usr/lib/go
find "${WORKDIR}"/{pkg,src} -name '.git*' -exec rm -rf {} \; 2>/dev/null
insopts -m0644 -p # preserve timestamps for bug 551486
doins -r "${WORKDIR}"/{pkg,src}
}