mirror of https://git.wownero.com/dsc/mxe.git
build-pkg changes
This commit is contained in:
parent
ad3bd81b96
commit
3ea682b14e
4
Makefile
4
Makefile
|
@ -705,7 +705,7 @@ $(PREFIX)/$(3)/installed/$(1): $(PKG_MAKEFILES) \
|
||||||
$(if $(BUILD_DRY_RUN)$(MXE_BUILD_DRY_RUN), \
|
$(if $(BUILD_DRY_RUN)$(MXE_BUILD_DRY_RUN), \
|
||||||
@$(PRINTF_FMT) '[dry-run]' '$(1)' '$(3)' | $(RTRIM)
|
@$(PRINTF_FMT) '[dry-run]' '$(1)' '$(3)' | $(RTRIM)
|
||||||
@[ -d '$(PREFIX)/$(3)/lib' ] || mkdir -p '$(PREFIX)/$(3)/lib'
|
@[ -d '$(PREFIX)/$(3)/lib' ] || mkdir -p '$(PREFIX)/$(3)/lib'
|
||||||
@touch '$(PREFIX)/$(3)/lib/$(1).dry-run'
|
@echo $(1)~$(3) > '$(PREFIX)/$(3)/lib/$(1).dry-run'
|
||||||
@touch '$(PREFIX)/$(3)/installed/$(1)'
|
@touch '$(PREFIX)/$(3)/installed/$(1)'
|
||||||
$(else),
|
$(else),
|
||||||
@$(PRINTF_FMT) '[build]' '$(1)' '$(3)' | $(RTRIM)
|
@$(PRINTF_FMT) '[build]' '$(1)' '$(3)' | $(RTRIM)
|
||||||
|
@ -907,7 +907,7 @@ print-deps-for-build-pkg:
|
||||||
$(if $(or $(value $(call LOOKUP_PKG_RULE,$(PKG),BUILD,$(TARGET))), \
|
$(if $(or $(value $(call LOOKUP_PKG_RULE,$(PKG),BUILD,$(TARGET))), \
|
||||||
$(filter $($(PKG)_TYPE),$(BUILD_PKG_TYPES))), \
|
$(filter $($(PKG)_TYPE),$(BUILD_PKG_TYPES))), \
|
||||||
$(info $(strip for-build-pkg $(TARGET)~$(PKG) \
|
$(info $(strip for-build-pkg $(TARGET)~$(PKG) \
|
||||||
$(subst $(space),-,$($(PKG)_VERSION)) \
|
$(subst $(space),-,$($(PKG)_VERSION)-$(OS_SHORT_NAME)) \
|
||||||
$(subst /installed/,~,$(PKG_DEPS) $(PKG_OO_DEPS)))))))
|
$(subst /installed/,~,$(PKG_DEPS) $(PKG_OO_DEPS)))))))
|
||||||
@echo -n
|
@echo -n
|
||||||
|
|
||||||
|
|
|
@ -52,20 +52,23 @@ How to remove them: https://stackoverflow.com/a/4262545
|
||||||
Alternatively, to switch off using fakeroot (e.g. inside docker),
|
Alternatively, to switch off using fakeroot (e.g. inside docker),
|
||||||
set MXE_BUILD_PKG_NO_FAKEROOT to 1.
|
set MXE_BUILD_PKG_NO_FAKEROOT to 1.
|
||||||
|
|
||||||
Bootstrapped build (non-debian systems building w/o deb pkgs):
|
Bootstrapped build (non-debian systems building without
|
||||||
export MXE_DIR=/path/to/mxe && \
|
deb pkgs to test print-deps-for-build-pkg, control files etc.):
|
||||||
|
|
||||||
|
export MXE_DIR=`pwd` && \
|
||||||
export BUILD=`$MXE_DIR/ext/config.guess` && \
|
export BUILD=`$MXE_DIR/ext/config.guess` && \
|
||||||
rm -rf $MXE_DIR/usr* && \
|
rm -rf $MXE_DIR/usr $MXE_DIR/log $MXE_DIR/mxe-* && \
|
||||||
make -C $MXE_DIR lua \
|
make -C $MXE_DIR lua \
|
||||||
MXE_TARGETS=$BUILD \
|
MXE_TARGETS=$BUILD \
|
||||||
lua_TARGETS=$BUILD \
|
lua_TARGETS=$BUILD \
|
||||||
PREFIX=$MXE_DIR/usr.lua && \
|
PREFIX=$MXE_DIR/usr.lua && \
|
||||||
MXE_BUILD_PKG_TARGETS="`echo {i686-w64-mingw32,x86_64-w64-mingw32}.{static,shared}`" \
|
MXE_BUILD_PKG_CODENAME=trusty \
|
||||||
MXE_BUILD_PKG_PKGS= \
|
MXE_BUILD_PKG_TARGETS="i686-w64-mingw32.static" \
|
||||||
|
MXE_BUILD_PKG_PKGS=qt5 \
|
||||||
MXE_BUILD_DRY_RUN=1 \
|
MXE_BUILD_DRY_RUN=1 \
|
||||||
MXE_BUILD_PKG_MAX_ITEMS= \
|
MXE_BUILD_PKG_MAX_ITEMS= \
|
||||||
MXE_BUILD_PKG_NO_DEBS=1 \
|
MXE_BUILD_PKG_NO_DEBS=1 \
|
||||||
MXE_BUILD_PKG_NO_SECOND_PASS=0 \
|
MXE_BUILD_PKG_NO_SECOND_PASS=1 \
|
||||||
$MXE_DIR/usr.lua/$BUILD/bin/lua $MXE_DIR/tools/build-pkg.lua
|
$MXE_DIR/usr.lua/$BUILD/bin/lua $MXE_DIR/tools/build-pkg.lua
|
||||||
]]
|
]]
|
||||||
|
|
||||||
|
@ -870,7 +873,7 @@ end
|
||||||
local D1 = "MXE package %s for %s"
|
local D1 = "MXE package %s for %s"
|
||||||
local D2 = "This package contains the files for MXE package %s"
|
local D2 = "This package contains the files for MXE package %s"
|
||||||
|
|
||||||
local function makeDeb(item, files, deps, ver)
|
local function makeDeb(item, files, deps, ver, codename)
|
||||||
local target, pkg = parseItem(item)
|
local target, pkg = parseItem(item)
|
||||||
local deb_pkg = nameToDebian(item)
|
local deb_pkg = nameToDebian(item)
|
||||||
local d1 = D1:format(pkg, target)
|
local d1 = D1:format(pkg, target)
|
||||||
|
@ -879,7 +882,7 @@ local function makeDeb(item, files, deps, ver)
|
||||||
for _, dep in ipairs(deps) do
|
for _, dep in ipairs(deps) do
|
||||||
table.insert(deb_deps, nameToDebian(dep))
|
table.insert(deb_deps, nameToDebian(dep))
|
||||||
end
|
end
|
||||||
makePackage(deb_pkg, files, deb_deps, ver, d1, d2)
|
makePackage(deb_pkg, files, deb_deps, ver, d1, d2, codename)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function findForeignInstalls(item, files)
|
local function findForeignInstalls(item, files)
|
||||||
|
@ -1001,12 +1004,12 @@ local function buildPackages(items, item2deps, pass, prev_item2files)
|
||||||
return unbroken, item2files
|
return unbroken, item2files
|
||||||
end
|
end
|
||||||
|
|
||||||
local function makeDebs(items, item2deps, item2ver, item2files)
|
local function makeDebs(items, item2deps, item2ver, item2files, codename)
|
||||||
for _, item in ipairs(items) do
|
for _, item in ipairs(items) do
|
||||||
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)
|
||||||
makeDeb(item, files, deps, ver)
|
makeDeb(item, files, deps, ver, codename)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1022,9 +1025,8 @@ local MXE_REQUIREMENTS_DESCRIPTION2 =
|
||||||
Other MXE packages depend on this package.]]
|
Other MXE packages depend on this package.]]
|
||||||
|
|
||||||
local function makeMxeRequirementsPackage(release)
|
local function makeMxeRequirementsPackage(release)
|
||||||
os.execute(('mkdir -p %s'):format(release))
|
|
||||||
local name = 'mxe-requirements'
|
local name = 'mxe-requirements'
|
||||||
local ver = getMxeVersion() .. release
|
local ver = getMxeVersion() .. '-' .. release
|
||||||
-- MXE build requirements should not be strict dependencies here
|
-- MXE build requirements should not be strict dependencies here
|
||||||
-- See https://github.com/mxe/mxe/issues/1537
|
-- See https://github.com/mxe/mxe/issues/1537
|
||||||
local deps = {}
|
local deps = {}
|
||||||
|
@ -1057,9 +1059,9 @@ local MXE_SOURCE_DESCRIPTION2 =
|
||||||
[[This package contains MXE source files.
|
[[This package contains MXE source files.
|
||||||
Other MXE packages depend on this package.]]
|
Other MXE packages depend on this package.]]
|
||||||
|
|
||||||
local function makeMxeSourcePackage()
|
local function makeMxeSourcePackage(codename)
|
||||||
local name = 'mxe-source'
|
local name = 'mxe-source'
|
||||||
local ver = getMxeVersion()
|
local ver = getMxeVersion() .. '-' .. codename
|
||||||
-- dependencies
|
-- dependencies
|
||||||
local deps = {}
|
local deps = {}
|
||||||
local files = {
|
local files = {
|
||||||
|
@ -1077,7 +1079,7 @@ local function makeMxeSourcePackage()
|
||||||
}
|
}
|
||||||
local d1 = "MXE source"
|
local d1 = "MXE source"
|
||||||
local d2 = MXE_SOURCE_DESCRIPTION2
|
local d2 = MXE_SOURCE_DESCRIPTION2
|
||||||
makePackage(name, files, deps, ver, d1, d2)
|
makePackage(name, files, deps, ver, d1, d2, codename)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function downloadPackages()
|
local function downloadPackages()
|
||||||
|
@ -1094,7 +1096,12 @@ local function downloadPackages()
|
||||||
error('downloading failed')
|
error('downloading failed')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local function main()
|
local function main()
|
||||||
|
local codename = os.getenv('MXE_BUILD_PKG_CODENAME')
|
||||||
|
or trim(shell('(lsb_release -sc 2>/dev/null || uname -s) | tr [:upper:] [:lower:]'))
|
||||||
|
assert(codename ~= '')
|
||||||
|
log("Building for: %s", codename)
|
||||||
assert(not io.open('usr/.git'), 'Remove usr/')
|
assert(not io.open('usr/.git'), 'Remove usr/')
|
||||||
local MXE_DIR_EXPECTED = '/usr/lib/mxe'
|
local MXE_DIR_EXPECTED = '/usr/lib/mxe'
|
||||||
if MXE_DIR ~= MXE_DIR_EXPECTED then
|
if MXE_DIR ~= MXE_DIR_EXPECTED then
|
||||||
|
@ -1127,12 +1134,10 @@ local function main()
|
||||||
makeItem2Index(build_list),
|
makeItem2Index(build_list),
|
||||||
'first'
|
'first'
|
||||||
)
|
)
|
||||||
makeDebs(unbroken, item2deps, item2ver, item2files)
|
os.execute(('mkdir -p %s'):format(codename))
|
||||||
if not no_debs then
|
makeDebs(unbroken, item2deps, item2ver, item2files, codename)
|
||||||
makeMxeRequirementsPackage('wheezy')
|
makeMxeRequirementsPackage(codename)
|
||||||
makeMxeRequirementsPackage('jessie')
|
makeMxeSourcePackage(codename)
|
||||||
end
|
|
||||||
makeMxeSourcePackage()
|
|
||||||
if not no_second_pass then
|
if not no_second_pass then
|
||||||
local unbroken_second = buildPackages(
|
local unbroken_second = buildPackages(
|
||||||
build_list, item2deps, 'second', item2files
|
build_list, item2deps, 'second', item2files
|
||||||
|
|
Loading…
Reference in New Issue