Hi,
(second try sending this email. I just discovered that the one I sent in
october 2014 does not show up in the bts)
Quoting Guillem Jover (2014-10-20 17:21:00)
diff --git a/scripts/dpkg-checkbuilddeps.pl b/scripts/dpkg-checkbuilddeps.pl
index 3feba3a..47accc9 100755
--- a/scripts/dpkg-checkbuilddeps.pl
+++ b/scripts/dpkg-checkbuilddeps.pl
@@ -52,6 +52,8 @@ sub usage {
-c build-conf use given string for build conflicts instead of
retrieving them from control file
-a archassume given host architecture
+ --target-arch=arch
+ assume given host architecture
This should be target not host.
ah yes, a copy-paste error.
Also, wouldn't dpkg-buildpackage need to pass this option to
dpkg-checkbuilddeps?
well, I wondered the same thing about the host architecture option which is
also not explicitly passed to dpkg-checkbuilddeps by dpkg-buildpackage. When I
tested whether my patch works it did, so I guess dpkg-checkbuilddeps gets the
host- (and with this patch also target-) architecture through the environment
set by the dpkg-architecture call earlier in dpkg-buildpackage?
The rest looks good (as long as it behaves correctly that is :). But it would
be nice to add some unit tests to Dpkg_Deps.t, I've just enabled very minimal
ones for :native.
I fixed the s/host/target/ error and added a test case.
cheers, josch
From 77aff816f9aa894844b9a4bdc9959177467c2971 Mon Sep 17 00:00:00 2001
From: josch j.scha...@email.de
Date: Fri, 17 Oct 2014 08:39:30 +0200
Subject: [PATCH] =?UTF-8?q?scripts:=20Accept=20=E2=80=9C:target=E2=80=9D?=
=?UTF-8?q?=20arch-qualified=20Build-Dependencies?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
debian/changelog | 6 +-
scripts/Dpkg/Arch.pm | 19 +++
scripts/Dpkg/Deps.pm | 27 ---
scripts/dpkg-checkbuilddeps.pl | 10 +++---
scripts/t/Dpkg_Deps.t | 5 -
5 files changed, 59 insertions(+), 8 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index bf93b1f..833d319 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,10 @@
dpkg (1.17.20) UNRELEASED; urgency=low
- *
+ [ Johannes Schauer ]
+ * dpkg-checkbuilddeps:
+- Add the --target-arch option to specify the target architecture for
+ building compilers
+- Accept “:target” arch-qualified Build-Dependencies.
-- Guillem Jover guil...@debian.org Mon, 20 Oct 2014 16:06:38 +0200
diff --git a/scripts/Dpkg/Arch.pm b/scripts/Dpkg/Arch.pm
index f561b66..e5bc67a 100644
--- a/scripts/Dpkg/Arch.pm
+++ b/scripts/Dpkg/Arch.pm
@@ -23,6 +23,7 @@ our $VERSION = '0.01';
use Exporter qw(import);
our @EXPORT_OK = qw(get_raw_build_arch get_raw_host_arch
get_build_arch get_host_arch get_gcc_host_gnu_type
+get_target_arch
get_valid_arches debarch_eq debarch_is debarch_is_wildcard
debarch_to_cpuattrs
debarch_to_gnutriplet gnutriplet_to_debarch
@@ -50,6 +51,7 @@ my %debarch_to_debtriplet;
my $build_arch;
my $host_arch;
my $gcc_host_gnu_type;
+my $target_arch;
sub get_raw_build_arch()
{
@@ -120,6 +122,23 @@ my %debarch_to_debtriplet;
{
return Dpkg::BuildEnv::get('DEB_HOST_ARCH') || get_raw_host_arch();
}
+
+sub get_raw_target_arch()
+{
+ return $target_arch if defined $target_arch;
+
+ if (!defined($target_arch)) {
+ # Fall back to building a compiler for the host arch.
+ $host_arch = get_raw_host_arch();
+ }
+
+ return $target_arch;
+}
+
+sub get_target_arch()
+{
+ return Dpkg::BuildEnv::get('DEB_TARGET_ARCH') || get_raw_target_arch();
+}
}
sub get_valid_arches()
diff --git a/scripts/Dpkg/Deps.pm b/scripts/Dpkg/Deps.pm
index 5e9728b..0aa186a 100644
--- a/scripts/Dpkg/Deps.pm
+++ b/scripts/Dpkg/Deps.pm
@@ -49,10 +49,10 @@ All the deps_* functions are exported by default.
use strict;
use warnings;
-our $VERSION = '1.05';
+our $VERSION = '1.06';
use Dpkg::Version;
-use Dpkg::Arch qw(get_host_arch get_build_arch);
+use Dpkg::Arch qw(get_host_arch get_build_arch get_target_arch);
use Dpkg::BuildProfiles qw(get_build_profiles);
use Dpkg::ErrorHandling;
use Dpkg::Gettext;
@@ -190,6 +190,11 @@ Dpkg::Arch::get_host_arch() to identify the proper architecture.
Define the build architecture. By default it uses
Dpkg::Arch::get_build_arch() to identify the proper architecture.
+=item target_arch (defaults to the current architecture)
+
+Define the target architecture. By default it uses
+Dpkg::Arch::get_target_arch() to identify the proper architecture.
+
=item reduce_arch (defaults to 0)
If set to 1, ignore dependencies that do not concern the current host
@@ -243,6 +248,7 @@ sub deps_parse {
$options{reduce_arch} //= 0;
$options{host_arch} //= get_host_arch();
$options{build_arch} //=