dev-util/shfmt - 3.14.1 (bentoo)

Search

Install

Install this version:

emerge -a =dev-util/shfmt-3.14.1

If this version is masked, you can unmask it using the autounmask tool or standard emerge options:

autounmask =dev-util/shfmt-3.14.1

Or alternatively:

emerge --autounmask-write -a =dev-util/shfmt-3.14.1

Package Information

Description:
A shell parser, formatter and interpreter (POSIX shell, bash, mksh)
Homepage:
https://github.com/mvdan/sh
License:
BSD Apache-2.0 MIT

Ebuild Details

Version EAPI Keywords Slot
3.14.1 8 ~amd64 ~arm64 0
View Raw Ebuild
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit go-module

MY_PN="sh"

DESCRIPTION="A shell parser, formatter and interpreter (POSIX shell, bash, mksh)"
HOMEPAGE="https://github.com/mvdan/sh"
SRC_URI="https://github.com/mvdan/sh/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
# Vendored dependency tree, generated with `go mod vendor` and hosted by the
# overlay. It carries a checksum in the Manifest, so the build needs no network
# and stays inside the sandbox -- unlike an `ego mod download` at build time.
SRC_URI+=" https://distfiles.obentoo.org/${P}-vendor.tar.xz"
S="${WORKDIR}/${MY_PN}-${PV}"

LICENSE="BSD"
# Dependent (bundled, statically linked) Go module licenses
LICENSE+=" Apache-2.0 MIT"
SLOT="0"
KEYWORDS="~amd64 ~arm64"

BDEPEND=">=dev-lang/go-1.26"

# shfmt reports its version through debug.ReadBuildInfo(), which for a build
# from a tarball says "(devel)". The patch bakes in the real version and only
# prefers the build info when it carries something meaningful. Without it the
# installed binary cannot answer `shfmt --version`.
PATCHES=(
	"${FILESDIR}"/${PN}-3.14.1-report-real-version.patch
)

src_compile() {
	ego build -trimpath -o shfmt ./cmd/shfmt
}

src_test() {
	ego test ./cmd/... ./syntax/...
}

src_install() {
	dobin shfmt
	einstalldocs
}

Inherited Eclasses

Dependencies

BDEPEND

>=dev-lang/go-1.26

Manifest for 3.14.1

Type File Size Source URLs
DIST shfmt-3.14.1-vendor.tar.xz 855680 bytes https://distfiles.obentoo.org/shfmt-3.14.1-vendor.tar.xz
DIST shfmt-3.14.1.tar.gz 295952 bytes https://github.com/mvdan/sh/archive/refs/tags/v3.14.1.tar.gz