app-shells/fish: add 4.2.0

Signed-off-by: idealseal <realidealseal@protonmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/44571
Closes: https://github.com/gentoo/gentoo/pull/44571
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
idealseal
2025-11-10 10:52:20 +00:00
committed by Sam James
parent 841c866545
commit a89d64e65d
3 changed files with 171 additions and 0 deletions

View File

@@ -4,9 +4,11 @@ DIST fish-4.0.8.tar.xz 3057636 BLAKE2B 9b49efda655f46a29420001dcda7270be4f38b829
DIST fish-4.1.0.tar.xz 3275104 BLAKE2B 3b6abaab2167a84f327724b4482df15101cfb6aae5bdfea3a90249ec3dc307ec9a99910347a3ab01702e28d76981106198c462f2f6d30db8fe8e9ba2d0dbb5dd SHA512 01678f235afb77ad03b06e18b58665b2111df1624b946de66f814e2a8937d9543ce18f806d5eb40adc490591995fe95dabc8f3c8cffbda3611cd6c91d0f7707c
DIST fish-4.1.1.tar.xz 2966548 BLAKE2B c6dc29a272be382f5f8804723e684e2bedc4a4ff45b66ee6baad3382d7640309c9539501cd2a8183af7e010f4f2c47dfdf295dae47d57bcd0967430689a1dd9b SHA512 00872dac175072142721580fbe8cee0b45d9fdc478dc6bfd857fe4c1f64b6cbf0c7cf3e678ab1b083f74579903f3804533975dd92bdfad325223852e3033e07b
DIST fish-4.1.2.tar.xz 2968176 BLAKE2B dccd3eb52dc2a8b799e49b9d62e32f5fad756ee4e5e52027354c82ceebd8c18d99d48d3701d6894c565503a0312f1c2060dde0f1867df3fd98b830c242064d69 SHA512 a4b3fb1db13d338738189aece6b2764174d786a065044f211296554e73fd07cfe6913edef364d6a671717f789b6c6288345b489d537e61cece78ac668b44efcf
DIST fish-4.2.0.tar.xz 3010224 BLAKE2B 4de4f9d0b35aea008fb032ced8ed5ad0283d8ccdcc794c5b3bbc1bd101f135982a0967cfc104da0ed1da8f778715b4ad7de3a23d85b572c258ffccc299fbaa38 SHA512 9214b6c252e90a7574b79cc101206d6bb4d0999457b827f293410d69341f4f2e9f1ad44eb498c57c0f83fd17e5adb7b6ea716e89441ab93b444e35505c2beb2a
DIST fish-shell-4.0.6-crates.tar.xz 7622808 BLAKE2B 8a939212f1ba7585d66d9922c8231394e47e1eb49b38eda5a00839fdc0a99f2ae121e38dcb206af8f95470253b9691d9be4025a35eadfe907dd862bd27302ad5 SHA512 c221dcae64a46c5eae7b7a19001acb694cec02e355510c1014c0e61345afaa77cc700fba7ce0914494d8db0f99ca5f014f22ce7e9a68ad2f008bbee699317455
DIST fish-shell-4.0.8-crates.tar.xz 7622808 BLAKE2B 8a939212f1ba7585d66d9922c8231394e47e1eb49b38eda5a00839fdc0a99f2ae121e38dcb206af8f95470253b9691d9be4025a35eadfe907dd862bd27302ad5 SHA512 c221dcae64a46c5eae7b7a19001acb694cec02e355510c1014c0e61345afaa77cc700fba7ce0914494d8db0f99ca5f014f22ce7e9a68ad2f008bbee699317455
DIST fish-shell-4.1.0-crates.tar.xz 7131000 BLAKE2B f36b33851cbee50a5d80a9527f969dfeae7963c0944c608ac3440b01b23691f63d1da05b7d824056b77ce2b0001a40ec1476aaab6b3d8aceb284711d488d4a18 SHA512 1f542be9f2174be0c7c4451b66df3cb32c010d5d0a6d330078cc818e09df7b9f6d16a9001fe7fc0262276e14e1e6be2eb63408f10ddca609d43d8130b673b438
DIST fish-shell-4.1.1-crates.tar.xz 7131000 BLAKE2B f36b33851cbee50a5d80a9527f969dfeae7963c0944c608ac3440b01b23691f63d1da05b7d824056b77ce2b0001a40ec1476aaab6b3d8aceb284711d488d4a18 SHA512 1f542be9f2174be0c7c4451b66df3cb32c010d5d0a6d330078cc818e09df7b9f6d16a9001fe7fc0262276e14e1e6be2eb63408f10ddca609d43d8130b673b438
DIST fish-shell-4.1.2-crates.tar.xz 7131000 BLAKE2B f36b33851cbee50a5d80a9527f969dfeae7963c0944c608ac3440b01b23691f63d1da05b7d824056b77ce2b0001a40ec1476aaab6b3d8aceb284711d488d4a18 SHA512 1f542be9f2174be0c7c4451b66df3cb32c010d5d0a6d330078cc818e09df7b9f6d16a9001fe7fc0262276e14e1e6be2eb63408f10ddca609d43d8130b673b438
DIST fish-shell-4.2.0-crates.tar.xz 6407044 BLAKE2B aa88ef25cb25ab5b3fd8a5b9faa4e9e91572fe8dfcb1bbb749404bd0cbdaaf36caab1b27e3d874e788b980bd213fc56bf8b4916f82d9a239aa1c9ec7c68985a9 SHA512 affe98ddba9a582f23289149464d50897d54bd1efe931b67721f05ade34f35e69bb31f00dcedd1dc025d04025135e17cee185dbad0f028ace140cfe8dacb4a81
DIST rust-pcre2-85b7afba1a9d9bd445779800e5bcafeb732e4421.gh.tar.gz 743187 BLAKE2B 533671ee8e97e65b93aa9103135848e8a85d79a2f525100aa0120500def9479675f6140878fa7b9bb248e51175ceac7c5710ce247af6e10385a00b23c8986b68 SHA512 9323e4d11708d8dc0e7ed607e97b8d4fac6f4a0b955e5e07b76da8152178888bc0ae2d2c109dd58b97d5faa037216e88365fcacb606f23f912d2edb82ede23ad

View File

@@ -0,0 +1,59 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d161def836..19a0dbc499 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -54,27 +54,16 @@
set(build_types Release RelWithDebInfo Debug "")
if(NOT "${CMAKE_BUILD_TYPE}" IN_LIST build_types)
- message(WARNING "Unsupported build type ${CMAKE_BUILD_TYPE}. If this doesn't build, try one of Release, RelWithDebInfo or Debug")
+ message(WARNING "Unsupported build type ${CMAKE_BUILD_TYPE}. If this doesn't build, try one of Release, RelWithDebInfo or Debug")
endif()
# Define a function to build and link dependencies.
function(CREATE_TARGET target)
- add_custom_target(
+ add_custom_target(
${target} ALL
COMMAND
"${CMAKE_COMMAND}" -E
- env ${VARS_FOR_CARGO}
- ${Rust_CARGO}
- build --bin ${target}
- $<$<CONFIG:Release>:--release>
- $<$<CONFIG:RelWithDebInfo>:--profile=release-with-debug>
- --target ${Rust_CARGO_TARGET}
- --no-default-features
- --features=${FISH_CARGO_FEATURES}
- ${CARGO_FLAGS}
- &&
- "${CMAKE_COMMAND}" -E
- copy "${rust_target_dir}/${rust_profile}/${target}" "${CMAKE_CURRENT_BINARY_DIR}"
+ copy "${FISH_RUST_BUILD_DIR}/${rust_profile}/${target}" "${CMAKE_CURRENT_BINARY_DIR}"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
USES_TERMINAL
)
diff --git a/cmake/Rust.cmake b/cmake/Rust.cmake
index 1de0da5803..c92c1cc2af 100644
--- a/cmake/Rust.cmake
+++ b/cmake/Rust.cmake
@@ -1,7 +1,7 @@
include(FindRust)
find_package(Rust REQUIRED)
-set(FISH_RUST_BUILD_DIR "${CMAKE_BINARY_DIR}/cargo/build")
+set(FISH_RUST_BUILD_DIR "${CMAKE_SOURCE_DIR}/target")
list(APPEND FISH_CARGO_FEATURES_LIST "embed-data")
@@ -20,8 +20,8 @@
set(rust_target_dir "${FISH_RUST_BUILD_DIR}/${Rust_CARGO_HOST_TARGET}")
endif()
-set(rust_profile $<IF:$<CONFIG:Debug>,debug,$<IF:$<CONFIG:RelWithDebInfo>,release-with-debug,release>>)
-set(rust_debugflags "$<$<CONFIG:Debug>:-g>$<$<CONFIG:RelWithDebInfo>:-g>")
+set(rust_profile $<IF:$<CONFIG:Debug>,debug,release>)
+set(rust_debugflags $<$<CONFIG:Debug>:-g>)
option(WITH_GETTEXT "Build with gettext localization support. Requires `msgfmt` to work." ON)
# Enable gettext feature unless explicitly disabled.

View File

@@ -0,0 +1,110 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
CRATES=""
RUST_MIN_VER="1.85.0"
declare -A GIT_CRATES=(
[pcre2-sys]='https://github.com/fish-shell/rust-pcre2;85b7afba1a9d9bd445779800e5bcafeb732e4421;rust-pcre2-%commit%/pcre2-sys'
[pcre2]='https://github.com/fish-shell/rust-pcre2;85b7afba1a9d9bd445779800e5bcafeb732e4421;rust-pcre2-%commit%'
)
inherit cargo cmake readme.gentoo-r1 xdg
DESCRIPTION="Friendly Interactive SHell"
HOMEPAGE="https://fishshell.com/"
MY_PV="${PV/_beta/b}"
MY_P="${PN}-${MY_PV}"
if [[ ${PV} == 9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/fish-shell/fish-shell.git"
else
SRC_URI="
https://github.com/fish-shell/fish-shell/releases/download/${MY_PV}/${MY_P}.tar.xz
https://github.com/gentoo-crate-dist/fish-shell/releases/download/${MY_PV}/fish-shell-${MY_PV}-crates.tar.xz
${CARGO_CRATE_URIS}
"
KEYWORDS="~amd64 ~arm64 ~loong ~ppc64 ~riscv ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
fi
S="${WORKDIR}/${MY_P}"
LICENSE="GPL-2 BSD BSD-2 CC0-1.0 GPL-2+ ISC LGPL-2+ MIT PSF-2 ZLIB"
# Dependent crate licenses
LICENSE+=" Apache-2.0 MIT MPL-2.0 Unicode-3.0 WTFPL-2 ZLIB"
SLOT="0"
IUSE="+doc nls test"
RESTRICT="!test? ( test )"
BDEPEND="nls? ( sys-devel/gettext )"
# Release tarballs contain prebuilt documentation.
[[ ${PV} == 9999 ]] && BDEPEND+=" doc? ( dev-python/sphinx )"
PATCHES=(
"${FILESDIR}/${PN}-4.2.0-use-cargo-eclass-for-build.patch"
)
QA_FLAGS_IGNORED="usr/bin/.*"
src_unpack() {
if [[ ${PV} == 9999 ]]; then
git-r3_src_unpack
cargo_live_src_unpack
else
cargo_src_unpack
fi
}
src_configure() {
local mycmakeargs=(
-DCMAKE_INSTALL_SYSCONFDIR="${EPREFIX}/etc"
-DINSTALL_DOCS="$(usex doc)"
-DWITH_GETTEXT="$(usex nls 1 0)"
)
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}"
# Bug: https://bugs.gentoo.org/950699
local -x SYSCONFDIR="${EPREFIX}/etc"
# 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
}
src_test() {
local -x CARGO_TERM_COLOR=always
local -x TEST_VERBOSE=1
# cargo_env cmake_src_compile fish_run_tests
cargo_env cmake_src_test fish_run_tests
}
src_install() {
cmake_src_install
keepdir /usr/share/fish/vendor_{completions,conf,functions}.d
readme.gentoo_create_doc
}
pkg_postinst() {
readme.gentoo_print_elog
xdg_pkg_postinst
}