# Rust package: build vendored/offline, no debuginfo extraction for the cargo binary %global debug_package %{nil} # For the forked pcre2 crate (bundled via cargo vendor as a git dependency) %global rust_pcre2_fish_tag 0.2.9-utf32 Name: fish Version: 4.8.1 Release: 1%{?dist} Summary: Friendly interactive shell # Code licenses, see LICENSE.dependencies for a full breakdown of crate licenses License: GPL-2.0-only AND GPL-2.0-or-later AND BSD-2-Clause AND PSF-2.0 AND ISC AND MIT AND (Apache-2.0 OR MIT) AND (Unlicense OR MIT) AND Zlib AND WTFPL URL: https://fishshell.com/ Source0: https://github.com/fish-shell/fish-shell/releases/download/%{version}/%{name}-%{version}.tar.xz # Cargo vendored crate sources (generated with: cargo vendor --versioned-dirs) Source1: %{name}-%{version}-vendor.tar.xz # .cargo/config.toml fragment redirecting all sources to the vendored copy Source2: cargo-vendor-config.toml BuildRequires: cargo BuildRequires: rust >= 1.85 BuildRequires: cmake >= 3.15 BuildRequires: ninja-build BuildRequires: gcc BuildRequires: gettext BuildRequires: ncurses-devel BuildRequires: pcre2-devel BuildRequires: pkgconfig BuildRequires: python3 # For building the documentation and man pages BuildRequires: /usr/bin/sphinx-build BuildRequires: /usr/bin/man # Needed to get terminfo entries Requires: ncurses-term # tab completion / help wants man-db Recommends: man-db # For the webconfig interface Provides: bundled(js-alpine) Provides: bundled(crate(pcre2)) = %{rust_pcre2_fish_tag} %description fish is a fully-equipped command line shell (like bash or zsh) that is smart and user-friendly. fish supports powerful features like syntax highlighting, autosuggestions, and tab completions that just work, with nothing to learn or configure. fish 4.x is a from-scratch rewrite in Rust. %prep %autosetup -n %{name}-%{version} -N # Overlay the vendored crate sources at the source-tree root (vendor/) tar -xf %{SOURCE1} # Preserve upstream .cargo/config.toml (contains the xtask alias) and append # the vendored-sources redirection so cargo builds fully offline. cat %{SOURCE2} >> .cargo/config.toml # Make bundled python helper scripts invoke python3 directly. for f in $(find share/tools -type f -name '*.py'); do sed -i -e '1{s@^#!.*@#!%{__python3}@}' "$f" done %build export CARGO_NET_OFFLINE=true export CARGO_HOME=$PWD/.cargo %cmake -GNinja \ -DCMAKE_BUILD_TYPE=Release \ -DWITH_DOCS=ON \ -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir} \ -Dextra_completionsdir=%{_datadir}/%{name}/vendor_completions.d \ -Dextra_functionsdir=%{_datadir}/%{name}/vendor_functions.d \ -Dextra_confdir=%{_datadir}/%{name}/vendor_conf.d %cmake_build # Remove /usr/local references from the generated pkgconfig file (RHBZ#1869376) sed -i 's^/usr/local/^/usr/^g' %{_vpath_builddir}/*.pc %install %cmake_install # Ship the top-level readme/contributing docs install -d %{buildroot}%{_pkgdocdir} cp -a README.rst CONTRIBUTING.rst %{buildroot}%{_pkgdocdir}/ %check export CARGO_NET_OFFLINE=true # Basic sanity checks on the freshly built binary. The full pexpect-based # fish_run_tests suite is flaky/interactive and unsuitable for headless mock, # so we verify the binary runs and executes script instead. FISH_BIN=$(find %{_vpath_builddir} -maxdepth 2 -type f -name fish | head -1) "$FISH_BIN" --version "$FISH_BIN" -c 'echo fish-smoke-ok; set -l x 40; math $x + 2' %post if [ "$1" = 1 ]; then if [ ! -f %{_sysconfdir}/shells ] ; then echo "%{_bindir}/fish" > %{_sysconfdir}/shells echo "/bin/fish" >> %{_sysconfdir}/shells else grep -q "^%{_bindir}/fish$" %{_sysconfdir}/shells || echo "%{_bindir}/fish" >> %{_sysconfdir}/shells grep -q "^/bin/fish$" %{_sysconfdir}/shells || echo "/bin/fish" >> %{_sysconfdir}/shells fi fi %postun if [ "$1" = 0 ] && [ -f %{_sysconfdir}/shells ] ; then sed -i '\!^%{_bindir}/fish$!d' %{_sysconfdir}/shells sed -i '\!^/bin/fish$!d' %{_sysconfdir}/shells fi %files %license COPYING %doc %{_pkgdocdir} %{_mandir}/man1/fish*.1* %{_bindir}/fish* %dir %{_sysconfdir}/fish %config(noreplace) %{_sysconfdir}/fish/config.fish %{_datadir}/fish/ %{_datadir}/pkgconfig/fish.pc %changelog * Wed Jul 22 2026 Yonghang Wang - 4.8.1-1 - Update to 4.8.1 (major Rust rewrite, replaces the 3.7.0 C++ build) - Build offline from cargo-vendored crate sources (incl. forked pcre2 git dep) - Build via CMake+Ninja wrapping cargo; docs built with sphinx