2023-02-08 22:20:58 +01:00
|
|
|
# Copyright 2020-2023 Gentoo Authors
|
2022-04-03 15:48:25 +02:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
|
|
|
EAPI="8"
|
|
|
|
EGO_PN="github.com/tulir/gomuks"
|
|
|
|
inherit go-module
|
2023-07-29 01:19:34 +02:00
|
|
|
COMMIT_ID="09a927955810f6f0c6d3f4809d9b01eda365fd39"
|
2022-04-03 15:48:25 +02:00
|
|
|
|
|
|
|
DESCRIPTION="A terminal based Matrix client written in Go"
|
|
|
|
HOMEPAGE="https://github.com/tulir/gomuks"
|
|
|
|
|
|
|
|
if [[ ${PV} == *_p* ]]; then
|
2022-10-23 23:05:15 +02:00
|
|
|
SRC_URI="https://${EGO_PN}/archive/${COMMIT_ID}.tar.gz -> ${P}.tar.gz"
|
2022-04-03 15:48:25 +02:00
|
|
|
S="${WORKDIR}/${PN}-${COMMIT_ID}"
|
|
|
|
else
|
2022-10-23 23:05:15 +02:00
|
|
|
SRC_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
2022-04-03 15:48:25 +02:00
|
|
|
fi
|
2022-10-23 23:05:15 +02:00
|
|
|
# Add the manually vendored tarball.
|
2023-07-29 01:19:34 +02:00
|
|
|
# Build tar archive with these flags for reproducabilty:
|
|
|
|
# --mtime="1970-01-01" --sort=name --owner=portage --group=portage"
|
|
|
|
# Compress the tarball with: xz -9eT0k --memlimit-decompress=256M
|
2023-06-11 15:09:41 +02:00
|
|
|
SRC_URI+=" https://files.holgersson.xyz/gentoo/distfiles/holgersson-overlay/${P}-deps.tar.xz"
|
2022-04-03 15:48:25 +02:00
|
|
|
|
|
|
|
KEYWORDS="~amd64"
|
2023-07-29 01:19:34 +02:00
|
|
|
LICENSE="
|
|
|
|
AGPL-3
|
|
|
|
Apache-2.0
|
|
|
|
BSD
|
|
|
|
GPL-3
|
|
|
|
MIT
|
|
|
|
MPL-2.0
|
|
|
|
"
|
2022-04-03 15:48:25 +02:00
|
|
|
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}
|
|
|
|
}
|