summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/curlie/curlie-9999.ebuild')
-rw-r--r--net-misc/curlie/curlie-9999.ebuild59
1 files changed, 59 insertions, 0 deletions
diff --git a/net-misc/curlie/curlie-9999.ebuild b/net-misc/curlie/curlie-9999.ebuild
new file mode 100644
index 0000000..259bc40
--- /dev/null
+++ b/net-misc/curlie/curlie-9999.ebuild
@@ -0,0 +1,59 @@
+# Copyright 2019-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+EGO_PN="github.com/rs/${PN}"
+
+inherit go-module
+
+if [[ ${PV} == *9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://${EGO_PN}.git"
+
+ 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"
+
+ #SRC_URI+="${EGO_SUM_SRC_URI}"
+ #S="${WORKDIR}/Amass-${PV}"
+ 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="The power of curl, the ease of use of httpie, written in GoLang"
+LICENSE="MIT"
+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} )"
+
+ set -- env \
+ CGO_ENABLED=0 \
+ go build -o "bin/${PN}" -mod=vendor -v -work -x ${build_flags} \
+ ${EGO_PN}
+ echo "$@"
+ "$@" || die
+}
+
+src_install() {
+ dobin bin/${PN}
+}