@@ -664,20 +664,35 @@ sub run_fetch_install_packages {
join(", ", @{$self->get_conf('MANUAL_CONFLICTS_ARCH')}),
join(", ", @{$self->get_conf('MANUAL_CONFLICTS_INDEP')}));
- $resolver->add_dependencies($self->get('Package'),
- $self->get('Build Depends'),
- $self->get('Build Depends Arch'),
- $self->get('Build Depends Indep'),
- $self->get('Build Conflicts'),
- $self->get('Build Conflicts Arch'),
- $self->get('Build Conflicts Indep'));
-
- $self->check_abort();
- if (!$resolver->install_deps($self->get('Package'),
- 'ESSENTIAL', 'GCC_SNAPSHOT', 'MANUAL',
- $self->get('Package'))) {
- Sbuild::Exception::Build->throw(error => "Package build dependencies not satisfied; skipping",
- failstage => "install-deps");
+ if ($self->get_conf('HOST_ARCH') eq $self->get_conf('BUILD_ARCH')) {
+ # for native building make and install dummy-deps package
+ $resolver->add_dependencies($self->get('Package'),
+ $self->get('Build Depends'),
+ $self->get('Build Depends Arch'),
+ $self->get('Build Depends Indep'),
+ $self->get('Build Conflicts'),
+ $self->get('Build Conflicts Arch'),
+ $self->get('Build Conflicts Indep'));
+
+ $self->check_abort();
+ if (!$resolver->install_deps($self->get('Package'),
+ 'ESSENTIAL', 'GCC_SNAPSHOT', 'MANUAL',
+ $self->get('Package'))) {
+ Sbuild::Exception::Build->throw(error => "Package build dependencies not satisfied; skipping",
+ failstage => "install-deps");
+ }
+ } else { # cross-building
+ # install cross-deps. Hacked for now - need to generate dummy package
+ $self->log('Cross-deps: Running apt-get -a ' . $self->get('Host_Arch') . ' build-dep ' . $self->get('Package') . "\n");
+ $resolver->run_apt_command(
+ { COMMAND => [$self->get_conf('APT_GET'), '-a ' . $self->get('Host_Arch'), 'build-dep', $self->get('Package')],
+ ENV => {'DEBIAN_FRONTEND' => 'noninteractive'},
+ USER => 'root',
+ DIR => '/' });
+ if ($?) {
+ $self->log("Failed to get cross build-deps:\n");
+ return 1;
+ }
}
$self->set('Install End Time', time);
From: Wookey <wookey@wookware.org> --- lib/Sbuild/Build.pm | 43 +++++++++++++++++++++++++++++-------------- 1 files changed, 29 insertions(+), 14 deletions(-)