commit:     4a38bce6483cddb086321a61561a65cfaa4401a1
Author:     Randall T. Vasquez <ran.dall <AT> icloud <DOT> com>
AuthorDate: Sat May 21 16:51:49 2022 +0000
Commit:     Haelwenn Monnier <contact <AT> hacktivis <DOT> me>
CommitDate: Sat May 21 16:51:49 2022 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=4a38bce6

dev-util/shfmt: add shfmt v3.5.0 and v9999

This commits adds ebuilds for shfmt v3.5.0 and v9999

Signed-off-by: Randall T. Vasquez <ran.dall <AT> icloud.com>

 dev-util/shfmt/Manifest           |  2 ++
 dev-util/shfmt/metadata.xml       | 14 ++++++++++
 dev-util/shfmt/shfmt-3.5.0.ebuild | 56 ++++++++++++++++++++++++++++++++++++++
 dev-util/shfmt/shfmt-9999.ebuild  | 57 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 129 insertions(+)

diff --git a/dev-util/shfmt/Manifest b/dev-util/shfmt/Manifest
new file mode 100644
index 000000000..15f0d5e01
--- /dev/null
+++ b/dev-util/shfmt/Manifest
@@ -0,0 +1,2 @@
+DIST shfmt-3.5.0-deps.tar.xz 3121980 BLAKE2B 
411e7df230864d1692899b89c4b5e25f54582752a10bde30a8a5e1ae03da3b325353d9bab71b46795f3d285747fbbcc63dd367ecddc8055d5df45013c5f491ae
 SHA512 
562fc2a58c0c115d132c9107c569f5139d7e1f817c91077b80151d0043601c328b083ce8261301689ce72deecabe3957bc11e4dc4388024234a2791c9f118743
+DIST shfmt-3.5.0.tar.gz 222314 BLAKE2B 
733785dbeb4af946f316aae1c9bf917c0d70598e3b19b993f592d35bbce53ef8ab613935ebc5ecbfb11677b722e4ca12175b85e30be2467abed381d30b6c3159
 SHA512 
8a3225a39a415d4926e44f214e8de6d25fedf5a0fe6b09743cc43e1c849094a3d8a34f327d00bffaaf93e4552f7ea03b681d3bb97f59727ab36ac66bafb6d4e7

diff --git a/dev-util/shfmt/metadata.xml b/dev-util/shfmt/metadata.xml
new file mode 100644
index 000000000..66342d17d
--- /dev/null
+++ b/dev-util/shfmt/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+  <maintainer type="person">
+    <email>ran.d...@icloud.com</email>
+    <name>Randall Vasquez</name>
+  </maintainer>
+       <longdescription lang="en">
+               A shell parser, formatter, and interpreter with bash support; 
includes shfmt. Supports POSIX Shell, Bash, and mksh.
+       </longdescription>
+       <upstream>
+               <remote-id type="github">mvdan/sh</remote-id>
+       </upstream>
+</pkgmetadata>

diff --git a/dev-util/shfmt/shfmt-3.5.0.ebuild 
b/dev-util/shfmt/shfmt-3.5.0.ebuild
new file mode 100644
index 000000000..069e7e3d8
--- /dev/null
+++ b/dev-util/shfmt/shfmt-3.5.0.ebuild
@@ -0,0 +1,56 @@
+# Copyright 2020-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Shell script formatter"
+HOMEPAGE="https://github.com/mvdan/sh";
+if [[ ${PV} == *9999 ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/mvdan/sh.git";
+       RESTRICT="fetch mirror test"
+else
+       inherit go-module
+       SRC_URI="https://github.com/mvdan/sh/archive/refs/tags/v${PV}.tar.gz -> 
${P}.tar.gz"
+       SRC_URI+=" 
https://github.com/ran-dall/portage-deps/raw/master/${P}-deps.tar.xz";
+       KEYWORDS="~amd64 ~arm64 ~x86"
+       RESTRICT="mirror test"
+       S="${WORKDIR}/${PN/fmt}-${PV}"
+fi
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="+man"
+
+BDEPENDS="
+       dev-lang/go
+       man? ( app-text/scdoc )
+"
+
+src_unpack() {
+       if [[ ${PV} == *9999 ]]; then
+               git-r3_fetch
+               git-r3_checkout
+               pushd ${P}/cmd/shfmt || die "location change for module 
building failed"
+               ego get
+               popd || die "location reset from module building failed"
+       else
+               mv mvdan-sh-* || die "correct placement of directory failed"
+               go-module_src_unpack
+       fi
+       default
+}
+
+src_compile() {
+       ego build -v -ldflags "-s -w" -o "${PN}" "./cmd/shfmt"
+       if use man; then
+               scdoc < cmd/shfmt/shfmt.1.scd > shfmt.1 || die "conversation of 
man page failed"
+       fi
+}
+
+src_install() {
+       dobin ${PN}
+       if use man; then
+               doman shfmt.1
+       fi
+}

diff --git a/dev-util/shfmt/shfmt-9999.ebuild b/dev-util/shfmt/shfmt-9999.ebuild
new file mode 100644
index 000000000..65a9730a9
--- /dev/null
+++ b/dev-util/shfmt/shfmt-9999.ebuild
@@ -0,0 +1,57 @@
+# Copyright 2020-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit go-module
+
+DESCRIPTION="Shell script formatter"
+HOMEPAGE="https://github.com/mvdan/sh";
+if [[ ${PV} == *9999 ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/mvdan/sh.git";
+       RESTRICT="fetch mirror test"
+else
+       SRC_URI="https://github.com/mvdan/sh/archive/refs/tags/v${PV}.tar.gz -> 
${P}.tar.gz"
+       SRC_URI+=" ${P}-deps.tar.xz"
+       KEYWORDS="~amd64 ~arm64 ~x86"
+       RESTRICT="mirror test"
+       S="${WORKDIR}/${PN/fmt}-${PV}"
+fi
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="+man"
+
+BDEPENDS="
+       dev-lang/go
+       man? ( app-text/scdoc )
+"
+
+src_unpack() {
+       default
+       if [[ ${PV} == *9999 ]]; then
+               git-r3_fetch
+               git-r3_checkout
+               pushd ${P}/cmd/shfmt || die "location change for module 
building failed"
+               ego get
+               popd || die "location reset from module building failed"
+       else
+               mv mvdan-sh-* || die "correct placement of directory failed"
+               go-module_src_unpack
+       fi
+}
+
+src_compile() {
+       ego build -v -ldflags "-s -w" -o "${PN}" "./cmd/shfmt"
+       if use man; then
+               scdoc < cmd/shfmt/shfmt.1.scd > shfmt.1 || die "conversation of 
man page failed"
+       fi
+}
+
+src_install() {
+       dobin ${PN}
+       if use man; then
+               doman shfmt.1
+       fi
+}

Reply via email to