holgersson-overlay/net-im/gomuks/gomuks-0.3.0_p20230710.ebuild
Nils Freydank 407e833f44
net-im/gomuks: Update golang vendor tarballs
This commit moves distfiles and changes them due to repackaging,
but no code was changed.

The vendored dep archive is now in a separate download section and built
according to suggestions implemented e.g. in dev-vcs/git-lfs::gentoo.

Signed-off-by: Nils Freydank <nils.freydank@posteo.de>
2023-08-06 14:37:01 +02:00

59 lines
1.5 KiB
Bash

# Copyright 2020-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="8"
EGO_PN="github.com/tulir/gomuks"
inherit go-module
COMMIT_ID="09a927955810f6f0c6d3f4809d9b01eda365fd39"
DESCRIPTION="A terminal based Matrix client written in Go"
HOMEPAGE="https://github.com/tulir/gomuks"
if [[ ${PV} == *_p* ]]; then
SRC_URI="https://${EGO_PN}/archive/${COMMIT_ID}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/${PN}-${COMMIT_ID}"
else
SRC_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
fi
# Add the manually vendored tarball.
# 1) Create a tar archive optimized to reproduced by other users or devs.
# 2) Compress the archive using XZ limiting decompression memory for
# pretty constraint systems.
# Use something like:
# tar cf $P-deps.tar go-mod \
# --mtime="1970-01-01" --sort=name --owner=portage --group=portage
# xz -k -9eT0 --memlimit-decompress=256M $P-deps.tar
SRC_URI+=" https://files.holgersson.xyz/gentoo/distfiles/golang-pkg-deps/${P}-deps.tar.xz"
KEYWORDS="~amd64"
LICENSE="
AGPL-3
Apache-2.0
BSD
GPL-3
MIT
MPL-2.0
"
SLOT="0"
IUSE="+encryption"
DEPEND="encryption? ( dev-libs/olm )"
RDEPEND="${DEPEND}"
BDEPEND=""
src_compile() {
# Flags -w, -s: Omit debugging information to reduce binary size,
# see https://golang.org/cmd/link/.
local mygobuildargs=(
-ldflags="-X ${EGO_PN}/config.GitCommit=${GIT_COMMIT} -s -w"
-mod mod -v -work -x
)
use encryption || export CGO_ENABLED=0
go build "${mygobuildargs[@]}" . || die "go build failed"
}
src_install() {
dobin ${PN}
}