net-im/matterircd: Switching to go-module eclass

Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Alarig Le Lay <alarig@swordarmor.fr>
This commit is contained in:
Alarig Le Lay 2020-09-04 20:18:39 +02:00
parent 9d430df08a
commit 1a8cb19186
Signed by: alarig
GPG key ID: 7AFE62C6DF8BCDEC

View file

@ -5,11 +5,12 @@ EAPI=7
EGO_PN="github.com/42wim/${PN}" EGO_PN="github.com/42wim/${PN}"
inherit golang-build golang-vcs-snapshot user inherit go-module user
DESCRIPTION="Connect to your Mattermost or Slack using your IRC-client of choice" DESCRIPTION="Connect to your Mattermost or Slack using your IRC-client of choice"
HOMEPAGE="https://github.com/42wim/matterircd" HOMEPAGE="https://github.com/42wim/matterircd"
SRC_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" SRC_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
${EGO_SUM_SRC_URI}"
RESTRICT="mirror" RESTRICT="mirror"
LICENSE="MIT" LICENSE="MIT"
@ -20,34 +21,15 @@ IUSE="debug pie static"
DOCS=( README.md ) DOCS=( README.md )
QA_PRESTRIPPED="usr/bin/.*" QA_PRESTRIPPED="usr/bin/.*"
G="${WORKDIR}/${P}" src_compile() {
S="${G}/src/${EGO_PN}" env GOBIN="${S}/bin" go build -mod=vendor || die "compile failed"
}
pkg_setup() { pkg_setup() {
enewgroup matterircd enewgroup matterircd
enewuser matterircd -1 -1 -1 matterircd enewuser matterircd -1 -1 -1 matterircd
} }
src_compile() {
export GOPATH="${G}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
(use static && ! use pie) && export CGO_ENABLED=0
(use static && use pie) && CGO_LDFLAGS+=" -static"
local mygoargs=(
-v -work -x
-buildmode "$(usex pie pie exe)"
-asmflags "all=-trimpath=${S}"
-gcflags "all=-trimpath=${S}"
-ldflags "$(usex !debug '-s -w' '')"
-tags "$(usex static 'netgo' '')"
-installsuffix "$(usex static 'netgo' '')"
)
go build "${mygoargs[@]}" || die
}
src_install() { src_install() {
dobin matterircd dobin matterircd
use debug && dostrip -x /usr/bin/matterircd use debug && dostrip -x /usr/bin/matterircd