fix boost fetch (#5816)

* fix boost fetch

* fix filepath
pull/5818/head
ruki 5 days ago committed by GitHub
parent ff961fffbc
commit 3f46507d43
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 32
      packages/b/boost/fetch.lua

@ -21,11 +21,14 @@ function _get_python_libs()
end end
function _add_info(linkinfo, result) function _add_info(linkinfo, result)
if linkinfo then table.insert(result.linkdirs, linkinfo.linkdir)
table.insert(result.linkdirs, linkinfo.linkdir) if linkinfo.filename then
table.insert(result.libfiles, linkinfo.filename) local filepath = path.join(linkinfo.linkdir, linkinfo.filename)
table.insert(result.links, linkinfo.link) if os.isfile(filepath) then
table.insert(result.libfiles, filepath)
end
end end
table.insert(result.links, linkinfo.link)
end end
function main(package, opt) function main(package, opt)
@ -38,7 +41,7 @@ function main(package, opt)
"/usr/local/lib", "/usr/local/lib",
"/usr/lib/x86_64-linux-gnu", "/usr/lib/x86_64-linux-gnu",
} }
local result = { local result = {
libfiles = {}, libfiles = {},
linkdirs = {}, linkdirs = {},
@ -51,23 +54,32 @@ function main(package, opt)
} }
local sub_libs_map = libs.get_sub_libs(package) local sub_libs_map = libs.get_sub_libs(package)
sub_libs_map["python"] = _get_python_libs() sub_libs_map.python = _get_python_libs()
table.insert(sub_libs_map.test, "test_exec_monitor") table.insert(sub_libs_map.test, "test_exec_monitor")
local found
libs.for_each(function (libname) libs.for_each(function (libname)
local sub_libs = sub_libs_map[libname] local sub_libs = sub_libs_map[libname]
if sub_libs then if sub_libs then
for _, sub_libname in ipairs(sub_libs) do for _, sub_libname in ipairs(sub_libs) do
local linkinfo = find_library("boost_" .. sub_libname, paths, opt) local linkinfo = find_library("boost_" .. sub_libname, paths, opt)
_add_info(linkinfo, result) if linkinfo then
_add_info(linkinfo, result)
found = true
end
end end
else else
local linkinfo = find_library("boost_" .. libname, paths, opt) local linkinfo = find_library("boost_" .. libname, paths, opt)
_add_info(linkinfo, result) if linkinfo then
_add_info(linkinfo, result)
found = true
end
end end
end) end)
result.linkdirs = table.unique(result.linkdirs) if found then
return result result.linkdirs = table.unique(result.linkdirs)
return result
end
end end
end end

Loading…
Cancel
Save