diff options
Diffstat (limited to 'app-shells/ksh/ksh-9999.ebuild')
-rw-r--r-- | app-shells/ksh/ksh-9999.ebuild | 83 |
1 files changed, 57 insertions, 26 deletions
diff --git a/app-shells/ksh/ksh-9999.ebuild b/app-shells/ksh/ksh-9999.ebuild index e5b08b6bef9c..c97a769209a6 100644 --- a/app-shells/ksh/ksh-9999.ebuild +++ b/app-shells/ksh/ksh-9999.ebuild @@ -1,44 +1,75 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 2021-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=7 +EAPI=8 -inherit meson ninja-utils +inherit flag-o-matic toolchain-funcs if [[ ${PV} == 9999 ]]; then inherit git-r3 - EGIT_REPO_URI="https://github.com/att/ast" + EGIT_REPO_URI="https://github.com/ksh93/ksh" else - KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86" - MY_PV="${PV/_/-}" - MY_P="${PN}-${MY_PV}" - SRC_URI="https://github.com/att/ast/releases/download/${MY_PV}/${MY_P}.tar.gz" - S="${WORKDIR}/${MY_P}" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" + 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 Korn Shell, 1993 revision (ksh93)" -HOMEPAGE="https://github.com/att/ast" +DESCRIPTION="The Original ATT Korn Shell" +HOMEPAGE="http://www.kornshell.com/" -LICENSE="CPL-1.0 EPL-1.0" +LICENSE="EPL-1.0" SLOT="0" -RDEPEND="!app-shells/pdksh" +src_prepare() { + default -src_test() { - # https://bugs.gentoo.org/702570 - addwrite /proc/self - local cmd=( - meson test - -C "${BUILD_DIR}" - --num-processes "$(makeopts_jobs ${NINJAOPTS:-${MAKEOPTS}})" + # 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" + "-P" ) - echo "${cmd[@]}" >&2 - # https://github.com/att/ast/issues/1392 - env -u T "${cmd[@]}" || die + append-cflags $(test-flags-CC ${extraflags[@]}) + append-cflags -fno-strict-aliasing + filter-flags '-fdiagnostics-color=always' # https://github.com/ksh93/ksh/issues/379 + filter-lto + + export CCFLAGS="${CFLAGS}" + tc-export AR CC LD NM + + sh bin/package make AR="${AR}" CC="${CC}" NM="${NM}" 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() { - meson_src_install - dodir /bin - mv "${ED}/usr/bin/ksh" "${ED}/bin/ksh" || die + local myhost="$(sh bin/package host)" + cd "arch/${myhost}" || die + + into / + dobin bin/ksh + dosym ksh /bin/rksh + + newman man/man1/sh.1 ksh.1 } |