# Copyright 1999-2018 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 EGO_PN="github.com/bndw/${PN}" inherit golang-vcs-snapshot-r1 DESCRIPTION="A minimal password manager written in Go" HOMEPAGE="https://bndw.github.io/pick/" SRC_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" RESTRICT="mirror" LICENSE="MIT" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="debug pie" QA_PRESTRIPPED="usr/bin/.*" G="${WORKDIR}/${P}" S="${G}/src/${EGO_PN}" src_compile() { export GOPATH="${G}" local myldflags=( "$(usex !debug '-s -w' '')" -X "main.version=${PV}" ) local mygoargs=( -v -work -x "-buildmode=$(usex pie pie exe)" "-asmflags=all=-trimpath=${S}" "-gcflags=all=-trimpath=${S}" -ldflags "${myldflags[*]}" ) go build "${mygoargs[@]}" || die } src_test() { go test -v ./... || die } src_install() { dobin pick use debug && dostrip -x /usr/bin/pick }