diff -Nru intltool-0.51.0/debian/changelog intltool-0.51.0/debian/changelog --- intltool-0.51.0/debian/changelog 2017-07-23 18:33:10.000000000 +0300 +++ intltool-0.51.0/debian/changelog 2017-12-04 17:21:57.000000000 +0300 @@ -1,3 +1,11 @@ +intltool (0.51.0-5) UNRELEASED; urgency=medium + + * no-guess-builddir.patch: new patch by Aleksander Morgado. + Fixes build of various projects when builddir is not the same + as srcdir (e.g. when running make distcheck). (LP: #1117944) + + -- Vlad Orlov Mon, 04 Dec 2017 17:21:57 +0300 + intltool (0.51.0-4) unstable; urgency=medium [ gregor herrmann ] diff -Nru intltool-0.51.0/debian/patches/no-guess-builddir.patch intltool-0.51.0/debian/patches/no-guess-builddir.patch --- intltool-0.51.0/debian/patches/no-guess-builddir.patch 1970-01-01 03:00:00.000000000 +0300 +++ intltool-0.51.0/debian/patches/no-guess-builddir.patch 2017-12-04 17:21:57.000000000 +0300 @@ -0,0 +1,34 @@ +Patch by Aleksander Morgado +https://bugs.launchpad.net/intltool/+bug/1117944 + +Index: intltool-0.51.0/intltool-update.in +=================================================================== +--- intltool-0.51.0.orig/intltool-update.in ++++ intltool-0.51.0/intltool-update.in +@@ -620,6 +620,14 @@ sub FindLeftoutFiles + + my @result; + ++ # If the builddir is a subdir of srcdir, the list of files found will be prefixed with ++ # an additional prefix (e.g. "_build/sub" for automake 1.15 make distcheck). Try to ++ # handle that, by removing those matches as well. ++ my $absbuilddir = Cwd::abs_path("..\/"); ++ my $abssrcdir = Cwd::abs_path("$SRCDIR/.."); ++ # Check if builddir is a subdir of srcdir ++ my ($abspath,$relpath) = split /\s*$abssrcdir\/\s*/, $absbuilddir, 2; ++ + foreach (@buf_allfiles_sorted) + { + my $dummy = $_; +@@ -628,7 +636,10 @@ sub FindLeftoutFiles + $srcdir =~ s#^../##; + $dummy =~ s#^$srcdir/../##; + $dummy =~ s#^$srcdir/##; +- $dummy =~ s#_build/##; ++ if ($relpath) ++ { ++ $dummy =~ s#^$relpath/##; ++ } + if (!exists($in2{$dummy})) + { + push @result, $dummy diff -Nru intltool-0.51.0/debian/patches/series intltool-0.51.0/debian/patches/series --- intltool-0.51.0/debian/patches/series 2017-07-23 18:24:33.000000000 +0300 +++ intltool-0.51.0/debian/patches/series 2017-12-04 17:21:57.000000000 +0300 @@ -1 +1,2 @@ perl5.26-regex-fixes.patch +no-guess-builddir.patch