commit: c449aec6f5bc6a3461c3479c44f6ba7ef95a655f Author: idealseal <realidealseal <AT> protonmail <DOT> com> AuthorDate: Thu Mar 13 14:23:28 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Thu Mar 13 17:06:59 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c449aec6
app-shells/fish: cleanup ebuild, make tests work Remove all but cargo tests. Upstream has fixes for our test issues but they weren't backported to 4.0.1. Closes: https://bugs.gentoo.org/715976 Closes: https://bugs.gentoo.org/727684 Closes: https://bugs.gentoo.org/802873 Closes: https://bugs.gentoo.org/807742 Closes: https://bugs.gentoo.org/838187 Closes: https://bugs.gentoo.org/886161 Closes: https://bugs.gentoo.org/950051 Signed-off-by: idealseal <realidealseal <AT> protonmail.com> Signed-off-by: Sam James <sam <AT> gentoo.org> app-shells/fish/fish-4.0.1.ebuild | 104 ++++++++++---------------------------- 1 file changed, 28 insertions(+), 76 deletions(-) diff --git a/app-shells/fish/fish-4.0.1.ebuild b/app-shells/fish/fish-4.0.1.ebuild index 61eb5b15a6b5..5d155c4ce982 100644 --- a/app-shells/fish/fish-4.0.1.ebuild +++ b/app-shells/fish/fish-4.0.1.ebuild @@ -10,9 +10,7 @@ declare -A GIT_CRATES=( [pcre2]='https://github.com/fish-shell/rust-pcre2;85b7afba1a9d9bd445779800e5bcafeb732e4421;rust-pcre2-%commit%' ) -PYTHON_COMPAT=( python3_{11..13} ) - -inherit cargo cmake python-any-r1 readme.gentoo-r1 xdg +inherit cargo cmake multiprocessing readme.gentoo-r1 xdg DESCRIPTION="Friendly Interactive SHell" HOMEPAGE="https://fishshell.com/" @@ -38,34 +36,17 @@ LICENSE="GPL-2 BSD BSD-2 CC0-1.0 GPL-2+ ISC LGPL-2+ MIT PSF-2 ZLIB" # Dependent crate licenses LICENSE+=" MIT Unicode-DFS-2016 WTFPL-2 ZLIB" SLOT="0" -IUSE="+doc nls split-usr test" +IUSE="+doc nls test" RESTRICT="!test? ( test )" BDEPEND=" nls? ( sys-devel/gettext ) - test? ( - ${PYTHON_DEPS} - dev-tcltk/expect - $(python_gen_any_dep ' - dev-python/pexpect[${PYTHON_USEDEP}] - ') - ) " -# we don't need sphinx dep for release tarballs +# Release tarballs contain prebuilt documentation. [[ ${PV} == 9999 ]] && BDEPEND+=" doc? ( dev-python/sphinx )" -QA_FLAGS_IGNORED="**bin/fish*" - -python_check_deps() { - use test || return 0 - python_has_version "dev-python/pexpect[${PYTHON_USEDEP}]" -} - -pkg_setup() { - use test && python-any-r1_pkg_setup - rust_pkg_setup -} +QA_FLAGS_IGNORED="usr/bin/.*" src_unpack() { if [[ ${PV} == 9999 ]]; then @@ -76,81 +57,52 @@ src_unpack() { fi } -src_prepare() { - # workaround for https://github.com/fish-shell/fish-shell/issues/4883 - if use split-usr; then - sed -i 's#${TEST_INSTALL_DIR}/${CMAKE_INSTALL_PREFIX}#${TEST_INSTALL_DIR}#' \ - cmake/Tests.cmake || die - fi - - # remove the build targets from the default build set so they are not wanted - # if cmake_src_install is called - sed -i \ - -e ' - /function(CREATE_TARGET target)/,/endfunction(CREATE_TARGET)/ { - s/${target} ALL/${target}/ - }' CMakeLists.txt || die - - cmake_src_prepare -} - src_configure() { local mycmakeargs=( - # installing into /bin breaks tests on merged usr systems. - # sbin -> bin symlink confuses tests. - # so on split-usr we install to /bin. - # on merge-usr we set sbindir to bin. - $(usex split-usr "-DCMAKE_INSTALL_BINDIR=${EPREFIX}/bin" \ - "-DCMAKE_INSTALL_SBINDIR=${EPREFIX}/usr/bin") -DCMAKE_INSTALL_SYSCONFDIR="${EPREFIX}/etc" + -DCTEST_PARALLEL_LEVEL="$(makeopts_jobs)" -DINSTALL_DOCS="$(usex doc)" - -DWITH_GETTEXT="$(usex nls)" ) - # release tarballs ship pre-built docs // -DHAVE_PREBUILT_DOCS=TRUE - if [[ ${PV} == 9999 ]]; then - mycmakeargs+=( -DBUILD_DOCS="$(usex doc)" ) - else - mycmakeargs+=( -DBUILD_DOCS=OFF ) - fi - cargo_src_configure --no-default-features --bin fish --bin fish_indent --bin fish_key_reader + cargo_src_configure --no-default-features \ + --bin fish \ + --bin fish_indent \ + --bin fish_key_reader cmake_src_configure } src_compile() { local -x PREFIX="${EPREFIX}/usr" local -x DOCDIR="${EPREFIX}/usr/share/doc/${PF}" + local -x CMAKE_WITH_GETTEXT="$(usex nls 1 0)" + # Bug: https://bugs.gentoo.org/950699 local -x SYSCONFDIR="${EPREFIX}/etc" - local -x CMAKE_WITH_GETTEXT - CMAKE_WITH_GETTEXT="$(usex nls 1 0)" + + # Release tarballs contain prebuilt documentation. + local -x FISH_BUILD_DOCS + if [[ ${PV} == 9999 ]]; then + FISH_BUILD_DOCS="$(usex doc 1 0)" + else + FISH_BUILD_DOCS=0 + fi + cargo_src_compile + # Copy built binaries into the cmake build directory to mark the targets + # up-to-date in cmake. for target in fish fish_indent fish_key_reader; do cp "$(cargo_target_dir)/${target}" "${BUILD_DIR}" || die done + cmake_src_compile } src_test() { - # tests will create temporary files - local -x TMPDIR="${T}" - - # some tests are fragile, sanitize environment - local -x COLUMNS=80 - local -x LINES=24 - - # very fragile, depends on terminal, size, tmux, screen and timing - # no die is intentional, for repeated test runs - if [[ ${PV} != 9999 ]]; then - rm -v tests/pexpects/terminal.py || : - fi - - # TODO: fix tests & submit upstream - # tests are confused by usr/sbin -> bin symlink, no die is intentional for repeated test runs - use split-usr || rm -v tests/checks/{redirect,type}.fish || : - - # tests are invoked through the `fish_run_tests` target - cargo_env cmake_build fish_run_tests + local -x CARGO_TERM_COLOR=always + local -x FISH_SOURCE_DIR="${S}" + local -x FISH_FORCE_COLOR=1 + local -x TEST_VERBOSE=1 + cargo_env cmake_src_test -R cargo-test } src_install() {
