aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTijl Coosemans <tijl@FreeBSD.org>2026-06-09 17:40:49 +0000
committerTijl Coosemans <tijl@FreeBSD.org>2026-06-30 20:03:56 +0000
commit72b9da5ac99d1240e717857998556c4a2825d136 (patch)
tree5e175d1dc27c221d1c9c1518f04dd0a90b79a5e1
parent084afac04e9789ae9972883cd74eb920c05c8470 (diff)
textproc/linuxdoc-tools: Fix expand(1) locale
Add a patch so linuxdoc runs expand(1) with the right locale to interpret multibyte characters. PR: 295945 Exp-run by: antoine
-rw-r--r--textproc/linuxdoc-tools/Makefile6
-rw-r--r--textproc/linuxdoc-tools/files/patch-perl5lib_LinuxDocTools.pm24
2 files changed, 29 insertions, 1 deletions
diff --git a/textproc/linuxdoc-tools/Makefile b/textproc/linuxdoc-tools/Makefile
index f6bf287274d0..9305e1475cb7 100644
--- a/textproc/linuxdoc-tools/Makefile
+++ b/textproc/linuxdoc-tools/Makefile
@@ -1,6 +1,6 @@
PORTNAME= linuxdoc-tools
DISTVERSION= 0.9.83
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= textproc
MAINTAINER= ports@FreeBSD.org
@@ -36,4 +36,8 @@ DOCS_USES= makeinfo tex
DOCS_USE= TEX=dvipsk:build,latex:build,pdftex:build
DOCS_CONFIGURE_ENABLE= docs
+post-stage:
+ @${RM} ${STAGEDIR}${DOCSDIR}/Makefile.orig \
+ ${STAGEDIR}${DOCSDIR}/example/Makefile.orig
+
.include <bsd.port.mk>
diff --git a/textproc/linuxdoc-tools/files/patch-perl5lib_LinuxDocTools.pm b/textproc/linuxdoc-tools/files/patch-perl5lib_LinuxDocTools.pm
new file mode 100644
index 000000000000..0c86c6c997ce
--- /dev/null
+++ b/textproc/linuxdoc-tools/files/patch-perl5lib_LinuxDocTools.pm
@@ -0,0 +1,24 @@
+--- perl5lib/LinuxDocTools.pm.orig 2023-06-12 16:57:27 UTC
++++ perl5lib/LinuxDocTools.pm
+@@ -621,8 +621,20 @@ sub process_file {
+ }
+ }
+
++ my %EXPAND_locale = (
++ 'ascii' => 'C',
++ 'latin' => 'C',
++ 'latin1' => 'C',
++ 'utf-8' => 'C.UTF-8',
++ 'nippon' => 'ja_JP.eucJP',
++ 'euc-kr' => 'ko_KR.eucKR'
++ );
++ die "$error_header: Unkown character set $global->{charset}.\n"
++ unless exists $EXPAND_locale{$global->{charset}};
++ my $EXPAND_envvars = "LC_ALL=$EXPAND_locale{$global->{charset}}";
++
+ my $sgmlsasp_command = "$main::progs->{SGMLSASP} $mapping < $preaspout |
+- expand -t $global->{tabsize} > $aspout";
++ $EXPAND_envvars expand -t $global->{tabsize} > $aspout";
+ ldt_log " ${error_header}::sgmlsasp_command:\n $sgmlsasp_command";
+ system ($sgmlsasp_command) == 0
+ or die "$error_header: Error running $sgmlsasp_command. Aborting ...\n";