summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>2019-11-25 08:27:21 +0100
committerMichał Górny <mgorny@gentoo.org>2019-12-02 00:24:22 +0100
commit5d643560ce412eeb1217d0e48642b71ad6e81b56 (patch)
treee87b77a580c863c050b7377425b66bffb43e31e5 /app-shells/mksh
parentapp-shells/mksh: USE=static now uses the system libc (diff)
downloadgentoo-5d643560ce412eeb1217d0e48642b71ad6e81b56.tar.gz
gentoo-5d643560ce412eeb1217d0e48642b71ad6e81b56.tar.bz2
gentoo-5d643560ce412eeb1217d0e48642b71ad6e81b56.zip
app-shells/mksh: Add USE=lksh
lksh is a variant of mksh intended for legacy scripts and strict POSIX-compatibility Signed-off-by: Haelwenn (lanodan) Monnier <contact@hacktivis.me> Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'app-shells/mksh')
-rw-r--r--app-shells/mksh/metadata.xml6
-rw-r--r--app-shells/mksh/mksh-57-r2.ebuild30
-rw-r--r--app-shells/mksh/mksh-9999.ebuild30
3 files changed, 64 insertions, 2 deletions
diff --git a/app-shells/mksh/metadata.xml b/app-shells/mksh/metadata.xml
index 9df017effeb6..c22c0afc77d8 100644
--- a/app-shells/mksh/metadata.xml
+++ b/app-shells/mksh/metadata.xml
@@ -9,4 +9,10 @@
<email>proxy-maint@gentoo.org</email>
<name>Proxy Maintainers</name>
</maintainer>
+ <use>
+ <flag name="lksh">
+variant that uses POSIX-compliant arithmetics with the host “long” data type
+and is automatically in POSIX mode when called as /bin/sh
+ </flag>
+ </use>
</pkgmetadata>
diff --git a/app-shells/mksh/mksh-57-r2.ebuild b/app-shells/mksh/mksh-57-r2.ebuild
index b818b1caf1a2..ff84abaff24a 100644
--- a/app-shells/mksh/mksh-57-r2.ebuild
+++ b/app-shells/mksh/mksh-57-r2.ebuild
@@ -23,7 +23,7 @@ HOMEPAGE="http://mirbsd.de/mksh"
LICENSE="BSD"
SLOT="0"
-IUSE="static test"
+IUSE="lksh static test"
RESTRICT="!test? ( test )"
DEPEND="
@@ -35,10 +35,25 @@ DEPEND="
S="${WORKDIR}/${PN}"
+src_prepare() {
+ default
+ if use lksh; then
+ cp -pr "${S}" "${S}"_lksh || die
+ fi
+}
+
src_compile() {
tc-export CC
use static && export LDSTATIC="-static"
export CPPFLAGS="${CPPFLAGS} -DMKSH_DEFAULT_PROFILEDIR=\\\"${EPREFIX}/etc\\\""
+
+ if use lksh; then
+ pushd "${S}"_lksh >/dev/null || die
+ CPPFLAGS="${CPPFLAGS} -DMKSH_BINSHPOSIX -DMKSH_BINSHREDUCED" \
+ sh Build.sh -r -L || die
+ popd >/dev/null || die
+ fi
+
sh Build.sh -r || die
}
@@ -47,8 +62,21 @@ src_install() {
dobin mksh
doman mksh.1
dodoc dot.mkshrc
+
+ if use lksh; then
+ dobin "${S}"_lksh/lksh
+ doman "${S}"_lksh/lksh.1
+ fi
}
src_test() {
+ einfo "Testing regular mksh."
./mksh test.sh -v || die
+
+ if use lksh; then
+ einfo "Testing lksh, POSIX long-bit mksh."
+ pushd "${S}"_lksh >/dev/null || die
+ ./lksh test.sh -v || die
+ popd >/dev/null || die
+ fi
}
diff --git a/app-shells/mksh/mksh-9999.ebuild b/app-shells/mksh/mksh-9999.ebuild
index b818b1caf1a2..ff84abaff24a 100644
--- a/app-shells/mksh/mksh-9999.ebuild
+++ b/app-shells/mksh/mksh-9999.ebuild
@@ -23,7 +23,7 @@ HOMEPAGE="http://mirbsd.de/mksh"
LICENSE="BSD"
SLOT="0"
-IUSE="static test"
+IUSE="lksh static test"
RESTRICT="!test? ( test )"
DEPEND="
@@ -35,10 +35,25 @@ DEPEND="
S="${WORKDIR}/${PN}"
+src_prepare() {
+ default
+ if use lksh; then
+ cp -pr "${S}" "${S}"_lksh || die
+ fi
+}
+
src_compile() {
tc-export CC
use static && export LDSTATIC="-static"
export CPPFLAGS="${CPPFLAGS} -DMKSH_DEFAULT_PROFILEDIR=\\\"${EPREFIX}/etc\\\""
+
+ if use lksh; then
+ pushd "${S}"_lksh >/dev/null || die
+ CPPFLAGS="${CPPFLAGS} -DMKSH_BINSHPOSIX -DMKSH_BINSHREDUCED" \
+ sh Build.sh -r -L || die
+ popd >/dev/null || die
+ fi
+
sh Build.sh -r || die
}
@@ -47,8 +62,21 @@ src_install() {
dobin mksh
doman mksh.1
dodoc dot.mkshrc
+
+ if use lksh; then
+ dobin "${S}"_lksh/lksh
+ doman "${S}"_lksh/lksh.1
+ fi
}
src_test() {
+ einfo "Testing regular mksh."
./mksh test.sh -v || die
+
+ if use lksh; then
+ einfo "Testing lksh, POSIX long-bit mksh."
+ pushd "${S}"_lksh >/dev/null || die
+ ./lksh test.sh -v || die
+ popd >/dev/null || die
+ fi
}