From 89a26f94004eb5bf76b012f64394cec0bc508d68 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Mon, 7 Aug 2017 11:25:12 -0700 Subject: [PATCH] debian: build against PCRE v2 when available MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Decide which PCRE version to use at build time based on which -dev package is installed. This is the usual way in a Debian package to gracefully handle a build-time dependency that has changed API. It would be nice to offer a build profile to allow explicitly using libpcre3-dev when libpcre2-dev is also installed, but build profiles in Build-Depends are a relatively recent feature, so that would hurt backports. Anyway, libpcre2-dev is what upstream wants to migrate to so it's best that end-users start using it and reporting bugs. This change has already been well tested in Debian experimental since 2017-06-26. Requested-by: Ævar Arnfjörð Bjarmason Signed-off-by: Jonathan Nieder --- debian/changelog | 3 +++ debian/control | 3 ++- debian/rules | 6 +++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8c30ede76a..708ce4ab30 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,9 @@ git (1:2.14.0-0.1) unstable; urgency=low * new upstream release (see RelNotes/2.14.0.txt). * debian/patches/0001-pre-rebase-hook-capture-documentation-...diff: remove; applied upstream. + * build against PCRE v2 if available at build time (thx to Ævar + Arnfjörð Bjarmason for the suggestion). Build-Depends: + libpcre2-dev | libpcre3-dev. -- Jonathan Nieder Mon, 07 Aug 2017 11:19:16 -0700 diff --git a/debian/control b/debian/control index 33bb6cd335..db65fee1cf 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,8 @@ Section: vcs Priority: optional Maintainer: Gerrit Pape Uploaders: Jonathan Nieder , Anders Kaseorg -Build-Depends: libz-dev, libpcre3-dev, gettext, +Build-Depends: libz-dev, gettext, + libpcre2-dev | libpcre3-dev, libcurl4-gnutls-dev, libexpat1-dev, subversion, libsvn-perl, libyaml-perl, tcl, diff --git a/debian/rules b/debian/rules index 7ded2aca5e..f132a26051 100755 --- a/debian/rules +++ b/debian/rules @@ -9,7 +9,6 @@ OPTS =NO_OPENSSL=1 prefix=/usr gitexecdir=/usr/lib/git-core \ libexecdir=/usr/lib/git-core \ mandir=/usr/share/man htmldir=/usr/share/doc/git/html \ INSTALLDIRS=vendor \ - USE_LIBPCRE=1 \ SANE_TOOL_PATH= INSTALL=install TAR=tar \ NO_CROSS_DIRECTORY_HARDLINKS=1 NO_INSTALL_HARDLINKS=1 \ DEFAULT_PAGER=pager DEFAULT_EDITOR=editor \ @@ -37,6 +36,11 @@ ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) # output (unless dh is run as +dh, which causes other problems). %: MAKEFLAGS += -O endif +ifneq (,$(shell dpkg-query -f '$${Version}' -W libpcre2-dev)) + OPTS += USE_LIBPCRE2=1 +else + OPTS += USE_LIBPCRE1=1 +endif TMP = $(CURDIR)/debian/tmp GIT = $(CURDIR)/debian/git -- 2.11.4.GIT