From 59423a667bdc69d97185886348188db6eb65ae68 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Mon, 8 Nov 2010 14:59:10 -0200 Subject: Match "*" wildcard so that numbered libraries can be found, when using the cross-platform format in the libraries field from external_dependencies. --- src/luarocks/cfg.lua | 4 ++-- 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 defaults.variables.LIBFLAG = "-shared" defaults.external_deps_patterns = { bin = { "?" }, - lib = { "lib?.a", "lib?.so" }, + lib = { "lib?.a", "lib?.so", "lib?.so.*" }, include = { "?.h" } } defaults.runtime_external_deps_patterns = { bin = { "?" }, - lib = { "lib?.so" }, + lib = { "lib?.so", "lib?.so.*" }, include = { "?.h" } } 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) if f:match("%.so$") or f:match("%.dylib$") or f:match("%.dll$") then f = f:gsub("%.[^.]+$", "."..cfg.external_lib_extension) end - local testfile = dir.path(dirdata.dir, f) - if fs.exists(testfile) then - found = true + if f:match("%*") then + local replaced = f:gsub("%.", "%%."):gsub("%*", ".*") + for _, entry in ipairs(fs.list_dir(dirdata.dir)) do + if entry:match(replaced) then + found = true + break + end + end + else + found = fs.exists(dir.path(dirdata.dir, f)) + end + if found then break else if failed_file then -- cgit v1.2.3-55-g6feb