Merge pull request #1383 from LuaAndC/build-pkg-set-target

build-pkg: add env. var to change target
This commit is contained in:
Tony Theodore 2016-06-13 21:22:00 +10:00 committed by GitHub
commit 39f1107dbd
1 changed files with 19 additions and 6 deletions

View File

@ -16,14 +16,20 @@ Build in directory /usr/lib/mxe
This directory can not be changed in .deb packages.
To prevent build-pkg from creating deb packages,
set environment variable MXE_NO_DEBS to 1
set environment variable MXE_BUILD_PKG_NO_DEBS to 1
In this case fakeroot and dpkg-deb are not needed.
To switch off the second pass, set MXE_NO_SECOND_PASS to 1.
To switch off the second pass, set
MXE_BUILD_PKG_NO_SECOND_PASS to 1.
See https://github.com/mxe/mxe/issues/1111
To limit number of packages being built to x,
set environment variable MXE_MAX_ITEMS to x,
set environment variable MXE_BUILD_PKG_MAX_ITEMS to x.
To set list of MXE targets to build,
set environment variable MXE_BUILD_PKG_TARGETS to
the list of targets separated by space.
By default, all 4 major targets are built.
The following error:
> fakeroot, while creating message channels: Invalid argument
@ -33,9 +39,10 @@ can be caused by leaked ipc resources originating in fakeroot.
How to remove them: http://stackoverflow.com/a/4262545
]]
local max_items = tonumber(os.getenv('MXE_MAX_ITEMS'))
local no_debs = os.getenv('MXE_NO_DEBS')
local no_second_pass = os.getenv('MXE_NO_SECOND_PASS')
local max_items = tonumber(os.getenv('MXE_BUILD_PKG_MAX_ITEMS'))
local no_debs = os.getenv('MXE_BUILD_PKG_NO_DEBS')
local no_second_pass = os.getenv('MXE_BUILD_PKG_NO_SECOND_PASS')
local build_targets = os.getenv('MXE_BUILD_PKG_TARGETS')
local TODAY = os.date("%Y%m%d")
@ -63,6 +70,12 @@ local TARGETS = {
'i686-w64-mingw32.shared',
'x86_64-w64-mingw32.shared',
}
if build_targets then
TARGETS = {}
for target in build_targets:gmatch('(%S+)') do
table.insert(TARGETS, target)
end
end
local function echo(fmt, ...)
print(fmt:format(...))