build(deps): remove msgpack-c dependency

This commit is contained in:
bfredl 2024-07-02 13:47:04 +02:00
parent f926cc32c9
commit 1247684ae1
11 changed files with 13 additions and 56 deletions

View File

@ -241,7 +241,6 @@ jobs:
sudo add-apt-repository ppa:neovim-ppa/stable
sudo apt-get install -y \
libluajit-5.1-dev \
libmsgpack-dev \
libtermkey-dev \
libunibilium-dev \
libuv1-dev \

View File

@ -84,7 +84,7 @@ make deps
- Right-click _CMakeLists.txt → Delete Cache_.
- Right-click _CMakeLists.txt → Generate Cache_.
- If you see an "access violation" from `ntdll`, you can ignore it and continue.
4. If you see an error like `msgpackc.dll not found`, try the `nvim.exe (Install)` target. Then switch back to `nvim.exe (bin\nvim.exe)`.
4. If you see an error like `uv.dll not found`, try the `nvim.exe (Install)` target. Then switch back to `nvim.exe (bin\nvim.exe)`.
### Windows / MSVC PowerShell
@ -240,7 +240,7 @@ cmake --build build
### How to build without "bundled" dependencies
1. Manually install the dependencies:
- libuv libluv libutf8proc libvterm luajit lua-lpeg lua-mpack msgpack-c tree-sitter tree-sitter-c tree-sitter-lua tree-sitter-markdown tree-sitter-query tree-sitter-vim tree-sitter-vimdoc unibilium
- libuv libluv libutf8proc libvterm luajit lua-lpeg tree-sitter tree-sitter-c tree-sitter-lua tree-sitter-markdown tree-sitter-query tree-sitter-vim tree-sitter-vimdoc unibilium
2. Run CMake:
```sh
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo
@ -260,7 +260,7 @@ cmake --build build
#### Debian 10 (Buster) example:
```sh
sudo apt install luajit libluajit-5.1-dev lua-mpack lua-lpeg libunibilium-dev libmsgpack-dev
sudo apt install luajit libluajit-5.1-dev lua-lpeg libunibilium-dev
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_BUNDLED=OFF -DUSE_BUNDLED_LIBUV=ON -DUSE_BUNDLED_LUV=ON -DUSE_BUNDLED_LIBVTERM=ON -DUSE_BUNDLED_TS=ON -DUSE_BUNDLED_UTF8PROC=ON
cmake --build .deps
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo

View File

@ -33,7 +33,6 @@ option(USE_BUNDLED_LPEG "Use the bundled lpeg." ${USE_BUNDLED})
option(USE_BUNDLED_LUA "Use the bundled version of lua." OFF)
option(USE_BUNDLED_LUAJIT "Use the bundled version of luajit." ${USE_BUNDLED})
option(USE_BUNDLED_LUV "Use the bundled version of luv." ${USE_BUNDLED})
option(USE_BUNDLED_MSGPACK "Use the bundled msgpack." ${USE_BUNDLED})
option(USE_BUNDLED_TS "Use the bundled treesitter runtime." ${USE_BUNDLED})
option(USE_BUNDLED_TS_PARSERS "Use the bundled treesitter parsers." ${USE_BUNDLED})
option(USE_BUNDLED_UNIBILIUM "Use the bundled unibilium." ${USE_BUNDLED})
@ -105,10 +104,6 @@ if(USE_BUNDLED_LIBUV)
include(BuildLibuv)
endif()
if(USE_BUNDLED_MSGPACK)
include(BuildMsgpack)
endif()
if(USE_BUNDLED_LUAJIT)
include(BuildLuajit)
endif()

View File

@ -1,7 +0,0 @@
get_externalproject_options(msgpack ${DEPS_IGNORE_SHA})
ExternalProject_Add(msgpack
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/msgpack
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
-D MSGPACK_BUILD_TESTS=OFF
-D MSGPACK_BUILD_EXAMPLES=OFF
${EXTERNALPROJECT_OPTIONS})

View File

@ -1,9 +1,6 @@
LIBUV_URL https://github.com/libuv/libuv/archive/v1.48.0.tar.gz
LIBUV_SHA256 8c253adb0f800926a6cbd1c6576abae0bc8eb86a4f891049b72f9e5b7dc58f33
MSGPACK_URL https://github.com/msgpack/msgpack-c/archive/c-6.0.1.tar.gz
MSGPACK_SHA256 58d5fe49d0ee2b374d60a61aabf8028b2c92004e6f11bff04e74b639fc8ad541
LUAJIT_URL https://github.com/LuaJIT/LuaJIT/archive/04dca7911ea255f37be799c18d74c305b921c1a6.tar.gz
LUAJIT_SHA256 346b028d9ba85e04b7e23a43cc51ec076574d2efc0d271d4355141b0145cd6e0

View File

@ -1,24 +0,0 @@
find_path2(MSGPACK_INCLUDE_DIR msgpack/version_master.h)
if(MSGPACK_INCLUDE_DIR)
file(READ ${MSGPACK_INCLUDE_DIR}/msgpack/version_master.h msgpack_version_h)
string(REGEX REPLACE ".*MSGPACK_VERSION_MAJOR +([0-9]+).*" "\\1" MSGPACK_VERSION_MAJOR "${msgpack_version_h}")
string(REGEX REPLACE ".*MSGPACK_VERSION_MINOR +([0-9]+).*" "\\1" MSGPACK_VERSION_MINOR "${msgpack_version_h}")
string(REGEX REPLACE ".*MSGPACK_VERSION_REVISION +([0-9]+).*" "\\1" MSGPACK_VERSION_REVISION "${msgpack_version_h}")
set(MSGPACK_VERSION_STRING "${MSGPACK_VERSION_MAJOR}.${MSGPACK_VERSION_MINOR}.${MSGPACK_VERSION_REVISION}")
else()
set(MSGPACK_VERSION_STRING)
endif()
find_library2(MSGPACK_LIBRARY NAMES msgpackc msgpack msgpackc_import msgpack-c
NAMES_PER_DIR)
mark_as_advanced(MSGPACK_INCLUDE_DIR MSGPACK_LIBRARY)
find_package_handle_standard_args(Msgpack
REQUIRED_VARS MSGPACK_LIBRARY MSGPACK_INCLUDE_DIR
VERSION_VAR MSGPACK_VERSION_STRING)
add_library(msgpack INTERFACE)
target_include_directories(msgpack SYSTEM BEFORE INTERFACE ${MSGPACK_INCLUDE_DIR})
target_link_libraries(msgpack INTERFACE ${MSGPACK_LIBRARY})

View File

@ -48,7 +48,6 @@
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LIBVTERM=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LUAJIT=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LUV=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_MSGPACK=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_TS=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_TS_PARSERS=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_UNIBILIUM=OFF

View File

@ -32,7 +32,6 @@ find_package(Iconv REQUIRED)
find_package(Libuv 1.28.0 REQUIRED)
find_package(Libvterm 0.3.3 REQUIRED)
find_package(Lpeg REQUIRED)
find_package(Msgpack 1.0.0 REQUIRED)
find_package(Treesitter 0.22.6 REQUIRED)
find_package(Unibilium 2.0 REQUIRED)
find_package(UTF8proc REQUIRED)
@ -41,7 +40,6 @@ target_link_libraries(main_lib INTERFACE
iconv
libvterm
lpeg
msgpack
treesitter
unibilium
utf8proc)

View File

@ -1010,7 +1010,7 @@ static void typval_parse_enter(mpack_parser_t *parser, mpack_node_t *node)
}
}
/// free node which was entered but never exited, due to a nested error
/// Free node which was entered but never exited, due to a nested error
///
/// Don't bother with typvals as these will be GC:d eventually
void typval_parser_error_free(mpack_parser_t *parser)
@ -1109,7 +1109,7 @@ msgpack_to_vim_generic_map: {}
}
default:
// other kinds are handled completely in typval_parse_enter,
// other kinds are handled completely in typval_parse_enter
break;
}
}

View File

@ -525,12 +525,12 @@ bool unpacker_parse_redraw(Unpacker *p)
}
}
/// require complete string. safe to use e.g. in shada as we have loaded a complete shada item into
/// a linear buffer.
/// Requires a complete string. safe to use e.g. in shada as we have loaded a
/// complete shada item into a linear buffer.
///
/// data and size are preserved in cause of failure
/// Data and size are preserved in cause of failure.
///
/// @return "data" is NULL exact when failure (non-null data and size=0 for
/// @return "data" is NULL only when failure (non-null data and size=0 for
/// valid empty string)
String unpack_string(const char **data, size_t *size)
{

View File

@ -1313,9 +1313,9 @@ static char *shada_filename(const char *file)
return xstrdup(file);
}
#define PACK_KEY(s) mpack_str(STATIC_CSTR_AS_STRING(KEY_NAME(s)), &sbuf);
#define KEY_NAME(s) #s
#define KEY_NAME2(s) KEY_NAME(s)
#define KEY_NAME_(s) #s
#define PACK_KEY(s) mpack_str(STATIC_CSTR_AS_STRING(KEY_NAME_(s)), &sbuf);
#define KEY_NAME(s) KEY_NAME_(s)
#define SHADA_MPACK_FREE_SPACE (4 * MPACK_ITEM_SIZE)
@ -3301,7 +3301,7 @@ shada_read_next_item_start:
}
if (it.rc.size == 0) {
semsg(_(READERR("register",
"has " KEY_NAME2(REG_KEY_CONTENTS) " key with missing or empty array")),
"has " KEY_NAME(REG_KEY_CONTENTS) " key with missing or empty array")),
initial_fpos);
goto shada_read_next_item_error;
}