sys-apps/texinfo: Backport perl-5.28 fixes from upstream
authorAndreas K. Hüttel <dilfridge@gentoo.org>
Thu, 24 Jan 2019 22:18:54 +0000 (23:18 +0100)
committerAndreas K. Hüttel <dilfridge@gentoo.org>
Thu, 24 Jan 2019 22:19:20 +0000 (23:19 +0100)
Closes: https://bugs.gentoo.org/662368
Package-Manager: Portage-2.3.57, Repoman-2.3.12
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
sys-apps/texinfo/files/texinfo-6.5-escape-braces-in-regex.patch [new file with mode: 0644]
sys-apps/texinfo/files/texinfo-6.5-perl-5.28-thread-safe-locales.patch [new file with mode: 0644]
sys-apps/texinfo/texinfo-6.5-r1.ebuild [new file with mode: 0644]

diff --git a/sys-apps/texinfo/files/texinfo-6.5-escape-braces-in-regex.patch b/sys-apps/texinfo/files/texinfo-6.5-escape-braces-in-regex.patch
new file mode 100644 (file)
index 0000000..72f1288
--- /dev/null
@@ -0,0 +1,28 @@
+From efde0da129154376bebcfff6a47424669bb849df Mon Sep 17 00:00:00 2001
+From: Gavin Smith <gavinsmith0123@gmail.com>
+Date: Fri, 13 Jul 2018 15:31:28 +0000
+Subject: [PATCH] escape braces in regex
+
+git-svn-id: svn://127.0.0.1/svn_repo/texinfo/trunk@8007 39fee189-59d7-47db-b5d4-205258b72aed
+
+diff --git a/tp/Texinfo/Parser.pm b/tp/Texinfo/Parser.pm
+index ba1cd423d..b5eece680 100644
+--- a/tp/Texinfo/Parser.pm
++++ b/tp/Texinfo/Parser.pm
+@@ -5531,11 +5531,11 @@ sub _parse_special_misc_command($$$$)
+     }
+   } elsif ($command eq 'clickstyle') {
+     # REMACRO
+-    if ($line =~ /^\s+@([[:alnum:]][[:alnum:]\-]*)({})?\s*/) {
++    if ($line =~ /^\s+@([[:alnum:]][[:alnum:]\-]*)(\{\})?\s*/) {
+       $args = ['@'.$1];
+       $self->{'clickstyle'} = $1;
+       $remaining = $line;
+-      $remaining =~ s/^\s+@([[:alnum:]][[:alnum:]\-]*)({})?\s*(\@(c|comment)((\@|\s+).*)?)?//;
++      $remaining =~ s/^\s+@([[:alnum:]][[:alnum:]\-]*)(\{\})?\s*(\@(c|comment)((\@|\s+).*)?)?//;
+       $has_comment = 1 if (defined($4));
+     } else {
+       $self->line_error (sprintf($self->__(
+-- 
+2.20.1
+
diff --git a/sys-apps/texinfo/files/texinfo-6.5-perl-5.28-thread-safe-locales.patch b/sys-apps/texinfo/files/texinfo-6.5-perl-5.28-thread-safe-locales.patch
new file mode 100644 (file)
index 0000000..2d33abe
--- /dev/null
@@ -0,0 +1,37 @@
+From a028ef47353b03177aab3facb4b2b74f7c3823e2 Mon Sep 17 00:00:00 2001
+From: Gavin Smith <gavinsmith0123@gmail.com>
+Date: Fri, 13 Jul 2018 15:39:29 +0000
+Subject: [PATCH] perl 5.28 thread-safe locales
+
+git-svn-id: svn://127.0.0.1/svn_repo/texinfo/trunk@8008 39fee189-59d7-47db-b5d4-205258b72aed
+
+diff --git a/tp/Texinfo/Convert/XSParagraph/xspara.c b/tp/Texinfo/Convert/XSParagraph/xspara.c
+index 51eea4a30..f2d6d1ccd 100644
+--- a/tp/Texinfo/Convert/XSParagraph/xspara.c
++++ b/tp/Texinfo/Convert/XSParagraph/xspara.c
+@@ -248,6 +248,11 @@ xspara_init (void)
+   dTHX;
++#if PERL_VERSION > 27 || (PERL_VERSION == 27 && PERL_SUBVERSION > 8)
++  /* needed due to thread-safe locale handling in newer perls */
++  switch_to_global_locale();
++#endif
++
+   if (setlocale (LC_CTYPE, "en_US.UTF-8")
+       || setlocale (LC_CTYPE, "en_US.utf8"))
+     goto success;
+@@ -320,6 +325,10 @@ failure:
+     {
+ success: ;
+       free (utf8_locale);
++#if PERL_VERSION > 27 || (PERL_VERSION == 27 && PERL_SUBVERSION > 8)
++      /* needed due to thread-safe locale handling in newer perls */
++      sync_locale();
++#endif
+       /*
+       fprintf (stderr, "tried to set LC_CTYPE to UTF-8.\n");
+       fprintf (stderr, "character encoding is: %s\n",
+-- 
+2.20.1
+
diff --git a/sys-apps/texinfo/texinfo-6.5-r1.ebuild b/sys-apps/texinfo/texinfo-6.5-r1.ebuild
new file mode 100644 (file)
index 0000000..d42ea55
--- /dev/null
@@ -0,0 +1,47 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# Note: if your package uses the texi2dvi utility, it must depend on the
+# virtual/texi2dvi package to pull in all the right deps.  The tool is not
+# usable out-of-the-box because it requires the large tex packages.
+
+EAPI=6
+
+inherit flag-o-matic
+
+DESCRIPTION="The GNU info program and utilities"
+HOMEPAGE="https://www.gnu.org/software/texinfo/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
+IUSE="nls static"
+
+RDEPEND="
+       !=app-text/tetex-2*
+       >=sys-libs/ncurses-5.2-r2:0=
+       dev-lang/perl:=
+       dev-perl/libintl-perl
+       dev-perl/Unicode-EastAsianWidth
+       dev-perl/Text-Unidecode
+       nls? ( virtual/libintl )"
+DEPEND="${RDEPEND}
+       app-arch/xz-utils
+       nls? ( >=sys-devel/gettext-0.19.6 )"
+
+PATCHES=(
+       "${FILESDIR}/${P}"-escape-braces-in-regex.patch
+       "${FILESDIR}/${P}"-perl-5.28-thread-safe-locales.patch
+)
+
+src_configure() {
+       use static && append-ldflags -static
+       local myeconfargs=(
+               --with-external-libintl-perl
+               --with-external-Unicode-EastAsianWidth
+               --with-external-Text-Unidecode
+               $(use_enable nls)
+       )
+       econf "${myeconfargs[@]}"
+}