diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2011-08-09 01:16:57 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2011-08-09 01:16:57 -0300 |
| commit | ce34a1b875f219086dcf950c8af1a149691e30eb (patch) | |
| tree | 6921c9551b98ac0ad5cc09a098c0b478ef94d37f | |
| parent | 66c852785b3dc9bc05480619e25b510b0fd4c2f4 (diff) | |
| parent | 9874d3e9203ded0d7ff97df0e2f2e99ec5dc50f2 (diff) | |
| download | luarocks-ce34a1b875f219086dcf950c8af1a149691e30eb.tar.gz luarocks-ce34a1b875f219086dcf950c8af1a149691e30eb.tar.bz2 luarocks-ce34a1b875f219086dcf950c8af1a149691e30eb.zip | |
Merge branch 'master' of github.com:keplerproject/luarocks
| -rw-r--r-- | src/luarocks/deps.lua | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/src/luarocks/deps.lua b/src/luarocks/deps.lua index 31018216..26c43047 100644 --- a/src/luarocks/deps.lua +++ b/src/luarocks/deps.lua | |||
| @@ -506,14 +506,6 @@ function check_external_deps(rockspec, mode) | |||
| 506 | patterns = cfg.runtime_external_deps_patterns | 506 | patterns = cfg.runtime_external_deps_patterns |
| 507 | subdirs = cfg.runtime_external_deps_subdirs | 507 | subdirs = cfg.runtime_external_deps_subdirs |
| 508 | end | 508 | end |
| 509 | local dirs = { | ||
| 510 | BINDIR = { subdir = subdirs.bin, testfile = "program", pattern = patterns.bin }, | ||
| 511 | INCDIR = { subdir = subdirs.include, testfile = "header", pattern = patterns.include }, | ||
| 512 | LIBDIR = { subdir = subdirs.lib, testfile = "library", pattern = patterns.lib } | ||
| 513 | } | ||
| 514 | if mode == "install" then | ||
| 515 | dirs.INCDIR = nil | ||
| 516 | end | ||
| 517 | if rockspec.external_dependencies then | 509 | if rockspec.external_dependencies then |
| 518 | for name, files in pairs(rockspec.external_dependencies) do | 510 | for name, files in pairs(rockspec.external_dependencies) do |
| 519 | local ok = true | 511 | local ok = true |
| @@ -522,9 +514,31 @@ function check_external_deps(rockspec, mode) | |||
| 522 | for _, extdir in ipairs(cfg.external_deps_dirs) do | 514 | for _, extdir in ipairs(cfg.external_deps_dirs) do |
| 523 | ok = true | 515 | ok = true |
| 524 | local prefix = vars[name.."_DIR"] | 516 | local prefix = vars[name.."_DIR"] |
| 517 | local dirs = { | ||
| 518 | BINDIR = { subdir = subdirs.bin, testfile = "program", pattern = patterns.bin }, | ||
| 519 | INCDIR = { subdir = subdirs.include, testfile = "header", pattern = patterns.include }, | ||
| 520 | LIBDIR = { subdir = subdirs.lib, testfile = "library", pattern = patterns.lib } | ||
| 521 | } | ||
| 522 | if mode == "install" then | ||
| 523 | dirs.INCDIR = nil | ||
| 524 | end | ||
| 525 | if not prefix then | 525 | if not prefix then |
| 526 | prefix = extdir | 526 | prefix = extdir |
| 527 | end | 527 | end |
| 528 | if type(prefix) == "table" then | ||
| 529 | if prefix.bin then | ||
| 530 | dirs.BINDIR.subdir = prefix.bin | ||
| 531 | end | ||
| 532 | if prefix.include then | ||
| 533 | if dirs.INCDIR then | ||
| 534 | dirs.INCDIR.subdir = prefix.include | ||
| 535 | end | ||
| 536 | end | ||
| 537 | if prefix.lib then | ||
| 538 | dirs.LIBDIR.subdir = prefix.lib | ||
| 539 | end | ||
| 540 | prefix = prefix.prefix | ||
| 541 | end | ||
| 528 | for dirname, dirdata in pairs(dirs) do | 542 | for dirname, dirdata in pairs(dirs) do |
| 529 | dirdata.dir = vars[name.."_"..dirname] or dir.path(prefix, dirdata.subdir) | 543 | dirdata.dir = vars[name.."_"..dirname] or dir.path(prefix, dirdata.subdir) |
| 530 | local file = files[dirdata.testfile] | 544 | local file = files[dirdata.testfile] |
