pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

neovim: update to 0.6.0



Module Name:	pkgsrc-wip
Committed By:	Claes Nästén <pekdon%gmail.com@localhost>
Pushed By:	pekdon
Date:		Sun Dec 12 10:07:50 2021 +0100
Changeset:	eedfa2495a9bcc2f7fea4e0d2499ef642da75062

Modified Files:
	neovim/Makefile
	neovim/PLIST
	neovim/distinfo
Added Files:
	neovim/patches/patch-CMakeLists.txt
	neovim/patches/patch-config_CMakeLists.txt
	neovim/patches/patch-config_config.h.in
	neovim/patches/patch-src_nvim_CMakeLists.txt
	neovim/patches/patch-src_nvim_api_private_helpers.c
	neovim/patches/patch-src_nvim_message.c
	neovim/patches/patch-src_nvim_os_os__defs.h
	neovim/patches/patch-src_nvim_os_pty__process__unix.c
	neovim/patches/patch-src_nvim_strings.c
	neovim/patches/patch-src_nvim_vim.h

Log Message:
neovim: update to 0.6.0

Update to neovim-0.6.0 which include a long list of changes.

Add patches for SunOS compatability (all but forkpty has been included
in upstream)

Do not use LuaJIT on SunOS (memory issues) at all, skip alpha and sparc
as well as they are not supported by LuaJIT.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=eedfa2495a9bcc2f7fea4e0d2499ef642da75062

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 neovim/Makefile                                    |  18 ++-
 neovim/PLIST                                       |  35 ++++-
 neovim/distinfo                                    |  15 +-
 neovim/patches/patch-CMakeLists.txt                |  13 ++
 neovim/patches/patch-config_CMakeLists.txt         |  29 ++++
 neovim/patches/patch-config_config.h.in            |  20 +++
 neovim/patches/patch-src_nvim_CMakeLists.txt       |  19 +++
 .../patches/patch-src_nvim_api_private_helpers.c   |  13 ++
 neovim/patches/patch-src_nvim_message.c            |  13 ++
 neovim/patches/patch-src_nvim_os_os__defs.h        |  15 ++
 .../patches/patch-src_nvim_os_pty__process__unix.c | 152 +++++++++++++++++++++
 neovim/patches/patch-src_nvim_strings.c            |  23 ++++
 neovim/patches/patch-src_nvim_vim.h                |  16 +++
 13 files changed, 373 insertions(+), 8 deletions(-)

diffs:
diff --git a/neovim/Makefile b/neovim/Makefile
index 05f02e39fd..62c7504cec 100644
--- a/neovim/Makefile
+++ b/neovim/Makefile
@@ -1,6 +1,6 @@
 # $NetBSD$
 
-DISTNAME=	neovim-0.5.0
+DISTNAME=	neovim-0.6.0
 CATEGORIES=	editors
 MASTER_SITES=	${MASTER_SITE_GITHUB:=neovim/}
 GITHUB_TAG=	v${PKGVERSION_NOREV}
@@ -18,6 +18,8 @@ CONFIGURE_DIRS=		${WRKDIR}/build
 CMAKE_ARGS+=		-DCMAKE_BUILD_TYPE=Release
 CMAKE_ARG_PATH=		${WRKSRC}
 
+LDFLAGS.SunOS+=		-lrt
+
 # should follow the LuaJIT API compatibility
 LUA_VERSION_REQD=	51
 
@@ -39,8 +41,22 @@ post-extract:
 .include "../../converters/libiconv/buildlink3.mk"
 .include "../../devel/jemalloc/buildlink3.mk"
 .include "../../devel/libuv/buildlink3.mk"
+.if ${OPSYS} == "SunOS"
+.include "../../devel/libexecinfo/buildlink3.mk"
+.endif
 .include "../../devel/msgpack/buildlink3.mk"
+# Only use luajit whenever it is supported by the current architecture,
+# fall back on plain lua if not.
+#
+# In addition, LuaJIT does not play well on x86_64 SunOS where memory
+# allocations fails.
+.if ${OPSYS} == "SunOS"
+    || (!empty(MACHINE_ARCH:Malpha) || !empty(MACHINE_ARCH:Msparc) || !empty(MACHINE_ARCH:Msparc64))
+.include "../../lang/lua51/buildlink3.mk"
+CMAKE_ARGS+=		-DPREFER_LUA=ON
+.else
 .include "../../lang/LuaJIT2/buildlink3.mk"
+.endif
 .include "../../lang/lua/application.mk"
 .include "../../wip/lua-luv/buildlink3.mk"
 .include "../../sysutils/desktop-file-utils/desktopdb.mk"
diff --git a/neovim/PLIST b/neovim/PLIST
index 1a72af95e5..03dcbe6958 100644
--- a/neovim/PLIST
+++ b/neovim/PLIST
@@ -49,7 +49,6 @@ share/nvim/runtime/autoload/haskellcomplete.vim
 share/nvim/runtime/autoload/health.vim
 share/nvim/runtime/autoload/health/nvim.vim
 share/nvim/runtime/autoload/health/provider.vim
-share/nvim/runtime/autoload/health/treesitter.vim
 share/nvim/runtime/autoload/htmlcomplete.vim
 share/nvim/runtime/autoload/javascriptcomplete.vim
 share/nvim/runtime/autoload/man.vim
@@ -194,9 +193,11 @@ share/nvim/runtime/compiler/ruby.vim
 share/nvim/runtime/compiler/rubyunit.vim
 share/nvim/runtime/compiler/rustc.vim
 share/nvim/runtime/compiler/sass.vim
+share/nvim/runtime/compiler/scdoc.vim
 share/nvim/runtime/compiler/se.vim
 share/nvim/runtime/compiler/shellcheck.vim
 share/nvim/runtime/compiler/sml.vim
+share/nvim/runtime/compiler/spectral.vim
 share/nvim/runtime/compiler/splint.vim
 share/nvim/runtime/compiler/stack.vim
 share/nvim/runtime/compiler/standard.vim
@@ -211,6 +212,7 @@ share/nvim/runtime/compiler/xbuild.vim
 share/nvim/runtime/compiler/xmllint.vim
 share/nvim/runtime/compiler/xmlwf.vim
 share/nvim/runtime/compiler/xo.vim
+share/nvim/runtime/compiler/yamllint.vim
 share/nvim/runtime/compiler/zsh.vim
 share/nvim/runtime/delmenu.vim
 share/nvim/runtime/doc/api.txt
@@ -221,7 +223,9 @@ share/nvim/runtime/doc/channel.txt
 share/nvim/runtime/doc/cmdline.txt
 share/nvim/runtime/doc/debug.txt
 share/nvim/runtime/doc/deprecated.txt
+share/nvim/runtime/doc/dev_style.txt
 share/nvim/runtime/doc/develop.txt
+share/nvim/runtime/doc/diagnostic.txt
 share/nvim/runtime/doc/diff.txt
 share/nvim/runtime/doc/digraph.txt
 share/nvim/runtime/doc/editing.txt
@@ -276,7 +280,6 @@ share/nvim/runtime/doc/provider.txt
 share/nvim/runtime/doc/quickfix.txt
 share/nvim/runtime/doc/quickref.txt
 share/nvim/runtime/doc/recover.txt
-share/nvim/runtime/doc/remote.txt
 share/nvim/runtime/doc/remote_plugin.txt
 share/nvim/runtime/doc/repeat.txt
 share/nvim/runtime/doc/rileft.txt
@@ -437,7 +440,9 @@ share/nvim/runtime/ftplugin/javascript.vim
 share/nvim/runtime/ftplugin/javascriptreact.vim
 share/nvim/runtime/ftplugin/jproperties.vim
 share/nvim/runtime/ftplugin/json.vim
+share/nvim/runtime/ftplugin/jsonc.vim
 share/nvim/runtime/ftplugin/jsp.vim
+share/nvim/runtime/ftplugin/julia.vim
 share/nvim/runtime/ftplugin/kconfig.vim
 share/nvim/runtime/ftplugin/kwt.vim
 share/nvim/runtime/ftplugin/ld.vim
@@ -480,11 +485,13 @@ share/nvim/runtime/ftplugin/muttrc.vim
 share/nvim/runtime/ftplugin/nanorc.vim
 share/nvim/runtime/ftplugin/neomuttrc.vim
 share/nvim/runtime/ftplugin/netrc.vim
+share/nvim/runtime/ftplugin/nginx.vim
 share/nvim/runtime/ftplugin/nroff.vim
 share/nvim/runtime/ftplugin/nsis.vim
 share/nvim/runtime/ftplugin/objc.vim
 share/nvim/runtime/ftplugin/ocaml.vim
 share/nvim/runtime/ftplugin/occam.vim
+share/nvim/runtime/ftplugin/octave.vim
 share/nvim/runtime/ftplugin/pamconf.vim
 share/nvim/runtime/ftplugin/pascal.vim
 share/nvim/runtime/ftplugin/passwd.vim
@@ -515,6 +522,7 @@ share/nvim/runtime/ftplugin/rhelp.vim
 share/nvim/runtime/ftplugin/rmd.vim
 share/nvim/runtime/ftplugin/rnc.vim
 share/nvim/runtime/ftplugin/rnoweb.vim
+share/nvim/runtime/ftplugin/routeros.vim
 share/nvim/runtime/ftplugin/rpl.vim
 share/nvim/runtime/ftplugin/rrst.vim
 share/nvim/runtime/ftplugin/rst.vim
@@ -523,6 +531,7 @@ share/nvim/runtime/ftplugin/rust.vim
 share/nvim/runtime/ftplugin/sass.vim
 share/nvim/runtime/ftplugin/sbt.vim
 share/nvim/runtime/ftplugin/scala.vim
+share/nvim/runtime/ftplugin/scdoc.vim
 share/nvim/runtime/ftplugin/scheme.vim
 share/nvim/runtime/ftplugin/screen.vim
 share/nvim/runtime/ftplugin/scss.vim
@@ -554,6 +563,7 @@ share/nvim/runtime/ftplugin/tex.vim
 share/nvim/runtime/ftplugin/text.vim
 share/nvim/runtime/ftplugin/tidy.vim
 share/nvim/runtime/ftplugin/tmux.vim
+share/nvim/runtime/ftplugin/toml.vim
 share/nvim/runtime/ftplugin/treetop.vim
 share/nvim/runtime/ftplugin/tt2html.vim
 share/nvim/runtime/ftplugin/tutor.vim
@@ -639,7 +649,9 @@ share/nvim/runtime/indent/java.vim
 share/nvim/runtime/indent/javascript.vim
 share/nvim/runtime/indent/javascriptreact.vim
 share/nvim/runtime/indent/json.vim
+share/nvim/runtime/indent/jsonc.vim
 share/nvim/runtime/indent/jsp.vim
+share/nvim/runtime/indent/julia.vim
 share/nvim/runtime/indent/ld.vim
 share/nvim/runtime/indent/less.vim
 share/nvim/runtime/indent/lifelines.vim
@@ -654,6 +666,7 @@ share/nvim/runtime/indent/meson.vim
 share/nvim/runtime/indent/mf.vim
 share/nvim/runtime/indent/mma.vim
 share/nvim/runtime/indent/mp.vim
+share/nvim/runtime/indent/nginx.vim
 share/nvim/runtime/indent/nsis.vim
 share/nvim/runtime/indent/objc.vim
 share/nvim/runtime/indent/ocaml.vim
@@ -799,20 +812,26 @@ share/nvim/runtime/keymap/ukrainian-jcuken.vim
 share/nvim/runtime/keymap/vietnamese-telex_utf-8.vim
 share/nvim/runtime/keymap/vietnamese-viqr_utf-8.vim
 share/nvim/runtime/keymap/vietnamese-vni_utf-8.vim
+share/nvim/runtime/lua/health.lua
 share/nvim/runtime/lua/man.lua
 share/nvim/runtime/lua/vim/F.lua
 share/nvim/runtime/lua/vim/_meta.lua
 share/nvim/runtime/lua/vim/compat.lua
+share/nvim/runtime/lua/vim/diagnostic.lua
 share/nvim/runtime/lua/vim/highlight.lua
 share/nvim/runtime/lua/vim/inspect.lua
 share/nvim/runtime/lua/vim/lsp.lua
+share/nvim/runtime/lua/vim/lsp/_snippet.lua
 share/nvim/runtime/lua/vim/lsp/buf.lua
 share/nvim/runtime/lua/vim/lsp/codelens.lua
 share/nvim/runtime/lua/vim/lsp/diagnostic.lua
 share/nvim/runtime/lua/vim/lsp/handlers.lua
+share/nvim/runtime/lua/vim/lsp/health.lua
 share/nvim/runtime/lua/vim/lsp/log.lua
 share/nvim/runtime/lua/vim/lsp/protocol.lua
 share/nvim/runtime/lua/vim/lsp/rpc.lua
+share/nvim/runtime/lua/vim/lsp/sync.lua
+share/nvim/runtime/lua/vim/lsp/tagfunc.lua
 share/nvim/runtime/lua/vim/lsp/util.lua
 share/nvim/runtime/lua/vim/shared.lua
 share/nvim/runtime/lua/vim/treesitter.lua
@@ -821,6 +840,7 @@ share/nvim/runtime/lua/vim/treesitter/highlighter.lua
 share/nvim/runtime/lua/vim/treesitter/language.lua
 share/nvim/runtime/lua/vim/treesitter/languagetree.lua
 share/nvim/runtime/lua/vim/treesitter/query.lua
+share/nvim/runtime/lua/vim/ui.lua
 share/nvim/runtime/lua/vim/uri.lua
 share/nvim/runtime/macmap.vim
 share/nvim/runtime/macros/editexisting.vim
@@ -892,7 +912,6 @@ share/nvim/runtime/print/ks_roman.ps
 share/nvim/runtime/print/latin1.ps
 share/nvim/runtime/print/mac-roman.ps
 share/nvim/runtime/print/prolog.ps
-share/nvim/runtime/rgb.txt
 share/nvim/runtime/scripts.vim
 share/nvim/runtime/spell/en.utf-8.spl
 share/nvim/runtime/synmenu.vim
@@ -1088,6 +1107,7 @@ share/nvim/runtime/syntax/fvwm2m4.vim
 share/nvim/runtime/syntax/gdb.vim
 share/nvim/runtime/syntax/gdmo.vim
 share/nvim/runtime/syntax/gedcom.vim
+share/nvim/runtime/syntax/gemtext.vim
 share/nvim/runtime/syntax/gift.vim
 share/nvim/runtime/syntax/git.vim
 share/nvim/runtime/syntax/gitcommit.vim
@@ -1111,6 +1131,7 @@ share/nvim/runtime/syntax/group.vim
 share/nvim/runtime/syntax/grub.vim
 share/nvim/runtime/syntax/gsp.vim
 share/nvim/runtime/syntax/gtkrc.vim
+share/nvim/runtime/syntax/gvpr.vim
 share/nvim/runtime/syntax/haml.vim
 share/nvim/runtime/syntax/hamster.vim
 share/nvim/runtime/syntax/haskell.vim
@@ -1160,7 +1181,9 @@ share/nvim/runtime/syntax/jgraph.vim
 share/nvim/runtime/syntax/jovial.vim
 share/nvim/runtime/syntax/jproperties.vim
 share/nvim/runtime/syntax/json.vim
+share/nvim/runtime/syntax/jsonc.vim
 share/nvim/runtime/syntax/jsp.vim
+share/nvim/runtime/syntax/julia.vim
 share/nvim/runtime/syntax/kconfig.vim
 share/nvim/runtime/syntax/kivy.vim
 share/nvim/runtime/syntax/kix.vim
@@ -1253,6 +1276,7 @@ share/nvim/runtime/syntax/ncf.vim
 share/nvim/runtime/syntax/neomuttrc.vim
 share/nvim/runtime/syntax/netrc.vim
 share/nvim/runtime/syntax/netrw.vim
+share/nvim/runtime/syntax/nginx.vim
 share/nvim/runtime/syntax/ninja.vim
 share/nvim/runtime/syntax/nosyntax.vim
 share/nvim/runtime/syntax/nqc.vim
@@ -1343,6 +1367,7 @@ share/nvim/runtime/syntax/rnc.vim
 share/nvim/runtime/syntax/rng.vim
 share/nvim/runtime/syntax/rnoweb.vim
 share/nvim/runtime/syntax/robots.vim
+share/nvim/runtime/syntax/routeros.vim
 share/nvim/runtime/syntax/rpcgen.vim
 share/nvim/runtime/syntax/rpl.vim
 share/nvim/runtime/syntax/rrst.vim
@@ -1356,6 +1381,7 @@ share/nvim/runtime/syntax/sass.vim
 share/nvim/runtime/syntax/sather.vim
 share/nvim/runtime/syntax/sbt.vim
 share/nvim/runtime/syntax/scala.vim
+share/nvim/runtime/syntax/scdoc.vim
 share/nvim/runtime/syntax/scheme.vim
 share/nvim/runtime/syntax/scilab.vim
 share/nvim/runtime/syntax/screen.vim
@@ -1423,12 +1449,12 @@ share/nvim/runtime/syntax/st.vim
 share/nvim/runtime/syntax/stata.vim
 share/nvim/runtime/syntax/stp.vim
 share/nvim/runtime/syntax/strace.vim
+share/nvim/runtime/syntax/structurizr.vim
 share/nvim/runtime/syntax/sudoers.vim
 share/nvim/runtime/syntax/svg.vim
 share/nvim/runtime/syntax/svn.vim
 share/nvim/runtime/syntax/swift.vim
 share/nvim/runtime/syntax/swiftgyb.vim
-share/nvim/runtime/syntax/syncolor.vim
 share/nvim/runtime/syntax/synload.vim
 share/nvim/runtime/syntax/syntax.vim
 share/nvim/runtime/syntax/sysctl.vim
@@ -1457,6 +1483,7 @@ share/nvim/runtime/syntax/tidy.vim
 share/nvim/runtime/syntax/tilde.vim
 share/nvim/runtime/syntax/tli.vim
 share/nvim/runtime/syntax/tmux.vim
+share/nvim/runtime/syntax/toml.vim
 share/nvim/runtime/syntax/tpp.vim
 share/nvim/runtime/syntax/trasys.vim
 share/nvim/runtime/syntax/treetop.vim
diff --git a/neovim/distinfo b/neovim/distinfo
index 97f9790a75..56a2bc5321 100644
--- a/neovim/distinfo
+++ b/neovim/distinfo
@@ -1,5 +1,14 @@
 $NetBSD$
 
-RMD160 (neovim-0.5.0.tar.gz) = 46bf5b20c3fbc85f56b7791460282f5485e13d8d
-SHA512 (neovim-0.5.0.tar.gz) = f6649f804faabb4104d3b28283932e40358c23990961f4ca7b380089318da312e59242746cee06387f4d881dd6514abbfec79c4063482383adfb4106e9e7a3a4
-Size (neovim-0.5.0.tar.gz) = 10337976 bytes
+BLAKE2s (neovim-0.6.0.tar.gz) = 18476ac9020956db7dc5bffca0fb376efe840ae528bca742db409ae2f7e3e7e2
+SHA512 (neovim-0.6.0.tar.gz) = c007d076fb89288fe0496fa243fc6f485b0b33120c96b0bf37d8fe6469c672eb641fefbc3f7262ec726e40910c44d37ff7efb1723c05ba920ff6ae512b1d43e6
+Size (neovim-0.6.0.tar.gz) = 10592213 bytes
+SHA1 (patch-config_CMakeLists.txt) = 6ebc442788888fc65036d054042b6d6abf9a1e36
+SHA1 (patch-config_config.h.in) = 66f41996991b59e68007bd4882ea9189d6575505
+SHA1 (patch-src_nvim_CMakeLists.txt) = 792b9a4a5921ff1fe7fb02d5dafd9f4a0b0df8f8
+SHA1 (patch-src_nvim_api_private_helpers.c) = adfa7754f3081e80f57721e56890dcdb4accc94a
+SHA1 (patch-src_nvim_message.c) = 1abc51ce6d88a9a634ab5f1a429ce3bd4d2e4e0e
+SHA1 (patch-src_nvim_os_os__defs.h) = 98e11500f4b665d5898f8cd4fbc73ac0b37ab52c
+SHA1 (patch-src_nvim_os_pty__process__unix.c) = 8dd2abcd8a7a9afb2a74fc8711cd9b441aa45aa5
+SHA1 (patch-src_nvim_strings.c) = 3ea22ab27676ceeeafb61863cae11d4111f8f224
+SHA1 (patch-src_nvim_vim.h) = d21ae86f16a6c7b7e80820af5eb658a4e203c5bc
diff --git a/neovim/patches/patch-CMakeLists.txt b/neovim/patches/patch-CMakeLists.txt
new file mode 100644
index 0000000000..d6594d7fb3
--- /dev/null
+++ b/neovim/patches/patch-CMakeLists.txt
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- CMakeLists.txt.orig	2021-12-11 18:44:45.534899106 +0000
++++ CMakeLists.txt
+@@ -413,7 +413,7 @@ endif()
+ option(PREFER_LUA "Prefer Lua over LuaJIT in the nvim executable." OFF)
+ 
+ if(PREFER_LUA)
+-  find_package(Lua 5.1 REQUIRED)
++  find_package(Lua 5.1 EXACT REQUIRED)
+   set(LUA_PREFERRED_INCLUDE_DIRS ${LUA_INCLUDE_DIR})
+   set(LUA_PREFERRED_LIBRARIES ${LUA_LIBRARIES})
+   # Passive (not REQUIRED): if LUAJIT_FOUND is not set, nvim-test is skipped.
diff --git a/neovim/patches/patch-config_CMakeLists.txt b/neovim/patches/patch-config_CMakeLists.txt
new file mode 100644
index 0000000000..7b4cf44f44
--- /dev/null
+++ b/neovim/patches/patch-config_CMakeLists.txt
@@ -0,0 +1,29 @@
+$NetBSD$
+
+--- config/CMakeLists.txt.orig	2021-11-30 17:20:42.000000000 +0000
++++ config/CMakeLists.txt
+@@ -45,10 +45,24 @@ check_function_exists(readlink HAVE_READ
+ check_function_exists(setpgid HAVE_SETPGID)
+ check_function_exists(setsid HAVE_SETSID)
+ check_function_exists(sigaction HAVE_SIGACTION)
++check_function_exists(strnlen HAVE_STRNLEN)
+ check_function_exists(strcasecmp HAVE_STRCASECMP)
+ check_function_exists(strncasecmp HAVE_STRNCASECMP)
+ check_function_exists(strptime HAVE_STRPTIME)
+ 
++if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
++  check_c_source_compiles("
++#include <termios.h>
++int
++main(void)
++{
++  return forkpty(0, NULL, NULL, NULL);
++}
++" HAVE_FORKPTY)
++else()
++  set(HAVE_FORKPTY 1)
++endif()
++
+ # Symbols
+ check_symbol_exists(FD_CLOEXEC "fcntl.h" HAVE_FD_CLOEXEC)
+ if(HAVE_LANGINFO_H)
diff --git a/neovim/patches/patch-config_config.h.in b/neovim/patches/patch-config_config.h.in
new file mode 100644
index 0000000000..6e7e6a573a
--- /dev/null
+++ b/neovim/patches/patch-config_config.h.in
@@ -0,0 +1,20 @@
+$NetBSD$
+
+--- config/config.h.in.orig	2021-11-30 17:20:42.000000000 +0000
++++ config/config.h.in
+@@ -30,6 +30,7 @@
+ #cmakedefine HAVE_SETPGID
+ #cmakedefine HAVE_SETSID
+ #cmakedefine HAVE_SIGACTION
++#cmakedefine HAVE_STRNLEN
+ #cmakedefine HAVE_STRCASECMP
+ #cmakedefine HAVE_STRINGS_H
+ #cmakedefine HAVE_STRNCASECMP
+@@ -49,6 +50,7 @@
+ #  undef HAVE_SYS_UIO_H
+ # endif
+ #endif
++#cmakedefine HAVE_FORKPTY
+ 
+ #cmakedefine FEAT_TUI
+ 
diff --git a/neovim/patches/patch-src_nvim_CMakeLists.txt b/neovim/patches/patch-src_nvim_CMakeLists.txt
new file mode 100644
index 0000000000..5666a34e13
--- /dev/null
+++ b/neovim/patches/patch-src_nvim_CMakeLists.txt
@@ -0,0 +1,19 @@
+$NetBSD$
+
+--- src/nvim/CMakeLists.txt.orig	2021-11-30 17:20:42.000000000 +0000
++++ src/nvim/CMakeLists.txt
+@@ -468,9 +468,11 @@ list(APPEND NVIM_LINK_LIBRARIES
+ 
+ if(UNIX)
+   list(APPEND NVIM_LINK_LIBRARIES
+-    m
+-    util
+-  )
++    m)
++  if (NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS")
++    list(APPEND NVIM_LINK_LIBRARIES
++      util)
++  endif()
+ endif()
+ 
+ set(NVIM_EXEC_LINK_LIBRARIES ${NVIM_LINK_LIBRARIES} ${LUA_PREFERRED_LIBRARIES})
diff --git a/neovim/patches/patch-src_nvim_api_private_helpers.c b/neovim/patches/patch-src_nvim_api_private_helpers.c
new file mode 100644
index 0000000000..b1d66f42fc
--- /dev/null
+++ b/neovim/patches/patch-src_nvim_api_private_helpers.c
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/nvim/api/private/helpers.c.orig	2021-11-30 17:20:42.000000000 +0000
++++ src/nvim/api/private/helpers.c
+@@ -513,7 +513,7 @@ String cbuf_to_string(const char *buf, s
+ String cstrn_to_string(const char *str, size_t maxsize)
+   FUNC_ATTR_NONNULL_ALL
+ {
+-  return cbuf_to_string(str, strnlen(str, maxsize));
++  return cbuf_to_string(str, STRNLEN(str, maxsize));
+ }
+ 
+ /// Creates a String using the given C string. Unlike
diff --git a/neovim/patches/patch-src_nvim_message.c b/neovim/patches/patch-src_nvim_message.c
new file mode 100644
index 0000000000..dafcbdd7d6
--- /dev/null
+++ b/neovim/patches/patch-src_nvim_message.c
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/nvim/message.c.orig	2021-11-30 17:20:42.000000000 +0000
++++ src/nvim/message.c
+@@ -2056,7 +2056,7 @@ static void msg_puts_display(const char_
+       msg_ext_last_attr = attr;
+     }
+     // Concat pieces with the same highlight
+-    size_t len = strnlen((char *)str, maxlen);             // -V781
++    size_t len = STRNLEN(str, maxlen);             // -V781
+     ga_concat_len(&msg_ext_last_chunk, (char *)str, len);
+     msg_ext_cur_len += len;
+     return;
diff --git a/neovim/patches/patch-src_nvim_os_os__defs.h b/neovim/patches/patch-src_nvim_os_os__defs.h
new file mode 100644
index 0000000000..c548532dbc
--- /dev/null
+++ b/neovim/patches/patch-src_nvim_os_os__defs.h
@@ -0,0 +1,15 @@
+$NetBSD$
+
+--- src/nvim/os/os_defs.h.orig	2021-11-30 17:20:42.000000000 +0000
++++ src/nvim/os/os_defs.h
+@@ -13,6 +13,10 @@
+ # include "nvim/os/unix_defs.h"
+ #endif
+ 
++#if !defined(NAME_MAX) && defined(_XOPEN_NAME_MAX)
++#define NAME_MAX _XOPEN_NAME_MAX
++#endif
++
+ #define BASENAMELEN (NAME_MAX - 5)
+ 
+ // Use the system path length if it makes sense.
diff --git a/neovim/patches/patch-src_nvim_os_pty__process__unix.c b/neovim/patches/patch-src_nvim_os_pty__process__unix.c
new file mode 100644
index 0000000000..29355ac3cc
--- /dev/null
+++ b/neovim/patches/patch-src_nvim_os_pty__process__unix.c
@@ -0,0 +1,152 @@
+$NetBSD$
+
+--- src/nvim/os/pty_process_unix.c.orig	2021-11-30 17:20:42.000000000 +0000
++++ src/nvim/os/pty_process_unix.c
+@@ -15,6 +15,12 @@
+ # include <libutil.h>
+ #elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__)
+ # include <util.h>
++#elif defined(__sun)
++#  include <sys/stream.h>
++#  include <sys/syscall.h>
++#  include <fcntl.h>
++#  include <unistd.h>
++#  include <signal.h>
+ #else
+ # include <pty.h>
+ #endif
+@@ -38,6 +44,123 @@
+ # include "os/pty_process_unix.c.generated.h"
+ #endif
+ 
++#if defined(__sun) && !defined(HAVE_FORKPTY)
++
++/* this header defines STR, just as nvim.h, but it is defined as ('S'<<8),
++   to avoid #undef STR, #undef STR, #define STR ('S'<<8) just delay the
++   inclusion of the header even though it gets include out of order. */
++#include <sys/stropts.h>
++
++static int openpty(int *amaster, int *aslave, char *name,
++                   struct termios *termp, struct winsize *winp)
++{
++  int slave = -1;
++  int master = open("/dev/ptmx", O_RDWR);
++  if (master == -1) {
++    goto error;
++  }
++
++  /* grantpt will invoke a setuid program to change permissions
++     and might fail if SIGCHLD handler is set, temporarily reset
++     while running */
++  void(*sig_saved)(int) = signal(SIGCHLD, SIG_DFL);
++  int res = grantpt(master);
++  signal(SIGCHLD, sig_saved);
++
++  if (res == -1 || unlockpt(master) == -1) {
++    goto error;
++  }
++
++  char *slave_name = ptsname(master);
++  if (slave_name == NULL) {
++    goto error;
++  }
++
++  slave = open(slave_name, O_RDWR|O_NOCTTY);
++  if (slave == -1) {
++    goto error;
++  }
++
++  /* ptem emulates a terminal when used on a pseudo terminal driver,
++     must be pushed before ldterm */
++  ioctl(slave, I_PUSH, "ptem");
++  /* ldterm provides most of the termio terminal interface */
++  ioctl(slave, I_PUSH, "ldterm");
++  /* ttcompat compatability with older terminal ioctls */
++  ioctl(slave, I_PUSH, "ttcompat");
++
++  if (termp) {
++    tcsetattr(slave, TCSAFLUSH, termp);
++  }
++  if (winp) {
++    ioctl(slave, TIOCSWINSZ, winp);
++  }
++
++  *amaster = master;
++  *aslave = slave;
++  if (name) {
++    strcpy(name, slave_name);
++  }
++
++  return 0;
++
++error:
++  if (slave != -1) {
++    close(slave);
++  }
++  if (master != -1) {
++    close(master);
++  }
++  return -1;
++}
++
++static int login_tty(int fd)
++{
++  setsid();
++  if (ioctl(fd, TIOCSCTTY, NULL) == -1) {
++    return -1;
++  }
++
++  dup2(fd, STDIN_FILENO);
++  dup2(fd, STDOUT_FILENO);
++  dup2(fd, STDERR_FILENO);
++  if (fd > STDERR_FILENO) {
++    close(fd);
++  }
++
++  return 0;
++}
++
++static pid_t forkpty(int *amaster, char *name,
++                     struct termios *termp, struct winsize *winp)
++{
++  int master, slave;
++  if (openpty(&master, &slave, name, termp, winp) == -1) {
++    return -1;
++  }
++
++  pid_t pid = fork();
++  switch (pid) {
++  case -1:
++    close(master);
++    close(slave);
++    if (name) {
++      name[0] = '\0';
++    }
++    return -1;
++  case 0:
++    close(master);
++    login_tty(slave);
++    return 0;
++  default:
++    close(slave);
++    *amaster = master;
++    return pid;
++  }
++}
++
++#endif
++
+ /// termios saved at startup (for TUI) or initialized by pty_process_spawn().
+ static struct termios termios_default;
+ 
+@@ -198,7 +321,9 @@ static void init_termios(struct termios
+   termios->c_cflag = CS8|CREAD;
+   termios->c_lflag = ISIG|ICANON|IEXTEN|ECHO|ECHOE|ECHOK;
+ 
+-  cfsetspeed(termios, 38400);
++  // not using cfsetspeed, not available on all platforms
++  cfsetispeed(termios, 38400);
++  cfsetospeed(termios, 38400);
+ 
+ #ifdef IUTF8
+   termios->c_iflag |= IUTF8;
diff --git a/neovim/patches/patch-src_nvim_strings.c b/neovim/patches/patch-src_nvim_strings.c
new file mode 100644
index 0000000000..86cd66354d
--- /dev/null
+++ b/neovim/patches/patch-src_nvim_strings.c
@@ -0,0 +1,23 @@
+$NetBSD$
+
+--- src/nvim/strings.c.orig	2021-12-11 11:25:29.501010627 +0000
++++ src/nvim/strings.c
+@@ -394,6 +394,18 @@ void del_trailing_spaces(char_u *ptr)
+   }
+ }
+ 
++#if !defined(HAVE_STRNLEN)
++size_t xstrnlen(const char *s, size_t n)
++  FUNC_ATTR_NONNULL_ALL FUNC_ATTR_PURE
++{
++  const char *end = memchr(s, '\0', n);
++  if (end == NULL) {
++    return n;
++  }
++  return end - s;
++}
++#endif
++
+ #if (!defined(HAVE_STRCASECMP) && !defined(HAVE_STRICMP))
+ /*
+  * Compare two strings, ignoring case, using current locale.
diff --git a/neovim/patches/patch-src_nvim_vim.h b/neovim/patches/patch-src_nvim_vim.h
new file mode 100644
index 0000000000..50fb4657a2
--- /dev/null
+++ b/neovim/patches/patch-src_nvim_vim.h
@@ -0,0 +1,16 @@
+$NetBSD$
+
+--- src/nvim/vim.h.orig	2021-11-30 17:20:42.000000000 +0000
++++ src/nvim/vim.h
+@@ -213,6 +213,11 @@ enum { FOLD_TEXT_LEN = 51, };  //!< buff
+ // (vim_strchr() is now in strings.c)
+ 
+ #define STRLEN(s)           strlen((char *)(s))
++#ifdef HAVE_STRNLEN
++#  define STRNLEN(s, n)     strnlen((char *)(s), (size_t)(n))
++#else
++#  define STRNLEN(s, n)     xstrnlen((char *)(s), (size_t)(n))
++#endif
+ #define STRCPY(d, s)        strcpy((char *)(d), (char *)(s))
+ #define STRNCPY(d, s, n)    strncpy((char *)(d), (char *)(s), (size_t)(n))
+ #define STRLCPY(d, s, n)    xstrlcpy((char *)(d), (char *)(s), (size_t)(n))


Home | Main Index | Thread Index | Old Index