<pre style='margin:0'>
Zero King (l2dy) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/77f8d99816f5e9ac3ef7869a772f79f1d26f8f24">https://github.com/macports/macports-ports/commit/77f8d99816f5e9ac3ef7869a772f79f1d26f8f24</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 77f8d99816f neovim: Build and install tree-sitter parsers (#24120)
</span>77f8d99816f is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 77f8d99816f5e9ac3ef7869a772f79f1d26f8f24
</span>Author: Florian Märkl <info@florianmaerkl.de>
AuthorDate: Sat Jun 8 07:47:36 2024 +0200
<span style='display:block; white-space:pre;color:#404040;'> neovim: Build and install tree-sitter parsers (#24120)
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> neovim needs a number of prebuilt parsers in <prefix>/lib/nvim/parser/
</span><span style='display:block; white-space:pre;color:#404040;'> or else it will throw errors when opening e.g. ":help".
</span><span style='display:block; white-space:pre;color:#404040;'> USE_BUNDLED is also not a valid option for the root cmake build system
</span><span style='display:block; white-space:pre;color:#404040;'> anymore, but applies to the one in cmake.deps/.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Closes: https://trac.macports.org/ticket/70072
</span>---
editors/neovim/Portfile | 10 ++--
editors/neovim/files/embed-parsers-build.diff | 68 +++++++++++++++++++++++++++
2 files changed, 74 insertions(+), 4 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/editors/neovim/Portfile b/editors/neovim/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 18b8fbf78d6..0e2b966b591 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/editors/neovim/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/editors/neovim/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -5,7 +5,7 @@ PortGroup github 1.0
</span> PortGroup cmake 1.1
github.setup neovim neovim 0.10.0 v
<span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 1
</span> categories editors
maintainers {raimue @raimue} \
{l2dy @l2dy} \
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -45,13 +45,15 @@ depends_lib port:gettext \
</span>
cmake.build_type Release
<span style='display:block; white-space:pre;background:#ffe0e0;'>-configure.args-append -DUSE_BUNDLED=OFF \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- -DLUA_PRG=${prefix}/bin/luajit
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+configure.args-append -DLUA_PRG=${prefix}/bin/luajit
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Building parsers is normally an extra step, see https://github.com/neovim/neovim/issues/29042
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles embed-parsers-build.diff
</span>
subport neovim-devel {
github.setup neovim neovim efaf37a2b9450d56acbf48a44c3c791d00d70199
version 20240501-[string range ${github.version} 0 6]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- revision 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ revision 1
</span>
github.tarball_from tarball
checksums rmd160 1e4dce0c64f3d793120c64555a60050daed5e504 \
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/editors/neovim/files/embed-parsers-build.diff b/editors/neovim/files/embed-parsers-build.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..e0f0c5d64d2
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/editors/neovim/files/embed-parsers-build.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,68 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git CMakeLists.txt CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 5ad99cbf0..3828ee192 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -98,8 +98,21 @@ else()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++# Reading deps.txt adapted from cmake.deps/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++file(READ cmake.deps/deps.txt DEPENDENCIES)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++STRING(REGEX REPLACE "\n" ";" DEPENDENCIES "${DEPENDENCIES}")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++foreach(dep ${DEPENDENCIES})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ STRING(REGEX REPLACE " " ";" dep "${dep}")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ list(GET dep 0 name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ list(GET dep 1 value)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set(${name} ${value})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++endforeach()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++set(DEPS_IGNORE_SHA FALSE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++list(APPEND DEPS_CMAKE_ARGS -D "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" -D "CMAKE_C_FLAGS=${CMAKE_C_FLAGS}")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++include(cmake.deps/cmake/BuildTreesitterParsers.cmake)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if(APPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # If the macOS deployment target is not set manually (via $MACOSX_DEPLOYMENT_TARGET),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # fall back to local system version. Needs to be done both here and in cmake.deps.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git cmake.deps/cmake/BuildTreesitterParsers.cmake cmake.deps/cmake/BuildTreesitterParsers.cmake
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 837d075d2..6dbd69554 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- cmake.deps/cmake/BuildTreesitterParsers.cmake
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ cmake.deps/cmake/BuildTreesitterParsers.cmake
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -20,15 +20,17 @@ function(BuildTSParser)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ get_externalproject_options(${NAME} ${DEPS_IGNORE_SHA})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ExternalProject_Add(${NAME}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/${NAME}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ PATCH_COMMAND ${CMAKE_COMMAND} -E copy
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${TS_CMAKE_FILE}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ${CMAKE_CURRENT_LIST_DIR}/${TS_CMAKE_FILE}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${DEPS_BUILD_DIR}/src/${NAME}/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ CMAKE_ARGS ${DEPS_CMAKE_ARGS}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -D PARSERLANG=${TS_LANG}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${EXTERNALPROJECT_OPTIONS})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endfunction()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++set(ALL_BUNDLED_TS_PARSER_TARGETS c lua vim vimdoc query python bash markdown) # All parsers built in the lines directly below.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++list(TRANSFORM ALL_BUNDLED_TS_PARSER_TARGETS PREPEND treesitter_)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach(lang c lua vim vimdoc query python bash)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ BuildTSParser(LANG ${lang})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endforeach()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ BuildTSParser(LANG markdown CMAKE_FILE MarkdownParserCMakeLists.txt)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/nvim/CMakeLists.txt src/nvim/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index d9cc695c5..53bf044ba 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/nvim/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/nvim/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -767,12 +767,10 @@ if(WIN32)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ file(MAKE_DIRECTORY ${BINARY_LIB_DIR})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# install treesitter parser if bundled
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-if(EXISTS ${DEPS_PREFIX}/lib/nvim/parser)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- add_custom_command(TARGET nvim_runtime_deps COMMAND ${CMAKE_COMMAND} -E ${COPY_DIRECTORY} ${DEPS_PREFIX}/lib/nvim/parser ${BINARY_LIB_DIR}/parser)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++add_dependencies(nvim_runtime_deps ${ALL_BUNDLED_TS_PARSER_TARGETS})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++add_custom_command(TARGET nvim_runtime_deps COMMAND ${CMAKE_COMMAND} -E ${COPY_DIRECTORY} ${DEPS_INSTALL_DIR}/lib/nvim/parser ${BINARY_LIB_DIR}/parser)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ install(DIRECTORY ${BINARY_LIB_DIR}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ DESTINATION ${CMAKE_INSTALL_LIBDIR}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ USE_SOURCE_PERMISSIONS)
</span></pre><pre style='margin:0'>
</pre>