diff options
Diffstat (limited to 'app-shells/bash-completion/bash-completion-9999.ebuild')
-rw-r--r-- | app-shells/bash-completion/bash-completion-9999.ebuild | 110 |
1 files changed, 64 insertions, 46 deletions
diff --git a/app-shells/bash-completion/bash-completion-9999.ebuild b/app-shells/bash-completion/bash-completion-9999.ebuild index ee27e7fcf8fe..322f3a72d214 100644 --- a/app-shells/bash-completion/bash-completion-9999.ebuild +++ b/app-shells/bash-completion/bash-completion-9999.ebuild @@ -1,9 +1,10 @@ -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=7 +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) -PYTHON_COMPAT=( python3_{5,6,7} ) inherit autotools git-r3 python-any-r1 DESCRIPTION="Programmable Completion for bash" @@ -12,27 +13,30 @@ EGIT_REPO_URI="https://github.com/scop/bash-completion" LICENSE="GPL-2+" SLOT="0" -KEYWORDS="" IUSE="+eselect test" RESTRICT="!test? ( test )" # completion collision with net-fs/mc -RDEPEND=">=app-shells/bash-4.3_p30-r1:0 +RDEPEND=" + >=app-shells/bash-4.3_p30-r1:0 sys-apps/miscfiles - !app-eselect/eselect-bashcomp - !!net-fs/mc" -DEPEND=" + !<app-text/tree-2.1.1-r1 + !!net-fs/mc +" +BDEPEND=" test? ( ${RDEPEND} - app-misc/dtach - dev-util/dejagnu - dev-tcltk/tcllib $(python_gen_any_dep ' dev-python/pexpect[${PYTHON_USEDEP}] dev-python/pytest[${PYTHON_USEDEP}] + dev-python/pytest-forked[${PYTHON_USEDEP}] + dev-python/pytest-xdist[${PYTHON_USEDEP}] ') - )" -PDEPEND=">=app-shells/gentoo-bashcomp-20140911" + ) +" +PDEPEND=" + >=app-shells/gentoo-bashcomp-20140911 +" strip_completions() { # Remove unwanted completions. @@ -49,13 +53,11 @@ strip_completions() { # Now-dead symlinks to deprecated completions hd ncal + + # FreeBSD + freebsd-update kldload kldunload portinstall portsnap + pkg_deinstall pkg_delete pkg_info ) - if [[ ${ARCH} != *-fbsd && ${ARCH} != *-freebsd ]]; then - strip_completions+=( - freebsd-update kldload kldunload portinstall portsnap - pkg_deinstall pkg_delete pkg_info - ) - fi local file for file in "${strip_completions[@]}"; do @@ -68,8 +70,10 @@ strip_completions() { } python_check_deps() { - has_version "dev-python/pexpect[${PYTHON_USEDEP}]" && - has_version "dev-python/pytest[${PYTHON_USEDEP}]" + python_has_version "dev-python/pexpect[${PYTHON_USEDEP}]" && + python_has_version "dev-python/pytest[${PYTHON_USEDEP}]" && + python_has_version "dev-python/pytest-forked[${PYTHON_USEDEP}]" && + python_has_version "dev-python/pytest-xdist[${PYTHON_USEDEP}]" } pkg_setup() { @@ -77,46 +81,51 @@ pkg_setup() { } src_unpack() { - use eselect && git-r3_fetch https://github.com/mgorny/bashcomp2 + use eselect && git-r3_fetch https://github.com/projg2/bashcomp2 git-r3_fetch - use eselect && git-r3_checkout https://github.com/mgorny/bashcomp2 \ + use eselect && git-r3_checkout https://github.com/projg2/bashcomp2 \ "${WORKDIR}"/bashcomp2 git-r3_checkout } src_prepare() { - eapply_user if use eselect; then # generate and apply patch emake -C "${WORKDIR}"/bashcomp2 bash-completion-blacklist-support.patch eapply "${WORKDIR}"/bashcomp2/bash-completion-blacklist-support.patch fi + eapply_user eautoreconf } src_test() { - # Tests need an interactive shell, #477066 - # idea stolen from: - # http://pkgs.fedoraproject.org/cgit/rpms/bash-completion.git/tree/bash-completion.spec - - # real-time output of the log ;-) - touch "${T}/dtach-test.log" || die - tail -f "${T}/dtach-test.log" & - local tail_pid=${!} - - # override the default expect timeout and buffer size to avoid tests - # failing randomly due to cold cache, busy system or just more output - # than upstream anticipated (they run tests on pristine docker - # installs of binary distros) - nonfatal dtach -N "${T}/dtach.sock" \ - bash -c 'emake check RUNTESTFLAGS="OPT_TIMEOUT=300 OPT_BUFFER_SIZE=1000000" PYTESTFLAGS="-vv" \ - &> "${T}"/dtach-test.log; echo ${?} > "${T}"/dtach-test.out' - - kill "${tail_pid}" - [[ -f ${T}/dtach-test.out ]] || die "Unable to run tests" - [[ $(<"${T}"/dtach-test.out) == 0 ]] || die "Tests failed" + local EPYTEST_DESELECT=( + # redhat-specific, we strip these completions + test/t/test_if{down,up}.py + # not available for icedtea + test/t/test_javaws.py + # TODO + test/t/test_vi.py::TestVi::test_2 + test/t/test_xmlwf.py::TestXmlwf::test_2 #bug 886159 + test/t/test_xrandr.py::TestXrandr::test_output_filter + ) + local EPYTEST_IGNORE=( + # stupid test that async tests work + test/fixtures/pytest/test_async.py + ) + local EPYTEST_XDIST=1 + + # portage's HOME override breaks tests + local -x HOME=$(unset HOME; echo ~) + addpredict "${HOME}" + # used in pytest tests + local -x NETWORK=none + local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 + local -x PYTEST_PLUGINS=xdist.plugin,pytest_forked + emake -C completions check + epytest } src_install() { @@ -127,12 +136,21 @@ src_install() { strip_completions - dodoc AUTHORS CHANGES CONTRIBUTING.md README.md + dodoc AUTHORS CHANGELOG.md CONTRIBUTING.md README.md + + # install the python completions for all targets, bug #622892 + local TARGET + for TARGET in "${PYTHON_COMPAT[@]}"; do + if [[ ! -e "${ED}"/usr/share/bash-completion/completions/${TARGET/_/.} ]]; then + dosym python "${ED}"/usr/share/bash-completion/completions/${TARGET/_/.} + fi + done # install the eselect module - use eselect && + if use eselect; then emake -C "${WORKDIR}"/bashcomp2 DESTDIR="${D}" \ PREFIX="${EPREFIX}/usr" install + fi } pkg_postinst() { |