Skip to content

Commit

Permalink
third-party: fix intltool build with Perl 5.26
Browse files Browse the repository at this point in the history
See: https://bugzilla.redhat.com/show_bug.cgi?id=1462217

Change-Id: I856fbf392983ed753108973b0785486380b5df67
  • Loading branch information
danc86 committed Aug 17, 2017
1 parent 4341e37 commit 385cfeb
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
6 changes: 5 additions & 1 deletion third-party/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ tree/lib/pkgconfig/sqlite3.pc: $(SQLITE) $(SQLITE)/.patches-done
$(MAKE) -C $(SQLITE)
$(MAKE) -C $(SQLITE) install

tree/bin/intltool-update: $(INTLTOOL)
tree/bin/intltool-update: $(INTLTOOL) $(INTLTOOL)/.patches-done
( cd $(INTLTOOL) && ./configure --prefix=$(CURDIR)/tree \
--enable-static --disable-shared )
$(MAKE) -C $(INTLTOOL)
Expand Down Expand Up @@ -234,6 +234,10 @@ $(LIBARCHIVE)/.patches-done: $(LIBARCHIVE)
patch -d$(LIBARCHIVE) -p1 <libarchive_add_ppc64le.patch
touch $@

$(INTLTOOL)/.patches-done: $(INTLTOOL)
patch -d$(INTLTOOL) -p1 <intltool-perl5.26-regex-fixes.patch
touch $@

$(LIBSOUP)/.patches-done: $(LIBSOUP)
patch -d$(LIBSOUP) -p1 <libsoup-no-pkgconfig-version-check.patch
patch -d$(LIBSOUP) -p1 <libsoup-perl580.patch
Expand Down
59 changes: 59 additions & 0 deletions third-party/intltool-perl5.26-regex-fixes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
Description: Escape "{", to prevent complaints from perl 5.22 and 5.26
Author: Roderich Schupp <[email protected]>
Author: gregor herrmann <[email protected]>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=788705
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=826471
Bug-Upstream: https://bugs.launchpad.net/intltool/+bug/1490906

Index: intltool-0.51.0/intltool-update.in
===================================================================
--- intltool-0.51.0.orig/intltool-update.in 2017-07-23 17:24:35.113169465 +0200
+++ intltool-0.51.0/intltool-update.in 2017-07-23 17:24:35.109169052 +0200
@@ -1062,13 +1062,13 @@
}
}

- if ($str =~ /^(.*)\${?([A-Z_]+)}?(.*)$/)
+ if ($str =~ /^(.*)\$\{?([A-Z_]+)}?(.*)$/)
{
my $rest = $3;
my $untouched = $1;
my $sub = "";
# Ignore recursive definitions of variables
- $sub = $varhash{$2} if defined $varhash{$2} and $varhash{$2} !~ /\${?$2}?/;
+ $sub = $varhash{$2} if defined $varhash{$2} and $varhash{$2} !~ /\$\{?$2}?/;

return SubstituteVariable ("$untouched$sub$rest");
}
@@ -1190,10 +1190,10 @@
$name =~ s/\(+$//g;
$version =~ s/\(+$//g;

- $varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\${?AC_PACKAGE_NAME}?/);
- $varhash{"PACKAGE"} = $name if (not $name =~ /\${?PACKAGE}?/);
- $varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\${?AC_PACKAGE_VERSION}?/);
- $varhash{"VERSION"} = $version if (not $name =~ /\${?VERSION}?/);
+ $varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\$\{?AC_PACKAGE_NAME}?/);
+ $varhash{"PACKAGE"} = $name if (not $name =~ /\$\{?PACKAGE}?/);
+ $varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\$\{?AC_PACKAGE_VERSION}?/);
+ $varhash{"VERSION"} = $version if (not $name =~ /\$\{?VERSION}?/);
}

if ($conf_source =~ /^AC_INIT\(([^,\)]+),([^,\)]+)[,]?([^,\)]+)?/m)
@@ -1219,11 +1219,11 @@
$version =~ s/\(+$//g;
$bugurl =~ s/\(+$//g if (defined $bugurl);

- $varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\${?AC_PACKAGE_NAME}?/);
- $varhash{"PACKAGE"} = $name if (not $name =~ /\${?PACKAGE}?/);
- $varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\${?AC_PACKAGE_VERSION}?/);
- $varhash{"VERSION"} = $version if (not $name =~ /\${?VERSION}?/);
- $varhash{"PACKAGE_BUGREPORT"} = $bugurl if (defined $bugurl and not $bugurl =~ /\${?\w+}?/);
+ $varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\$\{?AC_PACKAGE_NAME}?/);
+ $varhash{"PACKAGE"} = $name if (not $name =~ /\$\{?PACKAGE}?/);
+ $varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\$\{?AC_PACKAGE_VERSION}?/);
+ $varhash{"VERSION"} = $version if (not $name =~ /\$\{?VERSION}?/);
+ $varhash{"PACKAGE_BUGREPORT"} = $bugurl if (defined $bugurl and not $bugurl =~ /\$\{?\w+}?/);
}

# \s makes this not work, why?

0 comments on commit 385cfeb

Please sign in to comment.