From patchwork Wed Dec 21 22:41:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wookey X-Patchwork-Id: 5937 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 1398D24056 for ; Wed, 21 Dec 2011 22:41:34 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id F299EA18562 for ; Wed, 21 Dec 2011 22:41:33 +0000 (UTC) Received: by eaac11 with SMTP id c11so5149700eaa.11 for ; Wed, 21 Dec 2011 14:41:33 -0800 (PST) Received: by 10.204.156.219 with SMTP id y27mr1993510bkw.71.1324507293755; Wed, 21 Dec 2011 14:41:33 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.82.144 with SMTP id ac16cs51926bkc; Wed, 21 Dec 2011 14:41:33 -0800 (PST) Received: by 10.180.83.69 with SMTP id o5mr18191717wiy.1.1324507292075; Wed, 21 Dec 2011 14:41:32 -0800 (PST) Received: from stoneboat.aleph1.co.uk (stoneboat.aleph1.co.uk. [80.68.88.63]) by mx.google.com with ESMTPS id fk19si3727693wbb.39.2011.12.21.14.41.31 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Dec 2011 14:41:32 -0800 (PST) Received-SPF: neutral (google.com: 80.68.88.63 is neither permitted nor denied by best guess record for domain of wookey@wookware.org) client-ip=80.68.88.63; Authentication-Results: mx.google.com; spf=neutral (google.com: 80.68.88.63 is neither permitted nor denied by best guess record for domain of wookey@wookware.org) smtp.mail=wookey@wookware.org Received: from cpc5-cmbg4-0-0-cust802.5-4.cable.virginmedia.com ([86.14.235.35] helo=kh.home.wookware.org) by stoneboat.aleph1.co.uk with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1RdUqm-0001tT-UH; Wed, 21 Dec 2011 22:41:30 +0000 Received: from wookey by kh.home.wookware.org with local (Exim 4.77) (envelope-from ) id 1RdUqk-0006aL-1O; Wed, 21 Dec 2011 22:41:26 +0000 From: wookey@wookware.org To: buildd-tools-devel@lists.alioth.debian.org Cc: patches@linaro.org, Wookey Date: Wed, 21 Dec 2011 22:41:07 +0000 Message-Id: <1324507270-25272-1-git-send-email-wookey@wookware.org> X-Mailer: git-send-email 1.7.7.3 X-SA-Exim-Connect-IP: 86.14.235.35 X-SA-Exim-Mail-From: wookey@wookware.org X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on stoneboat.aleph1.co.uk X-Spam-Level: X-Spam-Status: No, score=-2.8 required=4.5 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=no version=3.3.1 Subject: [PATCH 1/3] Use apt-get -a $arch build-dep $package when cross-building instead of dummy package. X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000) X-SA-Exim-Scanned: Yes (on stoneboat.aleph1.co.uk) From: Wookey --- lib/Sbuild/Build.pm | 43 +++++++++++++++++++++++++++++-------------- 1 files changed, 29 insertions(+), 14 deletions(-) diff --git a/lib/Sbuild/Build.pm b/lib/Sbuild/Build.pm index ccc4d04..0ef5004 100644 --- a/lib/Sbuild/Build.pm +++ b/lib/Sbuild/Build.pm @@ -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);