mirror of
https://codeberg.org/gigirassy/nune-gentoo-overlay
synced 2026-08-30 23:47:39 +00:00
70 lines
1.6 KiB
Bash
70 lines
1.6 KiB
Bash
EAPI=8
|
|
|
|
inherit toolchain-funcs
|
|
|
|
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"
|
|
|
|
DEPEND="sys-libs/ncurses-compat"
|
|
RDEPEND="${DEPEND}"
|
|
BDEPEND="virtual/pkgconfig"
|
|
|
|
src_configure() {
|
|
cat > conftest.c <<-EOF
|
|
#include <term.h>
|
|
#include <ncurses.h>
|
|
int main(void) { setupterm(NULL, 0, NULL); return 0; }
|
|
EOF
|
|
|
|
echo "=== testing -lcurses ==="
|
|
if ${CC} ${CFLAGS} -o conftest.o -c conftest.c &&
|
|
${CC} ${LDFLAGS} -o conftest conftest.o -lcurses
|
|
then
|
|
echo "=== -lcurses WORKS ==="
|
|
else
|
|
echo "=== -lcurses FAILED ==="
|
|
fi
|
|
|
|
echo "=== testing -lncurses ==="
|
|
if ${CC} ${CFLAGS} -o conftest.o -c conftest.c &&
|
|
${CC} ${LDFLAGS} -o conftest conftest.o -lncurses
|
|
then
|
|
echo "=== -lncurses WORKS ==="
|
|
else
|
|
echo "=== -lncurses FAILED ==="
|
|
fi
|
|
|
|
econf --enable-curses
|
|
}
|
|
|
|
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
|
|
} |