From 9f8f287c6139b8b8ff2809f4d1aebb57021cd043 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Sat, 9 Sep 2023 18:14:52 +0200 Subject: [PATCH] build: remove luarocks Luarocks is no longer needed after 25e51d393a420765d5efd44c1b4be823a5cf280a. --- CMakeLists.txt | 3 -- cmake/BuildLuarocks.cmake | 99 --------------------------------------- contrib/local.mk.example | 1 - test/CMakeLists.txt | 6 +-- 4 files changed, 3 insertions(+), 106 deletions(-) delete mode 100644 cmake/BuildLuarocks.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 24ca416dbc..aec39109e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -298,8 +298,6 @@ ExternalProject_Add(uncrustify CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS} EXCLUDE_FROM_ALL TRUE) -include(BuildLuarocks) - ExternalProject_Add(lua-dev-deps URL https://github.com/neovim/deps/raw/5a1f71cceb24990a0b15fd9a472a5f549f019248/opt/lua-dev-deps.tar.gz URL_HASH SHA256=27db2495f5eddc7fc191701ec9b291486853530c6125609d3197d03481e8d5a2 @@ -310,4 +308,3 @@ ExternalProject_Add(lua-dev-deps BUILD_COMMAND "" INSTALL_COMMAND "" EXCLUDE_FROM_ALL TRUE) -add_dependencies(test_deps lua-dev-deps) diff --git a/cmake/BuildLuarocks.cmake b/cmake/BuildLuarocks.cmake deleted file mode 100644 index 0ab4143b75..0000000000 --- a/cmake/BuildLuarocks.cmake +++ /dev/null @@ -1,99 +0,0 @@ -# Luarocks recipe. Luarocks is only required when testing Neovim. -# NOTE: LuaRocks rocks need to "DEPENDS" on the previous module, because -# running luarocks in parallel will break, e.g. when some rocks have -# the same dependency. - -# The luarocks binary location -set(LUAROCKS_BINARY ${DEPS_BIN_DIR}/luarocks) - -# Arguments for calls to 'luarocks build' -if(NOT MSVC) - # In MSVC don't pass the compiler/linker to luarocks, the bundled - # version already knows, and passing them here breaks the build - set(LUAROCKS_BUILDARGS CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}) -endif() - -if(UNIX) - if(PREFER_LUA) - find_package(Lua 5.1 EXACT REQUIRED) - get_filename_component(LUA_ROOT ${LUA_INCLUDE_DIR} DIRECTORY) - list(APPEND LUAROCKS_OPTS - --with-lua=${LUA_ROOT}) - else() - find_package(Luajit REQUIRED) - get_filename_component(LUA_ROOT ${LUAJIT_INCLUDE_DIR} DIRECTORY) - get_filename_component(LUA_ROOT ${LUA_ROOT} DIRECTORY) - list(APPEND LUAROCKS_OPTS - --with-lua=${LUA_ROOT} - --with-lua-include=${LUAJIT_INCLUDE_DIR} - --with-lua-interpreter=luajit) - endif() - - set(LUAROCKS_CONFIGURE_COMMAND ${DEPS_BUILD_DIR}/src/luarocks/configure - --prefix=${DEPS_INSTALL_DIR} --force-config ${LUAROCKS_OPTS}) - set(LUAROCKS_INSTALL_COMMAND ${MAKE_PRG} -j1 install) -elseif(MSVC OR MINGW) - if(MINGW) - set(COMPILER_FLAG /MW) - elseif(MSVC) - set(COMPILER_FLAG /MSVC) - endif() - - find_package(Luajit REQUIRED) - # Always assume bundled luajit for native Win32 - set(LUAROCKS_INSTALL_COMMAND install.bat /FORCECONFIG /NOREG /NOADMIN /Q /F - /LUA ${DEPS_PREFIX} - /INC ${LUAJIT_INCLUDE_DIR} - /P ${DEPS_INSTALL_DIR}/luarocks - /TREE ${DEPS_INSTALL_DIR} - /SCRIPTS ${DEPS_BIN_DIR} - ${COMPILER_FLAG}) - - set(LUAROCKS_BINARY ${DEPS_INSTALL_DIR}/luarocks/luarocks.bat) -else() - message(FATAL_ERROR "Trying to build luarocks in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}") -endif() - -ExternalProject_Add(luarocks - URL https://github.com/luarocks/luarocks/archive/v3.9.2.tar.gz - URL_HASH SHA256=a0b36cd68586cd79966d0106bb2e5a4f5523327867995fd66bee4237062b3e3b - DOWNLOAD_NO_PROGRESS TRUE - DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/luarocks - BUILD_IN_SOURCE 1 - CONFIGURE_COMMAND "${LUAROCKS_CONFIGURE_COMMAND}" - BUILD_COMMAND "" - INSTALL_COMMAND "${LUAROCKS_INSTALL_COMMAND}" - EXCLUDE_FROM_ALL TRUE) - -set(ROCKS_DIR ${DEPS_LIB_DIR}/luarocks/rocks) - -if(MSVC) - # Workaround for luarocks failing to find the md5sum.exe it is shipped with. - list(APPEND LUAROCKS_BUILDARGS MD5SUM=md5sum) - set(PATH PATH=${DEPS_INSTALL_DIR}/luarocks/tools;$ENV{PATH}) -endif() - -set(CURRENT_DEP luarocks) - -function(Download ROCK VER) - if(ARGV2) - set(OUTPUT ${ARGV2}) - else() - set(OUTPUT ${ROCKS_DIR}/${ROCK}) - endif() - add_custom_command(OUTPUT ${OUTPUT} - COMMAND ${CMAKE_COMMAND} -E env "${PATH}" ${LUAROCKS_BINARY} build ${ROCK} ${VER} ${LUAROCKS_BUILDARGS} - DEPENDS ${CURRENT_DEP}) - add_custom_target(${ROCK} DEPENDS ${OUTPUT}) - set(CURRENT_DEP ${ROCK} PARENT_SCOPE) -endfunction() - -if(WIN32) - set(LUACHECK_EXE "${DEPS_BIN_DIR}/luacheck.bat") -else() - set(LUACHECK_EXE "${DEPS_BIN_DIR}/luacheck") -endif() - -add_custom_target(test_deps) - -Download(luacheck 1.1.0-1 ${LUACHECK_EXE}) diff --git a/contrib/local.mk.example b/contrib/local.mk.example index 4bd026cf87..bda2c1b4dc 100644 --- a/contrib/local.mk.example +++ b/contrib/local.mk.example @@ -46,7 +46,6 @@ # DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LIBUV=OFF # DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LIBVTERM=OFF # DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LUAJIT=OFF -# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LUAROCKS=OFF # DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_MSGPACK=OFF # DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_UNIBILIUM=OFF # DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_UTF8PROC=OFF diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 77fe7b3b82..e9be79edc0 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -27,7 +27,7 @@ if(LUA_HAS_FFI) -P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake DEPENDS ${UNITTEST_PREREQS} USES_TERMINAL) - add_dependencies(unittest test_deps) + add_dependencies(unittest lua-dev-deps) else() message(WARNING "disabling unit tests: no Luajit FFI in ${LUA_PRG}") endif() @@ -66,5 +66,5 @@ add_custom_target(benchmark DEPENDS ${BENCHMARK_PREREQS} USES_TERMINAL) -add_dependencies(functionaltest test_deps) -add_dependencies(benchmark test_deps) +add_dependencies(functionaltest lua-dev-deps) +add_dependencies(benchmark lua-dev-deps)