sortix-mirror/ports/vim/vim.patch

196 lines
6.6 KiB
Diff

diff --no-dereference -Naur -- vim.normalized/src/auto/configure vim.srctix/src/auto/configure
--- vim.normalized/src/auto/configure 2016-08-14 17:30:13.000000000 +0200
+++ vim.srctix/src/auto/configure 2021-02-12 21:36:33.612465958 +0100
@@ -10140,7 +10140,9 @@
if test "$cross_compiling" = yes; then :
- as_fn_error $? "cross-compiling: please set 'vim_cv_toupper_broken'" "$LINENO" 5
+ # PATCH: Assume the best when cross-compiling.
+ #as_fn_error $? "cross-compiling: please set 'vim_cv_toupper_broken'" "$LINENO" 5
+ vim_cv_toupper_broken=no
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -11362,7 +11364,7 @@
if test "x$olibs" != "x$LIBS"; then
if test "$cross_compiling" = yes; then :
- res="FAIL"
+ res="OK"
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11405,6 +11407,10 @@
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#ifdef HAVE_TERMCAP_H
+# include <termcap.h>
+#endif
+
int
main ()
{
@@ -11433,7 +11439,8 @@
if test "$cross_compiling" = yes; then :
- as_fn_error $? "cross-compiling: please set 'vim_cv_terminfo'" "$LINENO" 5
+ #as_fn_error $? "cross-compiling: please set 'vim_cv_terminfo'" "$LINENO" 5
+ vim_cv_terminfo=yes
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -11486,7 +11493,8 @@
if test "$cross_compiling" = yes; then :
- as_fn_error $? "failed to compile test program." "$LINENO" 5
+ #as_fn_error $? "failed to compile test program." "$LINENO" 5
+ vim_cv_tgent=zero
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -11715,6 +11723,8 @@
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#include <stdlib.h>
+
int
main ()
{
@@ -11957,7 +11967,8 @@
if test "$cross_compiling" = yes; then :
- as_fn_error $? "cross-compiling: please set 'vim_cv_getcwd_broken'" "$LINENO" 5
+ #as_fn_error $? "cross-compiling: please set 'vim_cv_getcwd_broken'" "$LINENO" 5
+ vim_cv_getcwd_broken=no
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -12324,7 +12335,8 @@
if test "$cross_compiling" = yes; then :
- as_fn_error $? "cross-compiling: please set 'vim_cv_stat_ignores_slash'" "$LINENO" 5
+ #as_fn_error $? "cross-compiling: please set 'vim_cv_stat_ignores_slash'" "$LINENO" 5
+ vim_cv_stat_ignores_slash=no
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -13325,8 +13337,8 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking uint32_t is 32 bits" >&5
$as_echo_n "checking uint32_t is 32 bits... " >&6; }
if test "$cross_compiling" = yes; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check uint32_t when cross-compiling." >&5
-$as_echo "$as_me: WARNING: cannot check uint32_t when cross-compiling." >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: obviously" >&5
+$as_echo "obviously" >&6; }
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -13337,6 +13349,7 @@
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif
+#include <stdlib.h>
main() {
uint32_t nr1 = (uint32_t)-1;
uint32_t nr2 = (uint32_t)0xffffffffUL;
@@ -13386,7 +13399,8 @@
if test "$cross_compiling" = yes; then :
- as_fn_error $? "cross-compiling: please set 'vim_cv_memmove_handles_overlap'" "$LINENO" 5
+ #as_fn_error $? "cross-compiling: please set 'vim_cv_memmove_handles_overlap'" "$LINENO" 5
+ vim_cv_memmove_handles_overlap=yes
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
diff --no-dereference -Naur -- vim.normalized/src/Makefile vim.srctix/src/Makefile
--- vim.normalized/src/Makefile 2016-09-12 18:13:22.000000000 +0200
+++ vim.srctix/src/Makefile 2016-09-26 03:11:55.823863170 +0200
@@ -2202,6 +2202,8 @@
# install targets
install: $(GUI_INSTALL)
+ ln -s ../../etc/vimrc $(DEST_VIM)/vimrc
+ ln -s ../../etc/gvimrc $(DEST_VIM)/gvimrc
install_normal: installvim installtools $(INSTALL_LANGS) install-icons
diff --no-dereference -Naur -- vim.normalized/src/memfile.c vim.srctix/src/memfile.c
--- vim.normalized/src/memfile.c 2016-08-29 22:42:20.000000000 +0200
+++ vim.srctix/src/memfile.c 2016-09-22 18:30:18.061088200 +0200
@@ -613,7 +613,7 @@
/* OpenNT is strictly POSIX (Benzinger) */
/* Tandem/Himalaya NSK-OSS doesn't have sync() */
/* No sync() on Stratus VOS */
-# if defined(__OPENNT) || defined(__TANDEM) || defined(__VOS__)
+# if defined(__OPENNT) || defined(__TANDEM) || defined(__VOS__) || defined(__sortix__)
fflush(NULL);
# else
sync();
diff --no-dereference -Naur -- vim.normalized/src/regexp.c vim.srctix/src/regexp.c
--- vim.normalized/src/regexp.c 2016-09-09 20:20:20.000000000 +0200
+++ vim.srctix/src/regexp.c 2016-09-22 18:28:48.595273447 +0200
@@ -189,6 +189,7 @@
#define KWORD 25 /* Match keyword char */
#define SKWORD 26 /* Match word char but no digit */
#define FNAME 27 /* Match file name char */
+#undef SFNAME /* <sortix/fork.h> namespace issue */
#define SFNAME 28 /* Match file name char but no digit */
#define PRINT 29 /* Match printable char */
#define SPRINT 30 /* Match printable char but no digit */
diff --no-dereference -Naur -- vim.normalized/src/sha256.c vim.srctix/src/sha256.c
--- vim.normalized/src/sha256.c 2016-08-29 22:42:20.000000000 +0200
+++ vim.srctix/src/sha256.c 2016-09-22 18:28:55.871095733 +0200
@@ -380,20 +380,6 @@
return failures > 0 ? FAIL : OK;
}
- static unsigned int
-get_some_time(void)
-{
-# ifdef HAVE_GETTIMEOFDAY
- struct timeval tv;
-
- /* Using usec makes it less predictable. */
- gettimeofday(&tv, NULL);
- return (unsigned int)(tv.tv_sec + tv.tv_usec);
-# else
- return (unsigned int)time(NULL);
-# endif
-}
-
/*
* Fill "header[header_len]" with random_data.
* Also "salt[salt_len]" when "salt" is not NULL.
@@ -410,10 +396,7 @@
char_u sha256sum[32];
context_sha256_T ctx;
- srand(get_some_time());
-
- for (i = 0; i < (int)sizeof(random_data) - 1; i++)
- random_data[i] = (char_u)((get_some_time() ^ rand()) & 0xff);
+ arc4random_buf(random_data, sizeof(random_data));
sha256_start(&ctx);
sha256_update(&ctx, (char_u *)random_data, sizeof(random_data));
sha256_finish(&ctx, sha256sum);
diff --no-dereference -Naur -- vim.normalized/tixbuildinfo vim.srctix/tixbuildinfo
--- vim.normalized/tixbuildinfo 1970-01-01 01:00:00.000000000 +0100
+++ vim.srctix/tixbuildinfo 2016-09-26 02:50:57.889623645 +0200
@@ -0,0 +1,8 @@
+tix.version=1
+tix.class=srctix
+pkg.name=vim
+pkg.build-libraries=libcurses
+pkg.build-system=configure
+pkg.configure.args=--enable-multibyte --with-modified-by=sortie@maxsi.org
+# TODO: Consider vim_cv_tty_group and vim_cv_tty_mode.
+pkg.configure.vars=vim_cv_tty_group=world vim_cv_tty_mode=0620