2023-02-12 23:25:18 +01:00
|
|
|
# Copyright 2022-2023 Gentoo Authors
|
2022-09-27 07:47:36 +02:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
|
|
|
EAPI="8"
|
|
|
|
EGO_PN="github.com/natesales/q"
|
2022-10-23 23:05:15 +02:00
|
|
|
COMMIT_ID=""
|
2022-09-27 07:47:36 +02:00
|
|
|
|
|
|
|
inherit go-module
|
|
|
|
|
|
|
|
HOMEPAGE="https://github.com/natesales/q"
|
|
|
|
DESCRIPTION="DNS client with support for UDP, TCP, DoT, DoH, DoQ and ODoH"
|
|
|
|
|
|
|
|
if [[ ${PV} == *_p* ]]; then
|
2022-09-27 07:47:36 +02:00
|
|
|
SRC_URI="https://${EGO_PN}/archive/${COMMIT_ID}.tar.gz -> ${P}.tar.gz"
|
2022-09-27 07:47:36 +02:00
|
|
|
S="${WORKDIR}/${PN}-${COMMIT_ID}"
|
|
|
|
else
|
2022-09-27 07:47:36 +02:00
|
|
|
SRC_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
2022-09-27 07:47:36 +02:00
|
|
|
fi
|
|
|
|
|
2022-09-27 07:47:36 +02:00
|
|
|
# Add the manually vendored tarball.
|
2023-03-30 22:39:48 +02:00
|
|
|
# Compress the tarball with: xz -9kT0 --memlimit-decompress=256M
|
2023-06-24 19:52:53 +02:00
|
|
|
SRC_URI+=" https://files.holgersson.xyz/gentoo/distfiles/holgersson-overlay/${P}-deps.tar.xz"
|
2022-09-27 07:47:36 +02:00
|
|
|
|
2022-09-27 07:47:36 +02:00
|
|
|
MY_PN="q-dns"
|
|
|
|
KEYWORDS="~amd64"
|
|
|
|
LICENSE="AGPL-3 Apache-2.0 BSD BSD-2 GPL-3 MIT"
|
|
|
|
|
|
|
|
SLOT="0"
|
|
|
|
IUSE=""
|
|
|
|
|
|
|
|
DEPEND=""
|
|
|
|
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
|
|
|
|
)
|
|
|
|
|
|
|
|
go build "${mygobuildargs[@]}" . || die "go build failed"
|
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
|
|
|
newbin "${PN}" "${MY_PN}"
|
|
|
|
}
|
|
|
|
|
|
|
|
pkg_postinst() {
|
|
|
|
if [[ -z "${REPLACING_VERSION}" ]]; then
|
|
|
|
elog ""
|
|
|
|
elog "Please note that the binary is renamed to"
|
|
|
|
elog "\"${MY_PN}\" as app-portage/portage-utils"
|
|
|
|
elog "already installs the \"q\" binary."
|
2022-10-06 17:52:02 +02:00
|
|
|
elog "For details see the upstream discussion:"
|
|
|
|
elog "https://github.com/natesales/q/issues/28"
|
2022-09-27 07:47:36 +02:00
|
|
|
fi
|
|
|
|
}
|