void-packages/srcpkgs/neovim/patches/cross-build.patch

137 lines
7.1 KiB
Diff

diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt
index c171fab..cb29798 100644
--- a/runtime/CMakeLists.txt
+++ b/runtime/CMakeLists.txt
@@ -11,7 +11,7 @@ get_directory_property(LUA_GEN DIRECTORY ${PROJECT_SOURCE_DIR}/src/nvim DEFINITI
get_directory_property(LUA_GEN_DEPS DIRECTORY ${PROJECT_SOURCE_DIR}/src/nvim DEFINITION LUA_GEN_DEPS)
add_custom_command(OUTPUT ${GENERATED_SYN_VIM}
- COMMAND ${LUA_GEN} ${SYN_VIM_GENERATOR} ${GENERATED_SYN_VIM} ${FUNCS_DATA}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} ${LUA_GEN} ${SYN_VIM_GENERATOR} ${GENERATED_SYN_VIM} ${FUNCS_DATA}
DEPENDS
${LUA_GEN_DEPS}
${SYN_VIM_GENERATOR}
@@ -33,7 +33,7 @@ foreach(PACKAGE ${PACKAGES})
add_custom_command(OUTPUT "${GENERATED_PACKAGE_DIR}/${PACKNAME}/doc/tags"
COMMAND ${CMAKE_COMMAND} -E copy_directory
${PACKAGE} ${GENERATED_PACKAGE_DIR}/${PACKNAME}
- COMMAND $<TARGET_FILE:nvim_bin>
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:nvim_bin>
-u NONE -i NONE -e --headless -c "helptags doc" -c quit
DEPENDS
nvim_bin
@@ -65,7 +65,7 @@ add_custom_command(OUTPUT ${GENERATED_HELP_TAGS}
COMMAND ${CMAKE_COMMAND} -E remove_directory doc
COMMAND ${CMAKE_COMMAND} -E copy_directory
${PROJECT_SOURCE_DIR}/runtime/doc doc
- COMMAND $<TARGET_FILE:nvim_bin>
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:nvim_bin>
-u NONE -i NONE -e --headless -c "helptags ++t doc" -c quit
DEPENDS
nvim_bin
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt
index a100e73..786a29c 100644
--- a/src/nvim/CMakeLists.txt
+++ b/src/nvim/CMakeLists.txt
@@ -543,7 +543,7 @@ foreach(sfile ${NVIM_SOURCES}
add_custom_command(
OUTPUT "${gf_c_h}" "${gf_h_h}"
COMMAND ${CMAKE_C_COMPILER} ${sfile} ${PREPROC_OUTPUT} ${gen_cflags}
- COMMAND ${LUA_GEN} "${HEADER_GENERATOR}" "${sfile}" "${gf_c_h}" "${gf_h_h}" "${gf_i}"
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} ${LUA_GEN} "${HEADER_GENERATOR}" "${sfile}" "${gf_c_h}" "${gf_h_h}" "${gf_i}"
DEPENDS ${depends})
list(APPEND NVIM_GENERATED_FOR_SOURCES "${gf_c_h}")
list(APPEND NVIM_GENERATED_FOR_HEADERS "${gf_h_h}")
@@ -553,7 +553,7 @@ foreach(sfile ${NVIM_SOURCES}
endforeach()
add_custom_command(OUTPUT ${GENERATED_UNICODE_TABLES}
- COMMAND ${LUA_PRG} ${UNICODE_TABLES_GENERATOR}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} ${LUA_PRG} ${UNICODE_TABLES_GENERATOR}
${UNICODE_DIR}
${GENERATED_UNICODE_TABLES}
DEPENDS
@@ -567,7 +567,7 @@ configure_file(${GENERATOR_DIR}/nvim_version.lua.in ${NVIM_VERSION_LUA})
add_custom_command(
OUTPUT ${GENERATED_API_DISPATCH} ${GENERATED_API_METADATA}
${FUNCS_METADATA} ${LUA_API_C_BINDINGS} ${GENERATED_KEYSETS_DEFS}
- COMMAND ${LUA_GEN} ${API_DISPATCH_GENERATOR}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} ${LUA_GEN} ${API_DISPATCH_GENERATOR}
${GENERATED_API_DISPATCH}
${GENERATED_API_METADATA} ${FUNCS_METADATA}
${LUA_API_C_BINDINGS}
@@ -591,7 +591,7 @@ add_custom_command(
OUTPUT ${VIM_MODULE_FILE}
COMMAND ${CMAKE_COMMAND} -E env
"LUAC_PRG=${LUAC_PRG}"
- ${LUA_PRG} ${CHAR_BLOB_GENERATOR} -c ${VIM_MODULE_FILE}
+ ${CMAKE_CROSSCOMPILING_EMULATOR} ${LUA_PRG} ${CHAR_BLOB_GENERATOR} -c ${VIM_MODULE_FILE}
# NB: vim._init_packages and vim.inspect must be be first and second ones
# respectively, otherwise --luamod-dev won't work properly.
${LUA_INIT_PACKAGES_MODULE_SOURCE} "vim._init_packages"
@@ -626,7 +626,7 @@ add_custom_command(
${GENERATED_UI_EVENTS_REMOTE}
${UI_METADATA}
${GENERATED_UI_EVENTS_CLIENT}
- COMMAND ${LUA_GEN} ${API_UI_EVENTS_GENERATOR}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} ${LUA_GEN} ${API_UI_EVENTS_GENERATOR}
${CMAKE_CURRENT_LIST_DIR}/api/ui_events.in.h
${GENERATED_UI_EVENTS_CALL}
${GENERATED_UI_EVENTS_REMOTE}
@@ -658,29 +658,29 @@ list(APPEND NVIM_GENERATED_FOR_SOURCES
)
add_custom_command(OUTPUT ${GENERATED_EX_CMDS_ENUM} ${GENERATED_EX_CMDS_DEFS}
- COMMAND ${LUA_GEN} ${EX_CMDS_GENERATOR} ${GENERATED_INCLUDES_DIR} ${GENERATED_DIR}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} ${LUA_GEN} ${EX_CMDS_GENERATOR} ${GENERATED_INCLUDES_DIR} ${GENERATED_DIR}
DEPENDS ${LUA_GEN_DEPS} ${EX_CMDS_GENERATOR} ${CMAKE_CURRENT_LIST_DIR}/ex_cmds.lua
)
add_custom_command(OUTPUT ${GENERATED_FUNCS} ${FUNCS_DATA}
- COMMAND ${LUA_GEN} ${FUNCS_GENERATOR} ${GENERATED_DIR} ${FUNCS_METADATA} ${FUNCS_DATA}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} ${LUA_GEN} ${FUNCS_GENERATOR} ${GENERATED_DIR} ${FUNCS_METADATA} ${FUNCS_DATA}
DEPENDS ${LUA_GEN_DEPS} ${FUNCS_GENERATOR} ${CMAKE_CURRENT_LIST_DIR}/eval.lua ${FUNCS_METADATA}
)
list(APPEND NVIM_GENERATED_FOR_SOURCES
"${GENERATED_FUNCS}")
add_custom_command(OUTPUT ${GENERATED_EVENTS_ENUM} ${GENERATED_EVENTS_NAMES_MAP}
- COMMAND ${LUA_GEN} ${EVENTS_GENERATOR} ${GENERATED_EVENTS_ENUM} ${GENERATED_EVENTS_NAMES_MAP}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} ${LUA_GEN} ${EVENTS_GENERATOR} ${GENERATED_EVENTS_ENUM} ${GENERATED_EVENTS_NAMES_MAP}
DEPENDS ${LUA_GEN_DEPS} ${EVENTS_GENERATOR} ${CMAKE_CURRENT_LIST_DIR}/auevents.lua
)
add_custom_command(OUTPUT ${GENERATED_OPTIONS}
- COMMAND ${LUA_GEN} ${OPTIONS_GENERATOR} ${GENERATED_OPTIONS}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} ${LUA_GEN} ${OPTIONS_GENERATOR} ${GENERATED_OPTIONS}
DEPENDS ${LUA_GEN_DEPS} ${OPTIONS_GENERATOR} ${CMAKE_CURRENT_LIST_DIR}/options.lua
)
add_custom_command(OUTPUT ${GENERATED_OPTIONS_ENUM} ${GENERATED_OPTIONS_MAP}
- COMMAND ${LUA_GEN} ${OPTIONS_ENUM_GENERATOR} ${GENERATED_OPTIONS_ENUM} ${GENERATED_OPTIONS_MAP}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} ${LUA_GEN} ${OPTIONS_ENUM_GENERATOR} ${GENERATED_OPTIONS_ENUM} ${GENERATED_OPTIONS_MAP}
DEPENDS ${LUA_GEN_DEPS} ${OPTIONS_ENUM_GENERATOR} ${CMAKE_CURRENT_LIST_DIR}/options.lua
)
diff --git a/src/nvim/po/CMakeLists.txt b/src/nvim/po/CMakeLists.txt
index 348ba28..8e9988d 100644
--- a/src/nvim/po/CMakeLists.txt
+++ b/src/nvim/po/CMakeLists.txt
@@ -53,14 +53,14 @@ if(HAVE_WORKING_LIBINTL AND GETTEXT_FOUND AND XGETTEXT_PRG AND ICONV_PRG)
list(SORT NVIM_RELATIVE_SOURCES)
add_custom_command(
OUTPUT ${NVIM_POT}
- COMMAND $<TARGET_FILE:nvim_bin> -u NONE -i NONE -n --headless --cmd "set cpo+=+"
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:nvim_bin> -u NONE -i NONE -n --headless --cmd "set cpo+=+"
-c "silent source ${CMAKE_CURRENT_SOURCE_DIR}/tojavascript.vim"
${NVIM_POT} ${PROJECT_SOURCE_DIR}/runtime/optwin.vim
COMMAND ${XGETTEXT_PRG} -o ${NVIM_POT} --default-domain=nvim
--add-comments --keyword=_ --keyword=N_ --keyword=NGETTEXT:1,2
-D ${CMAKE_CURRENT_SOURCE_DIR} -D ${CMAKE_CURRENT_BINARY_DIR}
${NVIM_RELATIVE_SOURCES} optwin.js
- COMMAND $<TARGET_FILE:nvim_bin> -u NONE -i NONE -n --headless --cmd "set cpo+=+"
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:nvim_bin> -u NONE -i NONE -n --headless --cmd "set cpo+=+"
-c "silent source ${CMAKE_CURRENT_SOURCE_DIR}/fixfilenames.vim"
${NVIM_POT} ${PROJECT_SOURCE_DIR}/runtime/optwin.vim
VERBATIM