aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rwxr-xr-xconfigure10
-rw-r--r--src/luarocks/cfg.lua17
-rw-r--r--src/luarocks/deps.lua36
4 files changed, 51 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index 16c9d4fc..6e7bee03 100644
--- a/Makefile
+++ b/Makefile
@@ -80,9 +80,9 @@ src/luarocks/site_config.lua: config.unix
80 echo "LUAROCKS_UNAME_M=[[$(LUAROCKS_UNAME_M)]]" >> src/luarocks/site_config.lua 80 echo "LUAROCKS_UNAME_M=[[$(LUAROCKS_UNAME_M)]]" >> src/luarocks/site_config.lua
81 echo "LUAROCKS_DOWNLOADER=[[$(LUAROCKS_DOWNLOADER)]]" >> src/luarocks/site_config.lua 81 echo "LUAROCKS_DOWNLOADER=[[$(LUAROCKS_DOWNLOADER)]]" >> src/luarocks/site_config.lua
82 echo "LUAROCKS_MD5CHECKER=[[$(LUAROCKS_MD5CHECKER)]]" >> src/luarocks/site_config.lua 82 echo "LUAROCKS_MD5CHECKER=[[$(LUAROCKS_MD5CHECKER)]]" >> src/luarocks/site_config.lua
83 if [ -n "$(LUAROCKS_MULTIARCHDIR)" ] ;\ 83 if [ -n "$(MULTIARCH_SUBDIR)" ] ;\
84 then \ 84 then \
85 echo "LUAROCKS_MULTIARCHDIR=[[$(LUAROCKS_MULTIARCHDIR)]]" >> src/luarocks/site_config.lua ;\ 85 echo "LUAROCKS_ADD_LIB_SUBDIRS={ [[$(MULTIARCH_SUBDIR)]] }" >> src/luarocks/site_config.lua ;\
86 fi 86 fi
87 87
88dev: 88dev:
diff --git a/configure b/configure
index ee1106dd..0e64fb55 100755
--- a/configure
+++ b/configure
@@ -14,7 +14,7 @@ LUA_BINDIR="/usr/bin"
14LUA_INCDIR="/usr/include" 14LUA_INCDIR="/usr/include"
15LUA_LIBDIR="/usr/lib" 15LUA_LIBDIR="/usr/lib"
16LUA_VERSION="5.1" 16LUA_VERSION="5.1"
17MULTIARCHDIR="" 17MULTIARCH_SUBDIR=""
18 18
19# ---------------------------------------------------------------------------- 19# ----------------------------------------------------------------------------
20# FUNCTION DEFINITIONS 20# FUNCTION DEFINITIONS
@@ -399,10 +399,10 @@ fi
399 399
400if [ "$LUAROCKS_UNAME_S" = Linux ] 400if [ "$LUAROCKS_UNAME_S" = Linux ]
401then 401then
402 CC_ARCH=`cc -dumpmachine 2>/dev/null` 402 GCC_ARCH=`gcc -dumpspecs 2>/dev/null | grep -A 1 "^*multilib:$" | tail -1 | cut -d: -f3 | cut -d' ' -f1`
403 if [ -n "$CC_ARCH" ] 403 if [ -n "$GCC_ARCH" -a -d "/usr/lib/$GCC_ARCH" ]
404 then 404 then
405 MULTIARCHDIR="/usr/lib/$CC_ARCH" 405 MULTIARCH_SUBDIR="lib/$GCC_ARCH"
406 fi 406 fi
407fi 407fi
408 408
@@ -436,7 +436,7 @@ LUAROCKS_UNAME_S=$LUAROCKS_UNAME_S
436LUAROCKS_DOWNLOADER=$LUAROCKS_DOWNLOADER 436LUAROCKS_DOWNLOADER=$LUAROCKS_DOWNLOADER
437LUAROCKS_MD5CHECKER=$LUAROCKS_MD5CHECKER 437LUAROCKS_MD5CHECKER=$LUAROCKS_MD5CHECKER
438LUAROCKS_ROCKS_SUBDIR=$LUAROCKS_ROCKS_SUBDIR 438LUAROCKS_ROCKS_SUBDIR=$LUAROCKS_ROCKS_SUBDIR
439LUAROCKS_MULTIARCHDIR=$MULTIARCHDIR 439MULTIARCH_SUBDIR=$MULTIARCH_SUBDIR
440 440
441EOF 441EOF
442 442
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua
index 8e26bb46..9227db4b 100644
--- a/src/luarocks/cfg.lua
+++ b/src/luarocks/cfg.lua
@@ -437,6 +437,23 @@ if detected.solaris then
437 defaults.variables.MAKE = "gmake" 437 defaults.variables.MAKE = "gmake"
438end 438end
439 439
440if type(site_config.LUAROCKS_ADD_LIB_SUBDIRS) == "table" and next(site_config.LUAROCKS_ADD_LIB_SUBDIRS) ~= nil then
441 local lib = defaults.external_deps_subdirs.lib
442 if type(lib) ~= "table" then
443 lib = { lib }
444 end
445 local rt_lib = defaults.runtime_external_deps_subdirs.lib
446 if type(rt_lib) ~= "table" then
447 rt_lib = { rt_lib }
448 end
449 for i,v in ipairs(site_config.LUAROCKS_ADD_LIB_SUBDIRS) do
450 lib[#lib+1] = v
451 rt_lib[#rt_lib+1] = v
452 end
453 defaults.external_deps_subdirs.lib = lib
454 defaults.runtime_external_deps_subdirs.lib = rt_lib
455end
456
440-- Expose some more values detected by LuaRocks for use by rockspec authors. 457-- Expose some more values detected by LuaRocks for use by rockspec authors.
441defaults.variables.LIB_EXTENSION = defaults.lib_extension 458defaults.variables.LIB_EXTENSION = defaults.lib_extension
442defaults.variables.OBJ_EXTENSION = defaults.obj_extension 459defaults.variables.OBJ_EXTENSION = defaults.obj_extension
diff --git a/src/luarocks/deps.lua b/src/luarocks/deps.lua
index f24dc507..7f3b44f2 100644
--- a/src/luarocks/deps.lua
+++ b/src/luarocks/deps.lua
@@ -583,7 +583,19 @@ function check_external_deps(rockspec, mode)
583 prefix = prefix.prefix 583 prefix = prefix.prefix
584 end 584 end
585 for dirname, dirdata in pairs(dirs) do 585 for dirname, dirdata in pairs(dirs) do
586 dirdata.dir = vars[name.."_"..dirname] or dir.path(prefix, dirdata.subdir) 586 local paths
587 local path_var_value = vars[name.."_"..dirname]
588 if path_var_value then
589 paths = { path_var_value }
590 elseif type(dirdata.subdir) == "table" then
591 paths = {}
592 for i,v in ipairs(dirdata.subdir) do
593 paths[i] = dir.path(prefix, v)
594 end
595 else
596 paths = { dir.path(prefix, dirdata.subdir) }
597 end
598 dirdata.dir = paths[1]
587 local file = files[dirdata.testfile] 599 local file = files[dirdata.testfile]
588 if file then 600 if file then
589 local files = {} 601 local files = {}
@@ -605,16 +617,22 @@ function check_external_deps(rockspec, mode)
605 if f:match("%.so$") or f:match("%.dylib$") or f:match("%.dll$") then 617 if f:match("%.so$") or f:match("%.dylib$") or f:match("%.dll$") then
606 f = f:gsub("%.[^.]+$", "."..cfg.external_lib_extension) 618 f = f:gsub("%.[^.]+$", "."..cfg.external_lib_extension)
607 end 619 end
608 if f:match("%*") then 620 for _, d in ipairs(paths) do
609 local replaced = f:gsub("%.", "%%."):gsub("%*", ".*") 621 if f:match("%*") then
610 for _, entry in ipairs(fs.list_dir(dirdata.dir)) do 622 local replaced = f:gsub("%.", "%%."):gsub("%*", ".*")
611 if entry:match(replaced) then 623 for _, entry in ipairs(fs.list_dir(d)) do
612 found = true 624 if entry:match(replaced) then
613 break 625 found = true
626 break
627 end
614 end 628 end
629 else
630 found = fs.is_file(dir.path(d, f))
631 end
632 if found then
633 dirdata.dir = d
634 break
615 end 635 end
616 else
617 found = fs.is_file(dir.path(dirdata.dir, f))
618 end 636 end
619 if found then 637 if found then
620 break 638 break