golang-vcs-snapshot.eclass

Name

golang-vcs-snapshot.eclass -- eclass to unpack VCS snapshot tarballs for Go software

Description

This eclass provides a convenience src_unpack() ``which unpacks the first tarball mentioned in ``SRC_URI to its appropriate location in ${WORKDIR}/${P}, treating ${WORKDIR}/${P} as a go workspace. Also, it provides a downstream method of vendoring packages.

The location where the tarball is extracted is defined as ${WORKDIR}/${P}/src/${EGO_PN}. The location of vendored packages is defined as ${WORKDIR}/${P}/src/${EGO_PN%/*}/vendor to match Go's vendoring setup.

The typical use case is VCS snapshots coming from github, bitbucket and similar services.

Please note that this eclass currently handles only tarballs (.tar.gz), but support for more formats may be added in the future.

Deprecated

Replacement: go-module.eclass

Supported EAPIs

5 6 7

Transitively Provided Eclasses

  • golang-base

Example

EGO_PN=github.com/user/package
EGO_VENDOR=(
   "github.com/xenolf/lego 6cac0ea7d8b28c889f709ec7fa92e92b82f490dd"
   "golang.org/x/crypto 453249f01cfeb54c3d549ddb75ff152ca243f9d8 github.com/golang/crypto"
)

inherit golang-vcs-snapshot

SRC_URI="https://github.com/example/${PN}/tarball/v${PV} -> ${P}.tar.gz
    ${EGO_VENDOR_URI}"

The above example will extract the tarball to ${WORKDIR}/${P}/src/github.com/user/package and add the vendored tarballs to ${WORKDIR}/src/${EGO_PN}/vendor

Exported Phases

  • src_unpack

Functions

golang-vcs-snapshot_src_unpack

Extract the first archive from ${A} to the appropriate location for GOPATH.

Variables

EGO_VENDOR

This variable contains a list of vendored packages. The items of this array are strings that contain the import path and the git commit hash for a vendored package. If the import path does not start with github.com, the third argument can be used to point to a github repository.

Maintainers

William Hubbs <williamh@gentoo.org>

Reporting Bugs

Please report bugs via https://bugs.gentoo.org/