From 1a8cb19186873d28d7e6598c654e23791d3d4210 Mon Sep 17 00:00:00 2001 From: Alarig Le Lay Date: Fri, 4 Sep 2020 20:18:39 +0200 Subject: [PATCH] net-im/matterircd: Switching to go-module eclass Package-Manager: Portage-3.0.4, Repoman-3.0.1 Signed-off-by: Alarig Le Lay --- net-im/matterircd/matterircd-0.20.0.ebuild | 30 +++++----------------- 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/net-im/matterircd/matterircd-0.20.0.ebuild b/net-im/matterircd/matterircd-0.20.0.ebuild index c5041b7..2567b14 100644 --- a/net-im/matterircd/matterircd-0.20.0.ebuild +++ b/net-im/matterircd/matterircd-0.20.0.ebuild @@ -5,11 +5,12 @@ EAPI=7 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" 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" LICENSE="MIT" @@ -20,34 +21,15 @@ IUSE="debug pie static" DOCS=( README.md ) QA_PRESTRIPPED="usr/bin/.*" -G="${WORKDIR}/${P}" -S="${G}/src/${EGO_PN}" +src_compile() { + env GOBIN="${S}/bin" go build -mod=vendor || die "compile failed" +} pkg_setup() { enewgroup 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() { dobin matterircd use debug && dostrip -x /usr/bin/matterircd