2021-10-08 22:10:27 +00:00
|
|
|
# Use LuaJIT where possible, as some plugins assume it's available. Arches
|
|
|
|
# that can't use LuaJIT have to use the system Lua (and some plugins may not
|
|
|
|
# work).
|
|
|
|
.if ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "aarch64" || \
|
|
|
|
${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \
|
|
|
|
${MACHINE_ARCH} == "powerpc"
|
|
|
|
EMBED_LUAJIT = Yes
|
|
|
|
.else
|
|
|
|
EMBED_LUAJIT = No
|
|
|
|
.endif
|
2017-05-02 20:58:42 +00:00
|
|
|
|
2017-10-15 10:53:55 +00:00
|
|
|
COMMENT = continuation and extension of Vim
|
2017-05-02 20:58:42 +00:00
|
|
|
|
|
|
|
GH_ACCOUNT = neovim
|
|
|
|
GH_PROJECT = neovim
|
2022-02-09 09:24:13 +00:00
|
|
|
GH_TAGNAME = v0.6.1
|
2017-05-02 20:58:42 +00:00
|
|
|
|
|
|
|
CATEGORIES = editors devel
|
2019-07-09 09:46:16 +00:00
|
|
|
HOMEPAGE = https://neovim.io
|
2017-05-02 20:58:42 +00:00
|
|
|
MAINTAINER = Edd Barrett <edd@openbsd.org>
|
|
|
|
|
2021-10-08 22:10:27 +00:00
|
|
|
# The versions listed here must match those in third-party/CMakeLists.txt.
|
2021-12-25 10:44:22 +00:00
|
|
|
LUV_VER = 1.42.0-1
|
|
|
|
LUAJIT_VER = b4b2dce9fc3ffaaaede39b36d06415311e2aa516
|
2021-10-08 22:10:27 +00:00
|
|
|
|
2019-11-20 13:43:35 +00:00
|
|
|
MASTER_SITES0 = https://github.com/luvit/luv/releases/download/${LUV_VER}/
|
2021-10-08 22:10:27 +00:00
|
|
|
MASTER_SITES1 = https://github.com/LuaJIT/LuaJIT/archive/
|
2019-11-20 13:43:35 +00:00
|
|
|
DISTFILES = ${DISTNAME}${EXTRACT_SUFX} \
|
2021-10-08 22:10:27 +00:00
|
|
|
luv-${LUV_VER}${EXTRACT_SUFX}:0 \
|
|
|
|
luajit-{}${LUAJIT_VER}${EXTRACT_SUFX}:1
|
2019-11-20 13:43:35 +00:00
|
|
|
|
2021-10-08 22:10:27 +00:00
|
|
|
# Neovim: Apache 2.0 + Vim License
|
|
|
|
# LuaJIT: MIT + public domain
|
|
|
|
# libluv: Apache 2.0
|
2019-07-09 09:46:16 +00:00
|
|
|
PERMIT_PACKAGE = Yes
|
2017-05-02 20:58:42 +00:00
|
|
|
|
2019-11-20 13:43:35 +00:00
|
|
|
DEBUG_PACKAGES = ${BUILD_PACKAGES}
|
|
|
|
|
2021-12-25 10:44:22 +00:00
|
|
|
WANTLIB += c iconv intl m msgpackc pthread termkey
|
2021-07-18 09:18:07 +00:00
|
|
|
WANTLIB += tree-sitter unibilium util uv vterm
|
2017-05-02 20:58:42 +00:00
|
|
|
|
2021-10-08 22:10:27 +00:00
|
|
|
.if ${EMBED_LUAJIT} != "Yes"
|
|
|
|
WANTLIB += ${MODLUA_WANTLIB}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
COMPILER = base-clang ports-gcc
|
2018-10-24 14:27:57 +00:00
|
|
|
|
2017-05-02 20:58:42 +00:00
|
|
|
MODULES = devel/cmake \
|
|
|
|
lang/lua \
|
|
|
|
textproc/intltool
|
2017-12-02 12:28:05 +00:00
|
|
|
|
2021-10-08 22:10:27 +00:00
|
|
|
# LuaJIT is binary compatible with Lua-5.1 extension modules, so we can use
|
|
|
|
# them directly, even on architectures where we will be embedding LuaJIT.
|
|
|
|
# https://luajit.org/extensions.html
|
|
|
|
MODLUA_VERSION = 5.1
|
|
|
|
|
2017-05-02 20:58:42 +00:00
|
|
|
BUILD_DEPENDS = ${RUN_DEPENDS} \
|
|
|
|
devel/gperf \
|
|
|
|
devel/lpeg \
|
2017-11-14 14:55:16 +00:00
|
|
|
devel/lua-bitop
|
2017-05-02 20:58:42 +00:00
|
|
|
|
2019-05-20 22:15:00 +00:00
|
|
|
LIB_DEPENDS = devel/gettext,-runtime \
|
2017-11-21 00:12:59 +00:00
|
|
|
devel/libtermkey \
|
2017-05-02 20:58:42 +00:00
|
|
|
devel/libuv \
|
|
|
|
devel/libvterm \
|
|
|
|
devel/msgpack \
|
2021-07-18 09:18:07 +00:00
|
|
|
devel/unibilium \
|
|
|
|
textproc/tree-sitter
|
2017-12-02 12:28:05 +00:00
|
|
|
|
2017-05-02 20:58:42 +00:00
|
|
|
RUN_DEPENDS += devel/libmpack/lua \
|
2017-12-02 12:28:05 +00:00
|
|
|
devel/libmpack/main \
|
2021-10-08 22:10:27 +00:00
|
|
|
devel/desktop-file-utils \
|
|
|
|
devel/lua-compat53 \
|
|
|
|
x11/gtk+3,-guic
|
|
|
|
|
|
|
|
SEPARATE_BUILD = Yes
|
|
|
|
CONFIGURE_ARGS += -DUSE_BUNDLED=OFF \
|
|
|
|
-DLIBLUV_INCLUDE_DIR=${STATIC_DEPS_INST}/include \
|
2021-12-25 10:44:22 +00:00
|
|
|
-DLIBLUV_LIBRARY=${STATIC_DEPS_INST}/lib/libluv_a.a
|
2021-10-08 22:10:27 +00:00
|
|
|
.if ${EMBED_LUAJIT} == "Yes"
|
|
|
|
CONFIGURE_ARGS += -DLUA_PRG=${STATIC_DEPS_INST}/bin/luajit-2.1.0-beta3 \
|
|
|
|
-DLUAJIT_INCLUDE_DIR=${STATIC_DEPS_INST}/include/luajit-2.1 \
|
|
|
|
-DLUAJIT_LIBRARY=${STATIC_DEPS_INST}/lib/libluajit-5.1.a
|
|
|
|
.else
|
|
|
|
CONFIGURE_ARGS += -DPREFER_LUA=ON \
|
|
|
|
-DLUA_PRG=${MODLUA_BIN} \
|
2017-12-02 12:28:05 +00:00
|
|
|
-DLUA_INCLUDE_DIR=${MODLUA_INCL_DIR} \
|
2021-10-08 22:10:27 +00:00
|
|
|
-DLUA_LIBRARIES=${MODLUA_LIB}
|
|
|
|
.endif
|
2017-05-02 20:58:42 +00:00
|
|
|
|
|
|
|
# Tests need gmake
|
|
|
|
USE_GMAKE = Yes
|
2017-12-02 12:28:05 +00:00
|
|
|
# `test_startup_utf8.vim' requires either bash or zsh
|
2020-04-25 10:07:41 +00:00
|
|
|
MODULES += lang/python
|
|
|
|
MODPY_RUNDEP = No
|
2021-10-08 22:10:27 +00:00
|
|
|
MODPY_BUILDDEP =No
|
2018-07-01 14:16:29 +00:00
|
|
|
TEST_DEPENDS = shells/bash \
|
|
|
|
editors/py-neovim \
|
2020-04-25 10:07:41 +00:00
|
|
|
editors/py-neovim${MODPY_FLAVOR}
|
2017-05-02 20:58:42 +00:00
|
|
|
|
2021-10-08 22:10:27 +00:00
|
|
|
# Move static deps source code under WRKDIST so that they can be patched.
|
|
|
|
STATIC_DEPS_WRKSRC=${WRKDIST}/static-deps/
|
|
|
|
post-extract:
|
|
|
|
mkdir ${STATIC_DEPS_WRKSRC}
|
|
|
|
mv ${WRKDIR}/LuaJIT-${LUAJIT_VER} ${STATIC_DEPS_WRKSRC}/luajit
|
|
|
|
mv ${WRKDIR}/luv-${LUV_VER} ${STATIC_DEPS_WRKSRC}/luv
|
|
|
|
|
|
|
|
# Build LuaJIT (if required) and libluv as static libraries.
|
|
|
|
#
|
|
|
|
# We opted not to create a libluv port because it must be built for a specific
|
|
|
|
# Lua version and we don't know what version future ports might need. Currently
|
|
|
|
# no other port requires libluv, so it's simpler to build a static library
|
|
|
|
# here.
|
2019-11-20 13:43:35 +00:00
|
|
|
#
|
2021-10-08 22:10:27 +00:00
|
|
|
# Most of the libluv target is lifted from ${MODCMAKE_configure} in
|
|
|
|
# cmake.port.mk. Unfortunately we can't use it directly, as some of the
|
|
|
|
# arguments make assumptions that can't work for us here.
|
|
|
|
#
|
|
|
|
# Neovim plugins expect a very specific version of LuaJIT, so it only really
|
|
|
|
# makes sense to embed it.
|
|
|
|
STATIC_DEPS_WRKBUILD=${WRKBUILD}/static-deps-build
|
|
|
|
STATIC_DEPS_INST=${WRKBUILD}/static-deps-inst
|
|
|
|
.include <bsd.port.arch.mk>
|
|
|
|
.if ${PROPERTIES:Mclang}
|
|
|
|
LUAJIT_TARGET_LIBS = "-lc++abi -lpthread"
|
|
|
|
WANTLIB += c++abi pthread
|
|
|
|
.endif
|
2019-11-20 13:43:35 +00:00
|
|
|
pre-configure:
|
2021-10-08 22:10:27 +00:00
|
|
|
mkdir -p ${STATIC_DEPS_WRKBUILD} ${STATIC_DEPS_PREFIX}
|
|
|
|
|
|
|
|
.if ${EMBED_LUAJIT} == "Yes"
|
|
|
|
# Build LuaJIT.
|
|
|
|
# We can't build LuaJIT out of its src dir, so copy it so that we can
|
|
|
|
# support SEPARATE_BUILD.
|
|
|
|
cp -r ${STATIC_DEPS_WRKSRC}/luajit ${STATIC_DEPS_WRKBUILD}/luajit
|
|
|
|
cd ${STATIC_DEPS_WRKBUILD}/luajit/src && \
|
|
|
|
${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} \
|
|
|
|
PREFIX=${STATIC_DEPS_INST} CC=${CC} CCOPT="${CFLAGS}" \
|
|
|
|
CCOPT_x86="" Q="" TARGET_LIBS=${LUAJIT_TARGET_LIBS} \
|
|
|
|
BUILDMODE=static
|
|
|
|
cd ${STATIC_DEPS_WRKBUILD}/luajit && \
|
|
|
|
${SETENV} ${MAKE_ENV} Q="" ${MAKE_PROGRAM} install \
|
|
|
|
PREFIX=${STATIC_DEPS_INST}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# Build libluv.
|
|
|
|
mkdir -p ${STATIC_DEPS_WRKBUILD}/luv
|
|
|
|
cd ${STATIC_DEPS_WRKBUILD}/luv && \
|
2019-11-20 13:43:35 +00:00
|
|
|
${SETENV} CC="${CC}" \
|
|
|
|
CXX="${CXX}" \
|
|
|
|
CFLAGS="${CFLAGS}" \
|
|
|
|
CXXFLAGS="${CXXFLAGS}" \
|
|
|
|
${CONFIGURE_ENV} \
|
|
|
|
${LOCALBASE}/bin/cmake \
|
|
|
|
-DBUILD_MODULE=OFF \
|
2021-12-25 10:44:22 +00:00
|
|
|
-DBUILD_STATIC_LIBS=ON \
|
2019-11-20 13:43:35 +00:00
|
|
|
-DCMAKE_COLOR_MAKEFILE=OFF \
|
|
|
|
-DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON \
|
2021-07-18 09:18:07 +00:00
|
|
|
-DCMAKE_SUPPRESS_REGENERATION=ON \
|
2021-10-08 22:10:27 +00:00
|
|
|
-DCMAKE_INSTALL_PREFIX=${STATIC_DEPS_INST} \
|
2019-11-20 13:43:35 +00:00
|
|
|
-DLUA_BUILD_TYPE=System \
|
|
|
|
-DLUA_INCLUDE_DIR=${MODLUA_INCL_DIR} \
|
2021-10-08 22:10:27 +00:00
|
|
|
-DLUA_LIBRARIES=${MODLUA_LIBDIR} \
|
2019-11-20 13:43:35 +00:00
|
|
|
-DWITH_LUA_ENGINE=Lua \
|
2021-10-08 22:10:27 +00:00
|
|
|
${STATIC_DEPS_WRKSRC}/luv
|
|
|
|
cd ${STATIC_DEPS_WRKBUILD}/luv && \
|
2019-11-20 13:43:35 +00:00
|
|
|
${SETENV} ${MAKE_ENV} VERBOSE=1 \
|
|
|
|
${MAKE_PROGRAM}
|
2021-10-08 22:10:27 +00:00
|
|
|
cd ${STATIC_DEPS_WRKBUILD}/luv && \
|
2019-11-20 13:43:35 +00:00
|
|
|
${SETENV} ${MAKE_ENV} VERBOSE=1 \
|
|
|
|
${MAKE_PROGRAM} install
|
|
|
|
|
2017-05-02 20:58:42 +00:00
|
|
|
# These are the "old tests". There is also a new suite, but we would need the
|
|
|
|
# "busted" test suite for Lua, which is not yet ported.
|
2019-03-17 13:13:40 +00:00
|
|
|
#
|
2020-08-18 19:15:54 +00:00
|
|
|
# If cscope is installed, one test fails:
|
|
|
|
# https://github.com/neovim/neovim/issues/12744
|
2021-10-08 22:10:27 +00:00
|
|
|
#
|
2021-12-25 10:44:22 +00:00
|
|
|
do-test:
|
|
|
|
true
|
|
|
|
${SETENV} LC_CTYPE=en_US.UTF-8 \
|
|
|
|
${MAKE_PROGRAM} -C ${WRKSRC}/src/nvim/testdir \
|
|
|
|
HOME=${WRKBUILD} NVIM_PRG=${WRKBUILD}/bin/nvim ${MAKE_FLAGS}
|
2017-05-02 20:58:42 +00:00
|
|
|
|
|
|
|
.include <bsd.port.mk>
|