mirror of https://git.wownero.com/dsc/mxe.git
Merge branch 'build-pkg-dlls-and-empty' of https://github.com/LuaAndC/mxe into LuaAndC-build-pkg-dlls-and-empty
This commit is contained in:
commit
8fd14ebfb6
|
@ -43,7 +43,7 @@ local GIT = 'git --work-tree=./usr/ --git-dir=./usr/.git '
|
||||||
|
|
||||||
local BLACKLIST = {
|
local BLACKLIST = {
|
||||||
'^usr/installed/check%-requirements$',
|
'^usr/installed/check%-requirements$',
|
||||||
-- usr/share/cmake if useful
|
-- usr/share/cmake is useful
|
||||||
'^usr/share/doc/',
|
'^usr/share/doc/',
|
||||||
'^usr/share/info/',
|
'^usr/share/info/',
|
||||||
'^usr/share/man/',
|
'^usr/share/man/',
|
||||||
|
@ -117,6 +117,16 @@ local function sliceArray(list, nelements)
|
||||||
return new_list
|
return new_list
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function concatArrays(...)
|
||||||
|
local result = {}
|
||||||
|
for _, array in ipairs({...}) do
|
||||||
|
for _, elem in ipairs(array) do
|
||||||
|
table.insert(result, elem)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
local function isInString(substring, string)
|
local function isInString(substring, string)
|
||||||
return string:find(substring, 1, true)
|
return string:find(substring, 1, true)
|
||||||
end
|
end
|
||||||
|
@ -357,6 +367,26 @@ local function checkFile(file, item)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function checkFileList(files, item)
|
||||||
|
local target, _ = parseItem(item)
|
||||||
|
if target:match('shared') then
|
||||||
|
local has_a, has_dll
|
||||||
|
for _, file in ipairs(files) do
|
||||||
|
file = file:lower()
|
||||||
|
if file:match('%.a') then
|
||||||
|
has_a = true
|
||||||
|
end
|
||||||
|
if file:match('%.dll') then
|
||||||
|
has_dll = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if has_a and not has_dll then
|
||||||
|
log('Shared item %s installs .a file ' ..
|
||||||
|
'but no .dll', item)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- builds package, returns list of new files
|
-- builds package, returns list of new files
|
||||||
local function buildItem(item, item2deps, file2item)
|
local function buildItem(item, item2deps, file2item)
|
||||||
local target, pkg = parseItem(item)
|
local target, pkg = parseItem(item)
|
||||||
|
@ -379,6 +409,7 @@ local function buildItem(item, item2deps, file2item)
|
||||||
log('Item %s changes %s, created by %s',
|
log('Item %s changes %s, created by %s',
|
||||||
item, file, creator_item)
|
item, file, creator_item)
|
||||||
end
|
end
|
||||||
|
checkFileList(concatArrays(new_files, changed_files), item)
|
||||||
return new_files
|
return new_files
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -549,6 +580,10 @@ local function progressPrinter(items)
|
||||||
return printer
|
return printer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function isEmpty(item, files)
|
||||||
|
return #files == 1
|
||||||
|
end
|
||||||
|
|
||||||
-- build all packages, save filelist to list file
|
-- build all packages, save filelist to list file
|
||||||
local function buildPackages(items, item2deps)
|
local function buildPackages(items, item2deps)
|
||||||
local broken = {}
|
local broken = {}
|
||||||
|
@ -591,9 +626,18 @@ local function makeDebs(items, item2deps, item2ver, item2files)
|
||||||
local deps = assert(item2deps[item], item)
|
local deps = assert(item2deps[item], item)
|
||||||
local ver = assert(item2ver[item], item)
|
local ver = assert(item2ver[item], item)
|
||||||
local files = assert(item2files[item], item)
|
local files = assert(item2files[item], item)
|
||||||
|
if not isEmpty(item, files) then
|
||||||
|
for _, dep in ipairs(deps) do
|
||||||
|
local dep_files = assert(item2files[dep], dep)
|
||||||
|
if isEmpty(dep, dep_files) then
|
||||||
|
log('Non-empty item %s depends on ' ..
|
||||||
|
'empty item %s', item, dep)
|
||||||
|
end
|
||||||
|
end
|
||||||
makeDeb(item, files, deps, ver)
|
makeDeb(item, files, deps, ver)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function getMxeVersion()
|
local function getMxeVersion()
|
||||||
local index_html = io.open 'index.html'
|
local index_html = io.open 'index.html'
|
||||||
|
|
Loading…
Reference in New Issue