From 80f9a31d5bc9ea0453701b7bf06c3f0deecbbc3f Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Tue, 18 Feb 2020 17:22:14 -0800 Subject: [PATCH] debian/rules: use dpkg-architecture, not uname, to get arch The "git version --build-options" command prints what arch Git was built for. Unfortunately, the upstream code to do this gets the arch using the "uname -m" command instead of "cc -dumpmachine". Fortunately, in the Debian environment we can get a nice host CPU string using the "dpkg-architecture" command. Noticed by the reproducible-builds continuous builder[1]. Thanks to Ceridwen for adding this variation to reprotest in 0.1~15 ("Add variations, notes theron, and tests", 2016-06-07). [1] https://tests.reproducible-builds.org/debian/rb-pkg/unstable/i386/diffoscope-results/git.html Signed-off-by: Jonathan Nieder --- debian/changelog | 4 ++++ debian/rules | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index d0b623a2d2..cd4f728900 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,10 @@ git (1:2.25.1-0.1) unstable; urgency=low * debian/control: remove Gerrit Pape from the Maintainer field, as requested. Thanks to Gerrit for putting together this package in a way that has been pleasant to maintain. + * debian/rules: use "dpkg-architecture" instead of "uname -m" to + retrieve host arch. This makes the resulting "git version + --build-options" more predictable when building for i386 on an + amd64 machine (thx to Ceridwen for detecting this in reprotest). -- Jonathan Nieder Tue, 18 Feb 2020 15:42:20 -0800 diff --git a/debian/rules b/debian/rules index 51e9fcfb90..de5a084e9c 100755 --- a/debian/rules +++ b/debian/rules @@ -4,6 +4,7 @@ CC =gcc CPPFLAGS :=$(shell dpkg-buildflags --get CPPFLAGS) CFLAGS :=-Wall $(shell dpkg-buildflags --get CFLAGS) $(CPPFLAGS) LDFLAGS :=$(shell dpkg-buildflags --get LDFLAGS) +HOST_CPU := $(shell dpkg-architecture -qDEB_HOST_GNU_CPU) TEST =test TEST_OPTS = OPTS =NO_OPENSSL=1 prefix=/usr gitexecdir=/usr/lib/git-core \ @@ -15,7 +16,8 @@ OPTS =NO_OPENSSL=1 prefix=/usr gitexecdir=/usr/lib/git-core \ NO_PERL_CPAN_FALLBACKS=1 \ PYTHON_PATH=/usr/bin/python3 \ DEFAULT_PAGER=pager DEFAULT_EDITOR=editor \ - CC='$(CC)' CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' + CC='$(CC)' CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' \ + HOST_CPU='$(HOST_CPU)' DOCS =html DOC_OPTS =prefix=/usr htmldir=/usr/share/doc/git/html \ ASCIIDOC8=1 ASCIIDOC_NO_ROFF=1 -- 2.11.4.GIT