# Template file for 'fish-shell'
pkgname=fish-shell
version=4.7.1
revision=1
build_style=cmake
build_helper="rust"
configure_args="-DCMAKE_BUILD_TYPE=Release -DRust_CARGO=${XBPS_WRAPPERDIR}/cargo"
make_check_target="fish_run_tests"
hostmakedepends="gettext pkg-config cargo cargo-auditable python3-Sphinx"
makedepends="pcre2-devel rust-std"
checkdepends="git mdocml python3-pexpect procps-ng"
short_desc="User friendly shell intended mostly for interactive use"
maintainer="tranzystorekk <tranzystorek.io@protonmail.com>"
license="GPL-2.0-only"
homepage="https://fishshell.com/"
changelog="https://raw.githubusercontent.com/fish-shell/fish-shell/refs/heads/master/CHANGELOG.rst"
distfiles="https://github.com/fish-shell/fish-shell/releases/download/${version}/fish-${version}.tar.xz"
checksum=6f4d5b438a6338e3f5dcda19a28261e2ece7a9b7ff97686685e6abdc31dbb7df
register_shell="/bin/fish /usr/bin/fish"
# some tests fail in ci, cba to hardcode skipping
make_check=ci-skip

# project shells out to the cross-built binary to generate docs
if [ ${CROSS_BUILD} ]; then
	configure_args+=" -DWITH_DOCS=OFF"
fi

post_install() {
	# Starting with fish-3.0.0 this is a skeleton file with only comments
	rm ${DESTDIR}/etc/fish/config.fish

	ln -sf fish ${DESTDIR}/usr/bin/fish_indent
	ln -sf fish ${DESTDIR}/usr/bin/fish_key_reader
}
