From 0cabdf1fc8bf8c0a6b946a3be35c9b709081c726 Mon Sep 17 00:00:00 2001 From: Jakub Skrzypnik Date: Wed, 28 Feb 2018 18:59:33 +0100 Subject: [PATCH] mc: switch ncurses to slang, add mksh support patch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes: #11999 [via git-merge-pr] Signed-off-by: Jürgen Buchmüller --- srcpkgs/mc/patches/mc-mksh-subshell-v2.patch | 73 ++++++++++++++++++++ srcpkgs/mc/template | 6 +- 2 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 srcpkgs/mc/patches/mc-mksh-subshell-v2.patch diff --git a/srcpkgs/mc/patches/mc-mksh-subshell-v2.patch b/srcpkgs/mc/patches/mc-mksh-subshell-v2.patch new file mode 100644 index 00000000000..8ddea90fbcf --- /dev/null +++ b/srcpkgs/mc/patches/mc-mksh-subshell-v2.patch @@ -0,0 +1,73 @@ +--- lib/shell.c 2016-09-22 18:24:12.000000000 +0000 ++++ lib/shell.c 2017-02-16 13:47:34.933939000 +0000 +@@ -66,6 +66,10 @@ + /* 3rd choice: look for existing shells supported as MC subshells. */ + if (access ("/bin/bash", X_OK) == 0) + mc_shell->path = g_strdup ("/bin/bash"); ++ else if (access ("/usr/local/bin/mksh", X_OK) == 0) ++ mc_shell->path = g_strdup ("/usr/local/bin/mksh"); ++ else if (access ("/bin/mksh", X_OK) == 0) ++ mc_shell->path = g_strdup ("/bin/mksh"); + else if (access ("/bin/ash", X_OK) == 0) + mc_shell->path = g_strdup ("/bin/ash"); + else if (access ("/bin/dash", X_OK) == 0) +@@ -149,6 +153,12 @@ + mc_shell->type = SHELL_ZSH; + mc_shell->name = "zsh"; + } ++ else if (strstr (mc_shell->path, "/mksh") != NULL ++ || strstr (mc_shell->real_path, "/mksh") != NULL) ++ { ++ mc_shell->type = SHELL_MKSH; ++ mc_shell->name = "mksh"; ++ } + else if (strstr (mc_shell->path, "/tcsh") != NULL + || strstr (mc_shell->real_path, "/tcsh") != NULL) + { +diff -Naur mc-4.8.18.orig/lib/shell.h mc-4.8.18/lib/shell.h +--- lib/shell.h 2016-03-12 15:45:47.000000000 +0000 ++++ lib/shell.h 2017-02-15 21:57:39.000000000 +0000 +@@ -12,6 +12,7 @@ + typedef enum + { + SHELL_NONE, ++ SHELL_MKSH, + SHELL_SH, + SHELL_BASH, + SHELL_ASH_BUSYBOX, /* BusyBox default shell (ash) */ +diff -Naur mc-4.8.18.orig/src/subshell/common.c mc-4.8.18/src/subshell/common.c +--- src/subshell/common.c 2016-09-22 18:24:12.000000000 +0000 ++++ src/subshell/common.c 2017-02-20 18:48:22.681514000 +0000 +@@ -320,6 +320,12 @@ + + break; + ++ case SHELL_MKSH: ++ init_file = g_strdup (".shrc"); ++ putenv_str = g_strconcat ("ENV=", init_file, (char *) NULL); ++ putenv (putenv_str); ++ break; ++ + /* TODO: Find a way to pass initfile to TCSH, ZSH and FISH */ + case SHELL_TCSH: + case SHELL_ZSH: +@@ -367,6 +373,7 @@ + + case SHELL_ASH_BUSYBOX: + case SHELL_DASH: ++ case SHELL_MKSH: + case SHELL_TCSH: + case SHELL_FISH: + execl (mc_global.shell->path, mc_global.shell->path, (char *) NULL); +@@ -801,6 +808,11 @@ + "PS1='\\u@\\h:\\w\\$ '\n", subshell_pipe[WRITE]); + break; + ++ case SHELL_MKSH: ++ g_snprintf (precmd, buff_size, ++ "PS1='$(pwd>&%d; kill -STOP $$)'\"$((( USER_ID )) && print '$ ' || print '# ')\"\n", subshell_pipe[WRITE]); ++ break; ++ + case SHELL_ASH_BUSYBOX: + /* BusyBox ash needs a somewhat complicated precmd emulation via PS1, and it is vital + * that BB be built with active CONFIG_ASH_EXPAND_PRMT, but this is the default anyway. diff --git a/srcpkgs/mc/template b/srcpkgs/mc/template index af5f750a6b4..c00484c73bd 100644 --- a/srcpkgs/mc/template +++ b/srcpkgs/mc/template @@ -1,11 +1,11 @@ # Template file for 'mc' pkgname=mc version=4.8.20 -revision=1 +revision=2 build_style=gnu-configure -configure_args="--with-screen=ncurses --without-x" +configure_args="--with-screen=slang --without-x" hostmakedepends="pkg-config perl" -makedepends="libglib-devel e2fsprogs-devel ncurses-devel libssh2-devel gpm-devel" +makedepends="libglib-devel e2fsprogs-devel slang-devel libssh2-devel gpm-devel" conf_files=" /etc/mc/filehighlight.ini /etc/mc/mc.default.keymap