GOLANG-VCS-SNAPSHOT.ECLASS

Section: eclass-manpages (5)
Updated: Oct 2021
Index Return to Main Contents

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.

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

FUNCTIONS

golang-vcs-snapshot_src_unpack
Extract the first archive from ${A} to the appropriate location for GOPATH.

ECLASS 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/

FILES

golang-vcs-snapshot.eclass

SEE ALSO

ebuild(5)
https://gitweb.gentoo.org/repo/gentoo.git/log/eclass/golang-vcs-snapshot.eclass


Index

NAME
DESCRIPTION
SUPPORTED EAPIS
TRANSITIVELY PROVIDED ECLASSES
EXAMPLE
FUNCTIONS
ECLASS VARIABLES
MAINTAINERS
REPORTING BUGS
FILES
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 03:27:01 GMT, October 16, 2021