From 2ad99bcc82050fc9cdcfca7b582386394c30b316 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Wed, 5 Sep 2018 00:28:02 +0000 Subject: [PATCH 1/2] texinfo: fix perl issues by applying patches from upstream --- .../development/tools/misc/texinfo/common.nix | 3 ++ .../development/tools/misc/texinfo/perl.patch | 43 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 pkgs/development/tools/misc/texinfo/perl.patch diff --git a/pkgs/development/tools/misc/texinfo/common.nix b/pkgs/development/tools/misc/texinfo/common.nix index 101298cd3052..c6877ed4d1a1 100644 --- a/pkgs/development/tools/misc/texinfo/common.nix +++ b/pkgs/development/tools/misc/texinfo/common.nix @@ -17,6 +17,9 @@ stdenv.mkDerivation rec { inherit sha256; }; + # TODO: fix on mass rebuild + ${if interactive then "patches" else null} = optional (version == "6.5") ./perl.patch; + # We need a native compiler to build perl XS extensions # when cross-compiling. depsBuildBuild = [ buildPackages.stdenv.cc perl ]; diff --git a/pkgs/development/tools/misc/texinfo/perl.patch b/pkgs/development/tools/misc/texinfo/perl.patch new file mode 100644 index 000000000000..e651b37371c7 --- /dev/null +++ b/pkgs/development/tools/misc/texinfo/perl.patch @@ -0,0 +1,43 @@ +Adapted from http://svn.savannah.gnu.org/viewvc/texinfo/ +Author: gavin +--- trunk/tp/Texinfo/Parser.pm 2018-06-04 19:51:36 UTC (rev 8006) ++++ trunk/tp/Texinfo/Parser.pm 2018-07-13 15:31:28 UTC (rev 8007) +@@ -5531,11 +5531,11 @@ + } + } 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->__( +--- trunk/tp/Texinfo/Convert/XSParagraph/xspara.c 2018-07-13 15:31:28 UTC (rev 8007) ++++ trunk/tp/Texinfo/Convert/XSParagraph/xspara.c 2018-07-13 15:39:29 UTC (rev 8008) +@@ -248,6 +248,11 @@ + + 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 @@ + { + 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", From 0b89ece569b44635404c019fe090711549853371 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Tue, 4 Sep 2018 21:53:19 +0000 Subject: [PATCH 2/2] Revert "texinfoInteractive: fixup build by using older perl" This reverts commit 7a22083e1271869294a074cbe7a971f2d8abb4f4. --- pkgs/top-level/all-packages.nix | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f563f0dfe243..67385abb505b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8743,13 +8743,9 @@ with pkgs; texinfo5 = callPackage ../development/tools/misc/texinfo/5.2.nix { }; texinfo6 = callPackage ../development/tools/misc/texinfo/6.5.nix { }; texinfo = texinfo6; - texinfoInteractive = appendToName "interactive" (texinfo.override { - interactive = true; - # doCheck = true -> some xlocale.h problem with perl 5.28.0 - # (it's mistakenly trying to include the non-existent header) - perl = perl526; - buildPackages = buildPackages // { perl = buildPackages.perl526; }; - }); + texinfoInteractive = appendToName "interactive" ( + texinfo.override { interactive = true; } + ); texi2html = callPackage ../development/tools/misc/texi2html { };