On Thu, 2019-09-19 at 19:47 +0200, Haelwenn (lanodan) Monnier wrote: > lksh is a variant of mksh intended for legacy scripts and strict > POSIX-compatibility > > Signed-off-by: Haelwenn (lanodan) Monnier > --- > app-shells/mksh/metadata.xml | 6 ++++++ > app-shells/mksh/mksh-57-r2.ebuild | 30 +++++++++++++++++++++++++++++- > app-shells/mksh/mksh-9999.ebuild | 30 +++++++++++++++++++++++++++++- > 3 files changed, 64 insertions(+), 2 deletions(-) > > diff --git a/app-shells/mksh/metadata.xml b/app-shells/mksh/metadata.xml > index 9df017effeb..c22c0afc77d 100644 > --- a/app-shells/mksh/metadata.xml > +++ b/app-shells/mksh/metadata.xml > @@ -9,4 +9,10 @@ > proxy-maint@gentoo.org > Proxy Maintainers > > + > + > +variant that uses POSIX-compliant arithmetics with the host “long” data type > +and is automatically in POSIX mode when called as /bin/sh > + > + > > diff --git a/app-shells/mksh/mksh-57-r2.ebuild b/app-shells/mksh/mksh-57-r2.ebuild > index cb6db11f38c..d4a21a7175f 100644 > --- a/app-shells/mksh/mksh-57-r2.ebuild > +++ b/app-shells/mksh/mksh-57-r2.ebuild > @@ -21,7 +21,7 @@ DESCRIPTION="MirBSD Korn Shell" > HOMEPAGE="http://mirbsd.de/mksh" > LICENSE="BSD" > SLOT="0" > -IUSE="static test" > +IUSE="lksh static test" > DEPEND=" > test? ( > dev-lang/perl > @@ -30,10 +30,25 @@ DEPEND=" > " > S="${WORKDIR}/${PN}" > > +src_prepare() { > + default > + if use lksh; then > + cp -pr "${S}" "${S}"_lksh || die > + fi > +} > + > src_compile() { > tc-export CC > if use static; then export LDSTATIC="-static"; fi > export CPPFLAGS="${CPPFLAGS} -DMKSH_DEFAULT_PROFILEDIR=\\\"${EPREFIX}/etc\\\"" > + > + if use lksh; then > + pushd "${S}"_lksh || die > + CPPFLAGS="${CPPFLAGS} -DMKSH_BINSHPOSIX -DMKSH_BINSHREDUCED" \ > + sh Build.sh -r -L || die > + popd || die > + fi > + > sh Build.sh -r || die > } > > @@ -42,8 +57,21 @@ src_install() { > dobin mksh > doman mksh.1 > dodoc dot.mkshrc > + > + if use lksh; then > + pushd "${S}"_lksh || die > + dobin lksh > + doman lksh.1 > + popd || die > + fi > } > > src_test() { > ./test.sh -v || die > + > + if use lksh; then > + pushd "${S}"_lksh || die > + ./test.sh -v || die > + popd || die > + fi > } > diff --git a/app-shells/mksh/mksh-9999.ebuild b/app-shells/mksh/mksh-9999.ebuild > index cb6db11f38c..d4a21a7175f 100644 > --- a/app-shells/mksh/mksh-9999.ebuild > +++ b/app-shells/mksh/mksh-9999.ebuild > @@ -21,7 +21,7 @@ DESCRIPTION="MirBSD Korn Shell" > HOMEPAGE="http://mirbsd.de/mksh" > LICENSE="BSD" > SLOT="0" > -IUSE="static test" > +IUSE="lksh static test" > DEPEND=" > test? ( > dev-lang/perl > @@ -30,10 +30,25 @@ DEPEND=" > " > S="${WORKDIR}/${PN}" > > +src_prepare() { > + default > + if use lksh; then > + cp -pr "${S}" "${S}"_lksh || die > + fi > +} > + > src_compile() { > tc-export CC > if use static; then export LDSTATIC="-static"; fi > export CPPFLAGS="${CPPFLAGS} -DMKSH_DEFAULT_PROFILEDIR=\\\"${EPREFIX}/etc\\\"" > + > + if use lksh; then > + pushd "${S}"_lksh || die We generally >/dev/null pushd and popd to avoid weird-ish output in middle of build log. > + CPPFLAGS="${CPPFLAGS} -DMKSH_BINSHPOSIX -DMKSH_BINSHREDUCED" \ > + sh Build.sh -r -L || die > + popd || die > + fi > + > sh Build.sh -r || die > } > > @@ -42,8 +57,21 @@ src_install() { > dobin mksh > doman mksh.1 > dodoc dot.mkshrc > + > + if use lksh; then > + pushd "${S}"_lksh || die Since you're installing just two files, wouldn't it be easier to just use full path in dobin/doman? > + dobin lksh > + doman lksh.1 > + popd || die > + fi > } > > src_test() { > ./test.sh -v || die > + > + if use lksh; then You may want to add some 'einfo' to make it clear which one is being tested right now. > + pushd "${S}"_lksh || die > + ./test.sh -v || die > + popd || die > + fi > } -- Best regards, Michał Górny