aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-03-08 23:57:08 +0100
committerJustin M. Keyes <justinkz@gmail.com>2018-03-11 12:43:42 +0100
commit90963a9c55b188f6598e7c549ec2718cf3dd668f (patch)
tree438996711b1c6c16b12b06dbc8c24bb102480867
parent496b0f944fcbfd84db9e2dd625c6b756a3d1e467 (diff)
downloadrneovim-90963a9c55b188f6598e7c549ec2718cf3dd668f.tar.gz
rneovim-90963a9c55b188f6598e7c549ec2718cf3dd668f.tar.bz2
rneovim-90963a9c55b188f6598e7c549ec2718cf3dd668f.zip
build/luarocks: apply "Fix siteconfig" patch
upstream: https://github.com/luarocks/luarocks/pull/774
-rw-r--r--third-party/CMakeLists.txt8
-rw-r--r--third-party/cmake/BuildLuarocks.cmake4
-rw-r--r--third-party/patches/luarocks-Fix-siteconfig.patch28
3 files changed, 35 insertions, 5 deletions
diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt
index 7c95bbb91d..fb3166b70f 100644
--- a/third-party/CMakeLists.txt
+++ b/third-party/CMakeLists.txt
@@ -50,11 +50,9 @@ endif()
option(USE_EXISTING_SRC_DIR "Skip download of deps sources in case of existing source directory." OFF)
-if(WIN32)
- find_package(Git)
- if(NOT Git_FOUND)
- message(FATAL_ERROR "Git is required to apply patches for Windows.")
- endif()
+find_package(Git)
+if(NOT Git_FOUND)
+ message(FATAL_ERROR "Git is required to apply patches to bundled dependencies")
endif()
if(UNIX)
diff --git a/third-party/cmake/BuildLuarocks.cmake b/third-party/cmake/BuildLuarocks.cmake
index 47c6412d86..2b85e3fd82 100644
--- a/third-party/cmake/BuildLuarocks.cmake
+++ b/third-party/cmake/BuildLuarocks.cmake
@@ -70,6 +70,10 @@ if(UNIX OR (MINGW AND CMAKE_CROSSCOMPILING))
endif()
BuildLuarocks(
+ PATCH_COMMAND
+ ${GIT_EXECUTABLE} -C ${DEPS_BUILD_DIR}/src/luarocks init
+ COMMAND ${GIT_EXECUTABLE} -C ${DEPS_BUILD_DIR}/src/luarocks apply
+ ${CMAKE_CURRENT_SOURCE_DIR}/patches/luarocks-Fix-siteconfig.patch
CONFIGURE_COMMAND ${DEPS_BUILD_DIR}/src/luarocks/configure
--prefix=${HOSTDEPS_INSTALL_DIR} --force-config ${LUAROCKS_OPTS}
INSTALL_COMMAND ${MAKE_PRG} bootstrap)
diff --git a/third-party/patches/luarocks-Fix-siteconfig.patch b/third-party/patches/luarocks-Fix-siteconfig.patch
new file mode 100644
index 0000000000..fbc9e664d2
--- /dev/null
+++ b/third-party/patches/luarocks-Fix-siteconfig.patch
@@ -0,0 +1,28 @@
+From dad6687372b1568f1543388d5014190a076e388a Mon Sep 17 00:00:00 2001
+Date: Thu, 8 Mar 2018 22:50:52 +0100
+Subject: [PATCH] Fix site_config
+
+---
+ src/luarocks/cfg.lua | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua
+index 1d5c9872e205..aa34a4f9748b 100644
+--- a/src/luarocks/cfg.lua
++++ b/src/luarocks/cfg.lua
+@@ -23,10 +23,10 @@ local version_suffix = cfg.lua_version:gsub("%.", "_")
+
+ -- Load site-local global configurations
+ local ok, site_config = pcall(require, "luarocks.site_config_"..version_suffix)
+-if not ok then
++if not ok or type(site_config) ~= "table" then
+ ok, site_config = pcall(require, "luarocks.site_config")
+ end
+-if not ok then
++if not ok or type(site_config) ~= "table" then
+ io.stderr:write("Site-local luarocks/site_config.lua file not found. Incomplete installation?\n")
+ site_config = {}
+ end
+--
+2.7.4
+