diff --git a/app-shells/oksh/oksh-7.9.ebuild b/app-shells/oksh/oksh-7.9.ebuild new file mode 100644 index 0000000..65f66b0 --- /dev/null +++ b/app-shells/oksh/oksh-7.9.ebuild @@ -0,0 +1,48 @@ +EAPI=8 + +DESCRIPTION="Portable OpenBSD Korn shell" +HOMEPAGE="https://github.com/ibara/oksh" +SRC_URI="https://github.com/ibara/oksh/releases/download/oksh-${PV}/oksh-${PV}.tar.gz" + +LICENSE="BSD-3 ISC public-domain" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~x86" +IUSE="ncurses" + +DEPEND="ncurses? ( sys-libs/ncurses )" +RDEPEND="${DEPEND}" + +src_configure() { + local myeconfargs=( + $(use_enable ncurses curses) + ) + + econf "${myeconfargs[@]}" +} + +src_test() { + local shell="${S}/oksh" + + [[ -x ${shell} ]] || die "oksh binary was not built" + + "${shell}" -c 'printf "%s\n" "$((2 + 2))"' \ + | grep -qx '4' \ + || die "arithmetic smoke test failed" + + "${shell}" -c 'x=oksh; test "$x" = oksh' \ + || die "shell variable/test smoke test failed" + + "${shell}" -c 'printf "%s\n" "hello world"' \ + | grep -qx 'hello world' \ + || die "basic output smoke test failed" + + "${shell}" -n -c 'case foo in foo) exit 0;; esac' \ + || die "syntax smoke test failed" +} + +src_install() { + emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install + + dodoc CONTRIBUTORS NOTES README.md README.pdksh LEGAL + doman oksh.1 +} \ No newline at end of file