dev-util/shfmt - 3.7.0 (dm9pZCAq)

Search

Package Information

Description:
A shell parser, formatter, and interpreter with bash support
Homepage:
https://pkg.go.dev/mvdan.cc/sh/v3 https://github.com/mvdan/sh
License:
BSD

Ebuild Details

Version EAPI Keywords Slot
3.7.0 8 amd64 0
View Raw Ebuild
# Copyright 2023-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit go-module

DESCRIPTION="A shell parser, formatter, and interpreter with bash support"
HOMEPAGE="
	https://pkg.go.dev/mvdan.cc/sh/v3
	https://github.com/mvdan/sh
"
SRC_URI="
	https://github.com/mvdan/sh/archive/v${PV}.tar.gz -> ${P}.tar.gz
	https://github.com/dm9pZCAq/gentoo-go-deps/releases/download/${P}/${P}-deps.tar.xz
	https://github.com/dm9pZCAq/gentoo-go-deps/releases/download/${P}/${P}-vendor.tar.xz
"
S="${WORKDIR}/sh-${PV}"

LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64"
IUSE="+man"

BDEPEND="
	man? ( app-text/scdoc )
"
src_compile() {
	CGO_ENABLED=0 ego build -ldflags="
		-X main.version=${PV}
		-w -s -extldflags '-static'
	" "./cmd/${PN}"

	use man && {
		local man_in="./cmd/${PN}/${PN}.1.scd"
		local man_out="./${PN}.1"

		ebegin "scdoc: '${man_in}' -> '${man_out}'"
		scdoc <"${man_in}" >"${man_out}"
		eend "${?}" 'failed to generate man page' || die "${_}"
	}
}

src_install() {
	dobin "${PN}"

	use man && doman "./${PN}.1"
}

USE Flags

man
Default: Enabled (+)

Dependencies

BDEPEND

	man? ( app-text/scdoc )

Manifest for 3.7.0

Type File Size Source URLs
DIST shfmt-3.7.0-deps.tar.xz 9180276 bytes https://github.com/dm9pZCAq/gentoo-go-deps/releases/download/shfmt-3.7.0/shfmt-3.7.0-deps.tar.xz
DIST shfmt-3.7.0-vendor.tar.xz 597472 bytes https://github.com/dm9pZCAq/gentoo-go-deps/releases/download/shfmt-3.7.0/shfmt-3.7.0-vendor.tar.xz
DIST shfmt-3.7.0.tar.gz 219380 bytes https://github.com/mvdan/sh/archive/v3.7.0.tar.gz