diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2010-11-08 14:59:10 -0200 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2010-11-08 14:59:10 -0200 |
commit | 59423a667bdc69d97185886348188db6eb65ae68 (patch) | |
tree | 7dfcbc39a2a9baab78b68f28d6da9315eff3e492 | |
parent | 6ecf9ab8ee490cc562cdd199f1533a4cf3f1b918 (diff) | |
download | luarocks-59423a667bdc69d97185886348188db6eb65ae68.tar.gz luarocks-59423a667bdc69d97185886348188db6eb65ae68.tar.bz2 luarocks-59423a667bdc69d97185886348188db6eb65ae68.zip |
Match "*" wildcard so that numbered libraries can be found,
when using the cross-platform format in the libraries field from external_dependencies.
-rw-r--r-- | src/luarocks/cfg.lua | 4 | ||||
-rw-r--r-- | src/luarocks/deps.lua | 15 |
2 files changed, 14 insertions, 5 deletions
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua index d141bdee..0d991849 100644 --- a/src/luarocks/cfg.lua +++ b/src/luarocks/cfg.lua | |||
@@ -239,12 +239,12 @@ if detected.unix then | |||
239 | defaults.variables.LIBFLAG = "-shared" | 239 | defaults.variables.LIBFLAG = "-shared" |
240 | defaults.external_deps_patterns = { | 240 | defaults.external_deps_patterns = { |
241 | bin = { "?" }, | 241 | bin = { "?" }, |
242 | lib = { "lib?.a", "lib?.so" }, | 242 | lib = { "lib?.a", "lib?.so", "lib?.so.*" }, |
243 | include = { "?.h" } | 243 | include = { "?.h" } |
244 | } | 244 | } |
245 | defaults.runtime_external_deps_patterns = { | 245 | defaults.runtime_external_deps_patterns = { |
246 | bin = { "?" }, | 246 | bin = { "?" }, |
247 | lib = { "lib?.so" }, | 247 | lib = { "lib?.so", "lib?.so.*" }, |
248 | include = { "?.h" } | 248 | include = { "?.h" } |
249 | } | 249 | } |
250 | defaults.local_cache = home.."/.cache/luarocks" | 250 | defaults.local_cache = home.."/.cache/luarocks" |
diff --git a/src/luarocks/deps.lua b/src/luarocks/deps.lua index b10594a3..4f16c2a6 100644 --- a/src/luarocks/deps.lua +++ b/src/luarocks/deps.lua | |||
@@ -543,9 +543,18 @@ function check_external_deps(rockspec, mode) | |||
543 | if f:match("%.so$") or f:match("%.dylib$") or f:match("%.dll$") then | 543 | if f:match("%.so$") or f:match("%.dylib$") or f:match("%.dll$") then |
544 | f = f:gsub("%.[^.]+$", "."..cfg.external_lib_extension) | 544 | f = f:gsub("%.[^.]+$", "."..cfg.external_lib_extension) |
545 | end | 545 | end |
546 | local testfile = dir.path(dirdata.dir, f) | 546 | if f:match("%*") then |
547 | if fs.exists(testfile) then | 547 | local replaced = f:gsub("%.", "%%."):gsub("%*", ".*") |
548 | found = true | 548 | for _, entry in ipairs(fs.list_dir(dirdata.dir)) do |
549 | if entry:match(replaced) then | ||
550 | found = true | ||
551 | break | ||
552 | end | ||
553 | end | ||
554 | else | ||
555 | found = fs.exists(dir.path(dirdata.dir, f)) | ||
556 | end | ||
557 | if found then | ||
549 | break | 558 | break |
550 | else | 559 | else |
551 | if failed_file then | 560 | if failed_file then |