mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-12 23:56:13 +01:00
Merge pull request #918 from adrianschroeter/cross
support cross compile using a sysroot
This commit is contained in:
commit
6a12adccf5
1
NEWS
1
NEWS
@ -6,6 +6,7 @@
|
|||||||
Check the help for more details.
|
Check the help for more details.
|
||||||
- allow to run build script as non-root, by setting su-wrapper empty
|
- allow to run build script as non-root, by setting su-wrapper empty
|
||||||
=> osc is not guessing anymore if user builds are wanted
|
=> osc is not guessing anymore if user builds are wanted
|
||||||
|
- add support for cross arch local build using a sysroot
|
||||||
|
|
||||||
0.172.0
|
0.172.0
|
||||||
- support --lastsucceeded/--last-succeeded in "osc buildlog", "osc
|
- support --lastsucceeded/--last-succeeded in "osc buildlog", "osc
|
||||||
|
30
osc/build.py
30
osc/build.py
@ -126,11 +126,20 @@ class Buildinfo:
|
|||||||
# snapcraft also supports rpm
|
# snapcraft also supports rpm
|
||||||
self.pacsuffix = 'deb'
|
self.pacsuffix = 'deb'
|
||||||
|
|
||||||
|
# The architectures become a bit mad ...
|
||||||
|
# buildarch: The architecture of the build result (host arch in GNU definition)
|
||||||
|
# hostarch: The architecture of the build environment (build arch in GNU defintion)
|
||||||
|
# crossarch: Same as hostarch, but indicating that a sysroot with an incompatible architecture exists
|
||||||
self.buildarch = root.find('arch').text
|
self.buildarch = root.find('arch').text
|
||||||
|
if root.find('crossarch') != None:
|
||||||
|
self.crossarch = root.find('crossarch').text
|
||||||
|
else:
|
||||||
|
self.crossarch = None
|
||||||
if root.find('hostarch') != None:
|
if root.find('hostarch') != None:
|
||||||
self.hostarch = root.find('hostarch').text
|
self.hostarch = root.find('hostarch').text
|
||||||
else:
|
else:
|
||||||
self.hostarch = None
|
self.hostarch = None
|
||||||
|
|
||||||
if root.find('release') != None:
|
if root.find('release') != None:
|
||||||
self.release = root.find('release').text
|
self.release = root.find('release').text
|
||||||
else:
|
else:
|
||||||
@ -152,8 +161,15 @@ class Buildinfo:
|
|||||||
for node in root.findall('module'):
|
for node in root.findall('module'):
|
||||||
self.modules.append(node.text)
|
self.modules.append(node.text)
|
||||||
for node in root.findall('bdep'):
|
for node in root.findall('bdep'):
|
||||||
p = Pac(node, self.buildarch, self.pacsuffix,
|
if node.find('sysroot'):
|
||||||
apiurl, localpkgs)
|
p = Pac(node, self.buildarch, self.pacsuffix,
|
||||||
|
apiurl, localpkgs)
|
||||||
|
else:
|
||||||
|
pac_arch = self.crossarch
|
||||||
|
if pac_arch == None:
|
||||||
|
pac_arch = self.buildarch
|
||||||
|
p = Pac(node, pac_arch, self.pacsuffix,
|
||||||
|
apiurl, localpkgs)
|
||||||
if p.project:
|
if p.project:
|
||||||
self.projects[p.project] = 1
|
self.projects[p.project] = 1
|
||||||
self.deps.append(p)
|
self.deps.append(p)
|
||||||
@ -195,7 +211,7 @@ class Pac:
|
|||||||
self.mp = {}
|
self.mp = {}
|
||||||
for i in ['binary', 'package',
|
for i in ['binary', 'package',
|
||||||
'epoch', 'version', 'release', 'hdrmd5',
|
'epoch', 'version', 'release', 'hdrmd5',
|
||||||
'project', 'repository',
|
'project', 'repository', 'sysroot',
|
||||||
'preinstall', 'vminstall', 'runscripts',
|
'preinstall', 'vminstall', 'runscripts',
|
||||||
'noinstall', 'installonly', 'notmeta',
|
'noinstall', 'installonly', 'notmeta',
|
||||||
]:
|
]:
|
||||||
@ -1278,7 +1294,13 @@ def main(apiurl, opts, argv):
|
|||||||
if build_type == 'kiwi' or build_type == 'docker' or build_type == 'podman'or build_type == 'fissile':
|
if build_type == 'kiwi' or build_type == 'docker' or build_type == 'podman'or build_type == 'fissile':
|
||||||
rpmlist = [ '%s %s\n' % (i.name, i.fullfilename) for i in bi.deps if not i.noinstall ]
|
rpmlist = [ '%s %s\n' % (i.name, i.fullfilename) for i in bi.deps if not i.noinstall ]
|
||||||
else:
|
else:
|
||||||
rpmlist = [ '%s %s\n' % (i.name, i.fullfilename) for i in bi.deps ]
|
rpmlist = []
|
||||||
|
for dep in bi.deps:
|
||||||
|
if dep.sysroot:
|
||||||
|
# packages installed in sysroot subdirectory need to get a prefix for init_buildsystem
|
||||||
|
rpmlist.append('sysroot: %s %s\n' % (dep.name, dep.fullfilename))
|
||||||
|
else:
|
||||||
|
rpmlist.append('%s %s\n' % (dep.name, dep.fullfilename))
|
||||||
for i in imagebins:
|
for i in imagebins:
|
||||||
rpmlist.append('%s preinstallimage\n' % i)
|
rpmlist.append('%s preinstallimage\n' % i)
|
||||||
rpmlist += [ '%s %s\n' % (i[0], i[1]) for i in rpmlist_prefers ]
|
rpmlist += [ '%s %s\n' % (i[0], i[1]) for i in rpmlist_prefers ]
|
||||||
|
Loading…
Reference in New Issue
Block a user