Sunday, September 29, 2019

Neovim update and new libluv port

Hi there,

I wanted Neovim 0.4.2 so I took the liberty of figuring out what it would take
to update the port.

I've included:

* A new port of libluv:
- Neovim now depends on libluv
- (See https://github.com/neovim/neovim/wiki/Following-HEAD) so I had to
create a new port which I've attached.

* A patch to update unibilium to 2.0.0
- Unibilium has been forked and moved under the neovim github org so
I'm pointing at that.

* A patch to update libvterm to the latest git sha on the nvim branch.
- It seems that no other ports depend on libvterm, so it made sense to use
the nvim branch.
- I updated the patch to bin/vterm-ctrl.c. Upstream hasn't integrated the
previous patch and the code has drifted quite a lot.

* A patch to update neovim to v0.4.2
- Removed patch-src_nvim_os_process_c - I believe it was fixed upstream
here:
https://github.com/neovim/neovim/commit/6e01ed6a4c859ff915b42422622f1ba3cc80efd5
- make test completes with no failures

I've tested this on amd64 -CURRENT from yesterday and ran through the porting
and update checklists.

Happy to hear any feedback.

thanks!

Patches ahead.

unibilium.diff:

diff --git Makefile Makefile
index ddf0f1846db..1b0109fdb67 100644
--- Makefile
+++ Makefile
@@ -1,14 +1,14 @@
# $OpenBSD: Makefile,v 1.2 2019/07/12 20:46:03 sthen Exp $

COMMENT = very basic terminfo library
-VERSION = 1.2.0
+VERSION = 2.0.0
DISTNAME = unibilium-${VERSION}

-GH_ACCOUNT = mauke
+GH_ACCOUNT = neovim
GH_PROJECT = unibilium
GH_TAGNAME = v${VERSION}

-SHARED_LIBS += unibilium 0.0 # 3.0
+SHARED_LIBS += unibilium 1.0 # 3.0

CATEGORIES = devel

diff --git distinfo distinfo
index 61047b4ed65..b531af481ad 100644
--- distinfo
+++ distinfo
@@ -1,2 +1,2 @@
-SHA256 (unibilium-1.2.0.tar.gz) = YjrxCZUV5nOr/TyuXy+oCKCcpV3aHGWntclCTrME6tg=
-SIZE (unibilium-1.2.0.tar.gz) = 88488
+SHA256 (unibilium-2.0.0.tar.gz) = eJl9ONTIF3xg09DBqoxT/QgG6yGCW3szWxdo1xFrwcE=
+SIZE (unibilium-2.0.0.tar.gz) = 112570


libvterm.diff

diff --git Makefile Makefile
index 006367688e9..e79baa11807 100644
--- Makefile
+++ Makefile
@@ -1,16 +1,17 @@
-# $OpenBSD:
+# $OpenBSD: $

COMMENT = VT220/xterm/ECMA-48 terminal emulator library
# No releases, so use date and a git hash.
# Note that the github repo is a mirror of a bzr repo.
-VERSION = 20170211
+VERSION = 20190910
DISTNAME = libvterm-${VERSION}

GH_ACCOUNT = neovim
GH_PROJECT = libvterm
-GH_COMMIT = 224b8dcde1c9640c29a34aa60c0f0d56ad298449
+# commit sha from the nvim branch
+GH_COMMIT = 4a5fa43e0dbc0db4fe67d40d788d60852864df9e

-SHARED_LIBS += vterm 0.0 # 0.0
+SHARED_LIBS += vterm 0.1 # 0.0

CATEGORIES = devel

diff --git distinfo distinfo
index 63c4d8e0322..9d064239eef 100644
--- distinfo
+++ distinfo
@@ -1,2 +1,2 @@
-SHA256 (libvterm-20170211-224b8dcd.tar.gz) = W8Dol01zXaTVrjOGrEEiylL+gPHFMveyO3nGPsXYzs0=
-SIZE (libvterm-20170211-224b8dcd.tar.gz) = 67291
+SHA256 (libvterm-20190910-4a5fa43e.tar.gz) = SbPPLcuYi4h2cbEBHP6smP+Bu1wj+0rDS5GllSSZKTU=
+SIZE (libvterm-20190910-4a5fa43e.tar.gz) = 72448
diff --git patches/patch-bin_vterm-ctrl_c patches/patch-bin_vterm-ctrl_c
index 529b571b9ff..aa951f474a8 100644
--- patches/patch-bin_vterm-ctrl_c
+++ patches/patch-bin_vterm-ctrl_c
@@ -1,16 +1,42 @@
-$OpenBSD: patch-bin_vterm-ctrl_c,v 1.1.1.1 2017/02/28 22:40:11 edd Exp $
+$OpenBSD: $

Fix signed versus unsigned comparison.
https://bugs.launchpad.net/libvterm/+bug/1668780

---- bin/vterm-ctrl.c.orig Sun Dec 18 21:03:40 2016
-+++ bin/vterm-ctrl.c Sat Feb 25 16:29:14 2017
-@@ -81,7 +81,7 @@ static char *read_csi()
+Patch updated to apply on:
+https://github.com/neovim/libvterm/tree/nvim
+
+diff --git bin/vterm-ctrl.c bin/vterm-ctrl.c
+index ba0d61e..92a365f 100644
+--- bin/vterm-ctrl.c
++++ bin/vterm-ctrl.c
+@@ -79,9 +79,9 @@ static bool seticanon(bool icanon, bool echo)
+ return ret;
+ }
+
+-static void await_c1(unsigned char c1)
++static void await_c1(int c1)
{
- /* TODO: This really should be a more robust CSI parser
- */
-- char c;
+- unsigned char c;
+ int c;

/* await CSI - 8bit or 2byte 7bit form */
bool in_esc = false;
+@@ -106,7 +106,7 @@ static char *read_csi()
+ char csi[32];
+ int i = 0;
+ for(; i < sizeof(csi)-1; i++) {
+- char c = csi[i] = getchar();
++ int c = csi[i] = getchar();
+ if(c >= 0x40 && c <= 0x7e)
+ break;
+ }
+@@ -125,7 +125,7 @@ static char *read_dcs()
+ bool in_esc = false;
+ int i = 0;
+ for(; i < sizeof(dcs)-1; ) {
+- char c = getchar();
++ int c = getchar();
+ if(c == 0x9c) // ST
+ break;
+ if(in_esc && c == 0x5c)


neovim.diff:

diff --git Makefile Makefile
index e9b174a4512..3680334ad7c 100644
--- Makefile
+++ Makefile
@@ -4,7 +4,7 @@ COMMENT = continuation and extension of Vim

GH_ACCOUNT = neovim
GH_PROJECT = neovim
-GH_TAGNAME = v0.3.8
+GH_TAGNAME = v0.4.2

CATEGORIES = editors devel
HOMEPAGE = https://neovim.io
@@ -13,8 +13,8 @@ MAINTAINER = Edd Barrett <edd@openbsd.org>
# Apache 2.0 + Vim License
PERMIT_PACKAGE = Yes

-WANTLIB += c iconv intl ${MODLUA_WANTLIB} m msgpackc pthread termkey
-WANTLIB += unibilium util uv vterm
+WANTLIB += c iconv intl luv ${MODLUA_WANTLIB} m msgpackc pthread termkey
+WANTLIB += unibilium=1.0 util uv vterm=0.1

COMPILER = base-clang ports-gcc base-gcc

@@ -24,12 +24,14 @@ MODULES = devel/cmake \

BUILD_DEPENDS = ${RUN_DEPENDS} \
devel/gperf \
+ devel/libluv \
devel/lpeg \
devel/lua-bitop

LIB_DEPENDS = devel/gettext,-runtime \
devel/libtermkey \
devel/libuv \
+ devel/libluv \
devel/libvterm \
devel/msgpack \
devel/unibilium
@@ -38,7 +40,7 @@ RUN_DEPENDS += devel/libmpack/lua \
devel/libmpack/main \
devel/desktop-file-utils

-MAKE_FLAGS += USE_BUNDLED_DEPS=OFF
+MAKE_FLAGS += USE_BUNDLED=OFF
CONFIGURE_ARGS += -DLUA_PRG=${MODLUA_BIN} \
-DLUA_INCLUDE_DIR=${MODLUA_INCL_DIR} \
-DLUA_LIBRARIES=${MODLUA_LIB} \
diff --git distinfo distinfo
index 890fd75dd30..d0dd0a398f8 100644
--- distinfo
+++ distinfo
@@ -1,2 +1,2 @@
-SHA256 (neovim-0.3.8.tar.gz) = lT4TRWjYJNrXy/Mu4xFJUXMvmnUMRi5DDmtZP0GK92w=
-SIZE (neovim-0.3.8.tar.gz) = 9233661
+SHA256 (neovim-0.4.2.tar.gz) = n4dNPSp08zuTHbYq3r4o+NLsEWJw0eE5mLWKczSLblY=
+SIZE (neovim-0.4.2.tar.gz) = 9552134
diff --git patches/patch-src_nvim_os_process_c patches/patch-src_nvim_os_process_c
deleted file mode 100644
index a2e2b6f0e08..00000000000
--- patches/patch-src_nvim_os_process_c
+++ /dev/null
@@ -1,40 +0,0 @@
-$OpenBSD: patch-src_nvim_os_process_c,v 1.1 2019/03/17 13:13:40 edd Exp $
-
-Port job stopping bug fix to neovim:
-
-Original vim fix:
-https://github.com/vim/vim/commit/76ab4fd61901090e6af3451ca6c5ca0fc370571f#diff-b68adb4fa34020d8d7f0ab40a2704335
-
-Index: src/nvim/os/process.c
---- src/nvim/os/process.c.orig
-+++ src/nvim/os/process.c
-@@ -89,21 +89,16 @@ bool os_proc_tree_kill(int pid, int sig)
- bool os_proc_tree_kill(int pid, int sig)
- {
- assert(sig == SIGTERM || sig == SIGKILL);
-- int pgid = getpgid(pid);
-- if (pgid > 0) { // Ignore error. Never kill self (pid=0).
-- if (pgid == pid) {
-- ILOG("sending %s to process group: -%d",
-- sig == SIGTERM ? "SIGTERM" : "SIGKILL", pgid);
-- int rv = uv_kill(-pgid, sig);
-- return rv == 0;
-- } else {
-- // Should never happen, because process_spawn() did setsid() in the child.
-- ELOG("pgid %d != pid %d", pgid, pid);
-- }
-+ if (pid != 0) { // Never kill self (pid=0).
-+ ILOG("sending %s to PIDs %d and %d",
-+ sig == SIGTERM ? "SIGTERM" : "SIGKILL", -pid, pid);
-+
-+ int rv1 = uv_kill(-pid, sig);
-+ int rv2 = uv_kill(pid, sig);
-+ return (rv1 == 0) && (rv2 == 0);
- } else {
-- ELOG("getpgid(%d) returned %d", pid, pgid);
-+ return false;
- }
-- return false;
- }
-

No comments:

Post a Comment