Files
guru/dev-util/shfmt/shfmt-9999.ebuild
Randall T. Vasquez 78a3d626d4 dev-util/shfmt: tidy shfmt ebuilds
This commits fixes the manifest of the shfmt 3.5.0 ebuild; along with some other general tidying of all the shfmt ebuilds.

Signed-off-by: Randall T. Vasquez <ran.dall@icloud.com>
2022-05-22 07:40:03 -07:00

57 lines
1.2 KiB
Bash

# 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+=" 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
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
}