这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/fish/Cargo.toml.patch
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -31,7 +31,7 @@
bitflags = "2.5.0"
errno = "0.3.0"
lazy_static = "1.4.0"
@@ -18,7 +18,7 @@ fish-gettext-extraction = { path = "crates/gettext-extraction" }
fish-gettext-maps = { path = "crates/gettext-maps" }
fish-gettext-mo-file-parser = { path = "crates/gettext-mo-file-parser" }
fish-printf = { path = "crates/printf", features = ["widestring"] }
-libc = "0.2.155"
+libc = "0.2.170"
# lru pulls in hashbrown by default, which uses a faster (though less DoS resistant) hashing algo.
Expand Down
9 changes: 4 additions & 5 deletions packages/fish/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ TERMUX_PKG_HOMEPAGE=https://fishshell.com/
TERMUX_PKG_DESCRIPTION="The user-friendly command line shell"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="4.0.8"
TERMUX_PKG_VERSION="4.1.0"
TERMUX_PKG_SRCURL=https://github.com/fish-shell/fish-shell/releases/download/$TERMUX_PKG_VERSION/fish-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=7f779d13aa55d2fa3afc17364c61ab9edc16faa1eac5851badeffb4e73692240
TERMUX_PKG_SHA256=07a76c67e161b9edc772e6f1d66ebead85d7056e86631d61577f9f9a529c4d9c
TERMUX_PKG_AUTO_UPDATE=true
# fish calls 'tput' from ncurses-utils, at least when cancelling (Ctrl+C) a command line.
# man is needed since fish calls apropos during command completion.
Expand All @@ -25,6 +25,8 @@ termux_step_pre_configure() {
# FindRust.cmake auto pick thumbv7neon-linux-androideabi
[[ "${TERMUX_ARCH}" == "arm" ]] && TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" -DCMAKE_ANDROID_ARM_MODE=ON"

TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" -DRust_CARGO_TARGET=$CARGO_TARGET_NAME"

# older than Android 8 dont have ctermid
"${CC}" ${CPPFLAGS} ${CFLAGS} -c ${TERMUX_PKG_BUILDER_DIR}/ctermid.c
"${AR}" cru libctermid.a ctermid.o
Expand All @@ -41,8 +43,5 @@ termux_step_post_make_install() {
function __fish_command_not_found_handler --on-event fish_command_not_found
$TERMUX_PREFIX/libexec/termux/command-not-found \$argv[1]
end

# TODO: remove when https://github.com/termux/termux-app/pull/4417 gets released
status test-feature keyboard-protocols && set -U fish_features no-keyboard-protocols
EOF
}
59 changes: 0 additions & 59 deletions packages/fish/do-not-import-posix-spawn.patch

This file was deleted.

25 changes: 25 additions & 0 deletions packages/fish/fix-import-when-posix-spawn-disabled.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Fixes this error:

error[E0433]: failed to resolve: use of undeclared type `Pid`
--> src/exec.rs:753:15
|
753 | p.set_pid(Pid::new(pid).unwrap());
| ^^^ use of undeclared type `Pid`
|
help: consider importing this struct
|
6 + use crate::proc::Pid;
|

after: https://github.com/fish-shell/fish-shell/commit/eb4cec1fe25336d07aeed6f67f4bcd0f0cb2f8f0

--- a/src/exec.rs
+++ b/src/exec.rs
@@ -33,7 +33,6 @@ use crate::libc::_PATH_BSHELL;
use crate::nix::{getpid, isatty};
use crate::null_terminated_array::OwningNullTerminatedArray;
use crate::parser::{Block, BlockId, BlockType, EvalRes, Parser};
-#[cfg(FISH_USE_POSIX_SPAWN)]
use crate::proc::Pid;
use crate::proc::{
hup_jobs, is_interactive_session, jobs_requiring_warning_on_exit, no_exec,
84 changes: 0 additions & 84 deletions packages/fish/revert-6644cc9.patch

This file was deleted.

67 changes: 67 additions & 0 deletions packages/fish/revert-70bd49f.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
Reverts https://github.com/fish-shell/fish-shell/commit/70bd49f61265c3a50c98d439fc77e13ef4409231,
because it causes this compilation failure on Android:

error[E0432]: unresolved import `libc::confstr`
--> src/env/environment.rs:31:19
|
31 | use libc::{c_int, confstr, uid_t, STDOUT_FILENO, _IONBF};
| ^^^^^^^ no `confstr` in the root

--- a/src/env/environment.rs
+++ b/src/env/environment.rs
@@ -28,7 +28,7 @@ use crate::wcstringutil::join_strings;
use crate::wutil::{fish_wcstol, wgetcwd, wgettext};
use std::sync::atomic::Ordering;

-use libc::{c_int, confstr, uid_t, STDOUT_FILENO, _IONBF};
+use libc::{c_int, uid_t, STDOUT_FILENO, _IONBF};
use once_cell::sync::{Lazy, OnceCell};
use std::collections::HashMap;
use std::ffi::CStr;
@@ -569,7 +569,7 @@ fn setup_user(vars: &EnvStack) {
}

pub(crate) static FALLBACK_PATH: Lazy<&[WString]> = Lazy::new(|| {
- use crate::libc::_CS_PATH;
+ use crate::libc::{confstr, _CS_PATH};
// _CS_PATH: colon-separated paths to find POSIX utilities
let buf_size = unsafe { confstr(_CS_PATH(), std::ptr::null_mut(), 0) };
Box::leak(
--- a/src/libc.c
+++ b/src/libc.c
@@ -21,6 +21,21 @@ uint64_t C_ST_LOCAL() {
#endif
}

+// confstr + _CS_PATH is only available on macOS with rust's libc
+// we could just declare extern "C" confstr directly in Rust
+// that would panic if it failed to link, which C++ did not
+// therefore we define a backup, which just returns an error
+// which for confstr is 0
+#if defined(_CS_PATH)
+#else
+size_t confstr(int name, char* buf, size_t size) {
+ UNUSED(name);
+ UNUSED(buf);
+ UNUSED(size);
+ return 0;
+}
+#endif
+
int C_CS_PATH() {
#if defined(_CS_PATH)
return _CS_PATH;
--- a/src/libc.rs
+++ b/src/libc.rs
@@ -14,6 +14,11 @@ extern "C" {
}

extern "C" {
+ pub(crate) fn confstr(
+ name: libc::c_int,
+ buf: *mut libc::c_char,
+ len: libc::size_t,
+ ) -> libc::size_t;
pub fn stdout_stream() -> *mut libc::FILE;
pub fn setlinebuf(stream: *mut libc::FILE);
}