GOLANG-VCS-SNAPSHOT.ECLASS

Section: eclass-manpages (5)
Updated: Apr 2024
Index Return to Main Contents

NAME

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

DEPRECATED

Replacement: go-module.eclass

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

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. Set compile env via go-env.

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
DEPRECATED
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, April 26, 2024