summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChen, Chih-Chia <pigfoot@gmail.com>2023-12-27 16:24:50 +0800
committerChen, Chih-Chia <pigfoot@gmail.com>2023-12-27 16:24:50 +0800
commit1ee4524906a5735da61a21c257125880003ad9b9 (patch)
treedf7638425ff1bdc7e05cf0acbc7d2d6e0c4afaf4
parent[net-dns/q] upgrade from upstream (diff)
downloadpigfoot-1ee4524906a5735da61a21c257125880003ad9b9.tar.gz
pigfoot-1ee4524906a5735da61a21c257125880003ad9b9.tar.bz2
pigfoot-1ee4524906a5735da61a21c257125880003ad9b9.zip
[net-dns/doggo] new ebuild
Signed-off-by: Chen, Chih-Chia <pigfoot@gmail.com>
l---------net-dns/doggo/doggo-0.5.7.ebuild1
-rw-r--r--net-dns/doggo/doggo-9999.ebuild62
2 files changed, 63 insertions, 0 deletions
diff --git a/net-dns/doggo/doggo-0.5.7.ebuild b/net-dns/doggo/doggo-0.5.7.ebuild
new file mode 120000
index 0000000..c95ef90
--- /dev/null
+++ b/net-dns/doggo/doggo-0.5.7.ebuild
@@ -0,0 +1 @@
+doggo-9999.ebuild \ No newline at end of file
diff --git a/net-dns/doggo/doggo-9999.ebuild b/net-dns/doggo/doggo-9999.ebuild
new file mode 100644
index 0000000..179acc7
--- /dev/null
+++ b/net-dns/doggo/doggo-9999.ebuild
@@ -0,0 +1,62 @@
+# Copyright 2019-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+EGO_PN="github.com/mr-karan/${PN}"
+
+inherit go-module shell-completion
+
+if [[ ${PV} == *9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://${EGO_PN}.git"
+ EGO_VER="devel"
+
+ src_unpack() {
+ git-r3_src_unpack
+ go-module_live_vendor
+ }
+else
+ EGO_VER="v${PV}"
+ #SRC_URI="https://${EGO_PN}/archive/${EGO_VER}.tar.gz -> ${P}.tar.gz"
+ inherit git-r3
+ EGIT_REPO_URI="https://${EGO_PN}.git"
+ EGIT_COMMIT="${EGO_VER}"
+
+ src_unpack() {
+ git-r3_src_unpack
+ go-module_live_vendor
+ }
+
+ KEYWORDS="~amd64 ~x86 ~arm64 ~arm"
+fi
+
+DESCRIPTION="Command-line DNS Client for Humans. Written in Golang"
+LICENSE="GPL-3"
+SLOT="0/${PVR}"
+RESTRICT="mirror"
+IUSE="+pie"
+
+src_compile() {
+ # -buildmode=pie forces external linking mode, even CGO_ENABLED=0
+ # https://github.com/golang/go/issues/18968
+ use pie && local build_pie="-buildmode=pie"
+
+ local build_flags="$( echo ${EGO_BUILD_FLAGS} ) $( echo ${build_pie} )"
+ local ld_flags="$( echo "-s -w -X 'main.buildVersion=${EGO_VER}' -X 'main.buildDate=$(date --iso-8601=seconds)'" )"
+
+ set -- env \
+ CGO_ENABLED=0 \
+ go build -o "bin/${PN}" -mod=vendor -v -work -x ${build_flags} -ldflags "${ld_flags}" \
+ ./cmd/${PN}
+ echo "$@"
+ "$@" || die
+}
+
+src_install() {
+ newbin bin/${PN} doggo
+
+ newbashcomp completions/${PN}.bash ${PN}
+▎ newfishcomp completions/${PN}.fish ${PN}
+ newzshcomp completions/${PN}.zsh ${PN}
+}