diff options
author | 2022-08-04 11:33:48 -0700 | |
---|---|---|
committer | 2022-08-05 02:52:36 +0100 | |
commit | 0b896cd6c8f7e38f3c7e4c18f4a133cf6f591bed (patch) | |
tree | 898fee9292b764aef0151b690e289ed7699b675d /dev-util/sh | |
parent | dev-util/sh: generate man page (diff) | |
download | gentoo-0b896cd6c8f7e38f3c7e4c18f4a133cf6f591bed.tar.gz gentoo-0b896cd6c8f7e38f3c7e4c18f4a133cf6f591bed.tar.bz2 gentoo-0b896cd6c8f7e38f3c7e4c18f4a133cf6f591bed.zip |
dev-util/sh: add live build
Signed-off-by: Randall T. Vasquez <ran.dall@icloud.com>
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-util/sh')
-rw-r--r-- | dev-util/sh/sh-3.5.1.ebuild | 14 | ||||
-rw-r--r-- | dev-util/sh/sh-9999.ebuild | 54 |
2 files changed, 64 insertions, 4 deletions
diff --git a/dev-util/sh/sh-3.5.1.ebuild b/dev-util/sh/sh-3.5.1.ebuild index 7da56df5263e..ea48ab9e9b7d 100644 --- a/dev-util/sh/sh-3.5.1.ebuild +++ b/dev-util/sh/sh-3.5.1.ebuild @@ -7,12 +7,19 @@ inherit go-module DESCRIPTION="A shell parser, formatter, and interpreter with bash support" HOMEPAGE="https://github.com/mvdan/sh" -SRC_URI="https://github.com/mvdan/sh/archive/v${PV}.tar.gz -> ${P}.tar.gz" -SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-deps.tar.xz" + +if [[ ${PV} == *9999 ]]; then + EGIT_REPO_URI="https://github.com/mvdan/sh.git" + inherit git-r3 +else + SRC_URI="https://github.com/mvdan/sh/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" + SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-deps.tar.xz" + KEYWORDS="~amd64 ~arm64 ~x86" + S="${WORKDIR}/${PN//fmt/}-${PV}" +fi LICENSE="Apache-2.0 BSD" SLOT="0" -KEYWORDS="~amd64" IUSE="+man" BDEPEND="man? ( app-text/scdoc )" @@ -44,5 +51,4 @@ src_install() { if use man; then doman shfmt.1 fi - } diff --git a/dev-util/sh/sh-9999.ebuild b/dev-util/sh/sh-9999.ebuild new file mode 100644 index 000000000000..ea48ab9e9b7d --- /dev/null +++ b/dev-util/sh/sh-9999.ebuild @@ -0,0 +1,54 @@ +# Copyright 2022 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://github.com/mvdan/sh" + +if [[ ${PV} == *9999 ]]; then + EGIT_REPO_URI="https://github.com/mvdan/sh.git" + inherit git-r3 +else + SRC_URI="https://github.com/mvdan/sh/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" + SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-deps.tar.xz" + KEYWORDS="~amd64 ~arm64 ~x86" + S="${WORKDIR}/${PN//fmt/}-${PV}" +fi + +LICENSE="Apache-2.0 BSD" +SLOT="0" +IUSE="+man" + +BDEPEND="man? ( app-text/scdoc )" + +src_unpack() { + default + if [[ ${PV} == *9999 ]]; then + git-r3_src_unpack + go-module_live_vendor + fi +} + +src_compile() { + # Not bothering with gosh for now as it's very new + # https://github.com/mvdan/sh#gosh + ego build ./cmd/shfmt + if use man; then + scdoc <cmd/shfmt/shfmt.1.scd >shfmt.1 || die "conversation of man page failed" + fi +} + +src_test() { + cd syntax || die + ego test -run=- +} + +src_install() { + dobin shfmt + if use man; then + doman shfmt.1 + fi +} |