diff options
author | Georgy Yakovlev <gyakovlev@gentoo.org> | 2021-12-14 23:04:51 -0800 |
---|---|---|
committer | Georgy Yakovlev <gyakovlev@gentoo.org> | 2021-12-14 23:06:14 -0800 |
commit | 70583258fdc6ba1d97567b0246acc3899c000de7 (patch) | |
tree | ae45916571bd2663e97ec24a608124080355e8e9 /app-shells/ksh | |
parent | app-shells/ksh: drop 9999 (diff) | |
download | gentoo-70583258fdc6ba1d97567b0246acc3899c000de7.tar.gz gentoo-70583258fdc6ba1d97567b0246acc3899c000de7.tar.bz2 gentoo-70583258fdc6ba1d97567b0246acc3899c000de7.zip |
app-shells/ksh: add 9999, based on https://github.com/ksh93/ksh
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Diffstat (limited to 'app-shells/ksh')
-rw-r--r-- | app-shells/ksh/ksh-9999.ebuild | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/app-shells/ksh/ksh-9999.ebuild b/app-shells/ksh/ksh-9999.ebuild new file mode 100644 index 000000000000..15fbc5bb62c7 --- /dev/null +++ b/app-shells/ksh/ksh-9999.ebuild @@ -0,0 +1,74 @@ +# Copyright 2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit flag-o-matic toolchain-funcs + +if [[ ${PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/ksh93/ksh" +else + KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~riscv" + MY_PV=$(ver_rs 3 - 4 .) + SRC_URI="https://github.com/ksh93/${PN}/archive/v${MY_PV}/ksh-v${MY_PV}.tar.gz" + S="${WORKDIR}/${PN}-${MY_PV}" +fi + +DESCRIPTION="The Original ATT Korn Shell" +HOMEPAGE="http://www.kornshell.com/" + +LICENSE="EPL-1.0" +SLOT="0" + +src_prepare() { + default + + # disable register for debugging + sed -i 1i"#define register" src/lib/libast/include/ast.h || die +} + +src_compile() { + local extraflags=( + "-Wno-unknown-pragmas" + "-Wno-missing-braces" + "-Wno-unused-result" + "-Wno-return-type" + "-Wno-int-to-pointer-cast" + "-Wno-parentheses" + "-Wno-unused" + "-Wno-unused-but-set-variable" + "-Wno-cpp" + "-Wno-maybe-uninitialized" + "-Wno-lto-type-mismatch" + "-P" + ) + append-cflags $(test-flags-CC ${extraflags[@]}) + filter-flags '-fdiagnostics-color=always' # https://github.com/ksh93/ksh/issues/379 + export CCFLAGS="${CFLAGS} -fno-strict-aliasing" + + tc-export AR CC LD NM + + sh bin/package make SHELL="${BROOT}"/bin/sh || die +} + +src_test() { + # test tries to catch IO error + addwrite /proc/self/mem + + # arith.sh uses A for tests + unset A + + sh bin/shtests --compile || die +} + +src_install() { + local myhost="$(sh bin/package host)" + cd "arch/${myhost}" || die + + dodir /bin + mv bin/ksh "${ED}"/bin/ || die + dosym ksh /bin/rksh + + newman man/man1/sh.1 ksh.1 +} |