From 01e3fd5a4d62236e179a00a0afe7eff71e6fe8ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Mairb=C3=B6ck?= Date: Thu, 17 Apr 2025 18:11:53 +0200 Subject: [PATCH] xindy: new recipe (part of texlive) Version 2.5.1 with patches from upstream --- app-text/xindy/patches/xindy-2.5.1.patchset | 448 ++++++++++++++++++++ app-text/xindy/xindy-2.5.1.recipe | 90 ++++ 2 files changed, 538 insertions(+) create mode 100644 app-text/xindy/patches/xindy-2.5.1.patchset create mode 100644 app-text/xindy/xindy-2.5.1.recipe diff --git a/app-text/xindy/patches/xindy-2.5.1.patchset b/app-text/xindy/patches/xindy-2.5.1.patchset new file mode 100644 index 000000000..7377144c3 --- /dev/null +++ b/app-text/xindy/patches/xindy-2.5.1.patchset @@ -0,0 +1,448 @@ +From 66a1e47bf50e0b823d6f68bc85124e2d8d97b9de Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Joachim=20Mairb=C3=B6ck?= +Date: Thu, 17 Apr 2025 17:18:30 +0200 +Subject: patch xindy-script from upstream TeXLive + + +diff --git a/user-commands/xindy.1 b/user-commands/xindy.1 +index 3112713..d849875 100644 +--- a/user-commands/xindy.1 ++++ b/user-commands/xindy.1 +@@ -1,4 +1,4 @@ +-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) ++.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) + .\" + .\" Standard preamble: + .\" ======================================================================== +@@ -133,7 +133,7 @@ + .\" ======================================================================== + .\" + .IX Title "xindy 1" +-.TH xindy 1 "2014-05-29" "Release 2.5.1" "xindy" ++.TH xindy 1 "2015-08-15" "Release 2.5.1" "xindy" + .\" For nroff, turn off justification. Always turn off hyphenation; it makes + .\" way too many mistakes in technical documents. + .if n .ad l +@@ -165,7 +165,7 @@ xindy \- create sorted and tagged index from raw index + .Ve + .SH "DESCRIPTION" + .IX Header "DESCRIPTION" +-\&\fBxindy\fR is the formatter-indepedent command of xindy, the flexible ++\&\fBxindy\fR is the formatter-independent command of xindy, the flexible + indexing system. It takes a raw index as input, and produces a merged, + sorted and tagged index. Merging, sorting, and tagging is controlled + by xindy style files. +@@ -432,7 +432,7 @@ used as internal codepage for LaTeX inputenc re-encoding. + Joachim Schrod + .SH "LEGALESE" + .IX Header "LEGALESE" +-Copyright (c) 2004\-2014 by Joachim Schrod. ++Copyright (C) 2004\-2014 by Joachim Schrod. + .PP + \&\fBxindy\fR is free software; you can redistribute it and/or modify it + under the terms of the \s-1GNU\s0 General Public License as published by the +diff --git a/user-commands/xindy.in b/user-commands/xindy.in +index 452725a..27af4b2 100644 +--- a/user-commands/xindy.in ++++ b/user-commands/xindy.in +@@ -353,6 +353,7 @@ our $VERSION = sprintf "%d.%02d", q$Revision: 1.18 $ =~ /: (\d+)\.(\d+)/ ; + + use Cwd; + use File::Basename; ++use File::Glob qw(bsd_glob); + use File::Spec; + use File::Temp qw(tempfile tmpnam); + use Getopt::Long qw(:config bundling); +@@ -394,7 +395,7 @@ $TMPDIR = "."; + # FIXME: In standalone installations, modules are still placed in lib + # directory. This is not conformant to FHS. + +-if ( $is_TL ) { # TeX Live and MikTeX ++if ( $is_TL ) { # TeX Live, MiKTeX, or W32TeX + + $modules_dir = Cwd::realpath("$cmd_dir/../../xindy/modules"); + die "$cmd: Cannot locate xindy modules directory" unless -d $modules_dir; +@@ -402,8 +403,12 @@ if ( $is_TL ) { # TeX Live and MikTeX + if ( $is_w32 ) { + if ( -d "$cmd_dir/../../../bin/win32" ) { # TeX Live + $cmd_dir = "$cmd_dir/../../../bin/win32"; +- } elsif ( -d "$cmd_dir/../../miktex/bin" ) { # MikTeX +- $cmd_dir = "$cmd_dir/../../miktex/bin"; ++ } elsif ( -d "$cmd_dir/../../miktex/bin/x64/internal" ) { # MiKTeX 64-bit ++ $cmd_dir = "$cmd_dir/../../miktex/bin/x64/internal"; ++ } elsif ( -d "$cmd_dir/../../miktex/bin/internal" ) { # MiKTeX 32-bit ++ $cmd_dir = "$cmd_dir/../../miktex/bin/internal"; ++ } elsif ( -d "$cmd_dir/../../../../bin" ) { # W32TeX ++ $cmd_dir = "$cmd_dir/../../../../bin"; + } else { + die "$cmd: Cannot locate bin directory"; + } +@@ -626,7 +631,11 @@ sub parse_options() { + usage(1); + } + my ($name, $path, $suffix) = fileparse ($ARGV[0], '\.[^\.]+'); ++ if ($path eq ".\\") { ++ $outfile = "$name.ind"; ++ } else { + $outfile = "$path$name.ind"; ++ } + } + + # FIXME: xindy wants a log file. Really? +@@ -706,6 +715,7 @@ sub filter_index ( $$ ) { + my $output = tmpnam(); + push (@temp_files, $output); + $output=quotify($output); ++ $filter=quotify($filter); + print "Running filter: $filter <$input >$output\n" if $verbose; + system "$filter <$input >$output"; + print "filtered xindy input file: $output\n" if $debug{script}; +@@ -732,6 +742,9 @@ sub xindy_expression () { + # + # FIXME: I didn't see all languages. What's on with gypsy and + # hausa? ++ if ( !$language ) { ++ $language = "general"; ++ } + if ( $language ) { + # If there is no language directory, this might be a variant. + # Language names and variants are separated by hyphens. The +@@ -762,7 +775,7 @@ sub xindy_expression () { + @codepages = qw(latin cp iso8859 ascii utf8) unless @codepages; + my @styles; + foreach my $cp ( @codepages ) { +- @styles = glob("$lang_dir/$variant$cp*-lang.xdy"); ++ @styles = bsd_glob("$lang_dir/$variant$cp*-lang.xdy"); + last if @styles; + } + unless ( @styles ) { +@@ -790,7 +803,21 @@ sub xindy_expression () { + push (@temp_files, $style_file); + $style_file=quotify($style_file); + foreach my $module ( @modules ) { +- print $sf "(require \"$module\")\n"; ++ if (($module =~ /\//) || ($module =~ /\\/)) { ++ # If $module contains directory separators, the module must be a system ++ # module. So we don't call kpsewhich. ++ print $sf "(require \"$module\")\n"; ++ } else { ++ # Here we call kpsewhich to search for a module. Thus modules can be under ++ # (anytexmf)/xindy/modules/ ++ my $fnmodule=`kpsewhich -progname=xindy -format=othertext $module`; ++ if ($fnmodule) { ++ chomp($fnmodule); ++ print $sf "(require \"$fnmodule\")\n"; ++ } else { ++ print $sf "(require \"$module\")\n"; ++ } ++ } + } + close ($sf); + } +-- +2.48.1 + + +From b54d3dadb76f4aa084f23cf35a393eef86547f06 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Joachim=20Mairb=C3=B6ck?= +Date: Thu, 17 Apr 2025 17:20:00 +0200 +Subject: must use \{ in regexp to placate current perl + +patch from upstream TeXLive + +diff --git a/make-rules/inputenc/make-inp-rules.pl b/make-rules/inputenc/make-inp-rules.pl +index 9a4d5a8..437684a 100755 +--- a/make-rules/inputenc/make-inp-rules.pl ++++ b/make-rules/inputenc/make-inp-rules.pl +@@ -8,7 +8,7 @@ EOF + + + while () { +- if (/\\indexentry{(.+)--([8-9a-f][0-9a-f])\}\{1\}/) { ++ if (/\\indexentry\{(.+)--([8-9a-f][0-9a-f])\}\{1\}/) { + if (!($1 =~ /inputenc Error|\@inpenc\@undefined/)) { + $i = hex($2); + $macro = $1; +-- +2.48.1 + + +From e3faae6247ec2919deef29b86d551c519d5daa9b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Joachim=20Mairb=C3=B6ck?= +Date: Thu, 17 Apr 2025 17:30:25 +0200 +Subject: =?UTF-8?q?support=20:attr=20on=20separator=20markup,=20from=20J?= + =?UTF-8?q?=C3=BCrgen=20S?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +patch from upstream TeXLive + +diff --git a/doc/manual-3.html b/doc/manual-3.html +index 3520de7..ad2163e 100644 +--- a/doc/manual-3.html ++++ b/doc/manual-3.html +@@ -927,17 +927,16 @@ location references in a hierarchical form. With the commands +
+ (markup-range [:open string] [:close string] [:sep string]
+               [:class locref-class]
++              [:attr attribute]
+               [:length num] [:ignore-end])
+ 
+ +

A range consists of two location references. Markup can be specified + with the :open and :close arguments and one separator given + by the argument :sep. +-

Since both location references are tagged with markup defined by the +-command markup-locref a specialization on attributes or depth is +-not necessary. Specialization is allowed on the class they belong to, +-because the separator between two location refences may be different +-for each location class. Argument :length can be used to define ++

The markup of the separator can be specified attributes via ++the:attr tag. ++

Argument :length can be used to define + different markup for different lengths. In conjunction with + :length is may be useful not to print the second location + reference at all. For example, one wishes to markup ranges of length 1 +diff --git a/src/markup.lsp b/src/markup.lsp +index c0f696e..6de238b 100644 +--- a/src/markup.lsp ++++ b/src/markup.lsp +@@ -409,7 +409,7 @@ T + (do-markup-list (get-members attribute-group) + :identifier LOCREF + :open-body (do-markup-locref-list-open loccls 0) +- :elt-body (do-markup-locref LOCREF loccls 0) ++ :elt-body (do-markup-locref (get-catattr LOCREF) LOCREF loccls 0) + :sep-body (do-markup-locref-list-sep loccls 0) + :close-body (do-markup-locref-list-close loccls 0)) + +@@ -429,7 +429,8 @@ T + (do-markup-default "LOCREF-LIST:CLOSE" (get-name loccls) depth)) + :sep ((do-markup-default "LOCREF-LIST:SEP" (get-name loccls) depth))) + ;; line 808 "markup.nw" +-(defmethod do-markup-locref ((locref location-reference) ++(defmethod do-markup-locref ((attr category-attribute) ++ (locref location-reference) + (loccls layered-location-class) + (depth number)) + #+ASSERT! (assert! (and (typep locref 'layered-location-reference) +@@ -455,7 +456,7 @@ T + (do-markup-list subrefs + :identifier LOCREF + :open-body (do-markup-locref-list-open loccls new-depth) +- :elt-body (do-markup-locref LOCREF loccls new-depth) ++ :elt-body (do-markup-locref attr LOCREF loccls new-depth) + :sep-body (do-markup-locref-list-sep loccls new-depth) + :close-body (do-markup-locref-list-close loccls new-depth))) + +@@ -506,23 +507,24 @@ T + (do-markup-default "LOCREF:CLOSE" + (get-name attr) (get-name loccls) depth))) + ;; line 955 "markup.nw" +-(defmethod do-markup-locref ((range location-range) ++(defmethod do-markup-locref ((attr category-attribute) ++ (range location-range) + (loccls layered-location-class) + (depth number)) + (let ((length (get-length range))) +- (do-markup-range-open loccls length) +- (do-markup-locref (get-first range) loccls depth) +- (do-markup-range-sep loccls length) ++ (do-markup-range-open attr loccls length) ++ (do-markup-locref attr (get-first range) loccls depth) ++ (do-markup-range-sep attr loccls length) + (when (markup-range-print-end-p loccls length) +- (do-markup-locref (get-last range) loccls depth)) +- (do-markup-range-close loccls length))) ++ (do-markup-locref attr (get-last range) loccls depth)) ++ (do-markup-range-close attr loccls length))) + + (define-list-environment-methods do-markup-range +- ((loccls layered-location-class) (length number)) +- :open ((do-markup-default "RANGE:OPEN" (get-name loccls) length) ++ ((attr category-attribute) (loccls layered-location-class) (length number)) ++ :open ((do-markup-default "RANGE:OPEN" (get-name attr) (get-name loccls) length) + (do-markup-indent)) + :close ((do-markup-outdent) +- (do-markup-default "RANGE:CLOSE" (get-name loccls) length)) ++ (do-markup-default "RANGE:CLOSE" (get-name attr) (get-name loccls) length)) + :sep ((do-markup-default "RANGE:SEP" (get-name loccls) length))) + + (defmethod markup-range-print-end-p ((loccls layered-location-class) +@@ -947,7 +949,7 @@ T + ;; line 1002 "markup.nw" + (defmacro markup-range (&whole whole &rest args) + (destructuring-switch-bind (&key +- open close sep class length ++ open close sep class attr length + &switch ignore-end) + args + (cond +@@ -965,13 +967,20 @@ T + ((and class (progn (setq class (stringify class)) + (not (lookup-locref-class *indexstyle* class)))) + (nraw "parameter `~S' is not a location-reference class! (ignored)~%" class)) ++;; line 294 "markup.nw" ++((and attr (progn (setq attr (stringify attr)) ++ (not (lookup-catattr *indexstyle* attr)))) ++ (nraw "parameter `~S' is not an attribute! (ignored)~%" attr)) + ;; line 1009 "markup.nw" + ((and length (not (numberp length))) + (nraw "parameter `~S' is not a number! (ignored)~%" length)) + (t `(let () + (markup::define-list-environment-methods + DO-MARKUP-RANGE +- (,(if class ++ (,(if attr ++ `(attr (EQL ',(lookup-catattr *indexstyle* attr))) ++ '(attr category-attribute)) ++ ,(if class + `(locrefcls (EQL ',(cdr (lookup-locref-class + *indexstyle* class)))) + '(locrefcls layered-location-class)) +@@ -989,7 +998,7 @@ T + ,(if length + `(length (EQL ,length)) + '(length number))) +- :declare ((declare (ignore locrefcls length))) ++ :declare ((declare (ignore attr locrefcls length))) + :body (,(not ignore-end)))))))) + ;; line 1064 "markup.nw" + (defmacro markup-crossref-list (&key open sep close class) +-- +2.48.1 + + +From a16043102e3ff770698960eecc83e44b56abb816 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Joachim=20Mairb=C3=B6ck?= +Date: Thu, 17 Apr 2025 17:33:48 +0200 +Subject: =?UTF-8?q?handle=20hyperref=20\see=20and=20\seealso,=20from=20J?= + =?UTF-8?q?=C3=BCrgen=20S?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +patch from upstream TeXLive + +diff --git a/modules/base/makeindex.xdy b/modules/base/makeindex.xdy +index c859eca..94db4bb 100644 +--- a/modules/base/makeindex.xdy ++++ b/modules/base/makeindex.xdy +@@ -17,6 +17,11 @@ + (define-crossref-class "seealso") + (markup-crossref-list :class "seealso" :open "\seealso{" :sep "; " :close "}{}") + ++;; \hyperindexformat is a wrapper to \see and \seealso added by hyperref. ++;; We treat it like \see and \seealso ++(define-crossref-class "hyperindexformat" :unverified) ++(markup-crossref-list :class "hyperindexformat" :open "\hyperindexformat{" :sep "; " :close "}{}") ++ + ;; Subentries in cross references are seperated by comma for all + ;; crossref classes. + (markup-crossref-layer-list :sep ", ") +diff --git a/user-commands/texindy.in b/user-commands/texindy.in +index f876aba..653e51d 100644 +--- a/user-commands/texindy.in ++++ b/user-commands/texindy.in +@@ -308,14 +308,8 @@ behaviour. + + For more complex usage, when C is not an identifier, no such + compatibility definitions exist and may also not been created with +-current B. In particular, this means that by default the LaTeX +-package C will create raw index files that cannot be +-processed with B. This is not a bug, this is the unfortunate +-result of an intented incompatibility. It is currently not possible to +-get both hyperref's index links and use B. +- +-A similar situation is reported to exist for the C LaTeX +-class. ++current B. Such a situation is reported to exist for the ++C LaTeX class. + + Programmers who know Common Lisp and Lex and want to work on a remedy + should please contact the author. +diff --git a/user-commands/xindy.in b/user-commands/xindy.in +index 27af4b2..df52dd9 100644 +--- a/user-commands/xindy.in ++++ b/user-commands/xindy.in +@@ -260,14 +260,8 @@ behaviour. + + For more complex usage, when C is not an identifier, no such + compatibility definitions exist and may also not been created with +-current B. In particular, this means that by default the LaTeX +-package C will create raw index files that cannot be +-processed with B. This is not a bug, this is the unfortunate +-result of an intented incompatibility. It is currently not possible to +-get both hyperref's index links and use B. +- +-A similar situation is reported to exist for the C LaTeX +-class. ++current B. Such a situation is reported to exist for the ++C LaTeX class. + + Programmers who know Common Lisp and Lex and want to work on a remedy + should please contact the author. +-- +2.48.1 + + +From 3ce7c8d9f479a4e705aa886bc83dded65efc741b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Joachim=20Mairb=C3=B6ck?= +Date: Thu, 17 Apr 2025 17:36:20 +0200 +Subject: =?UTF-8?q?document=20:min-range-length=20none=20workaround,=20fro?= + =?UTF-8?q?m=20J=C3=BCrgen=20S?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +patch from upstream TeXLive + +diff --git a/doc/faq-4.html b/doc/faq-4.html +index 8105256..3a57b7a 100644 +--- a/doc/faq-4.html ++++ b/doc/faq-4.html +@@ -460,11 +460,12 @@ location references. For exmaple the sequence + the form +

+

+-  (define-location-class ... :min-range-length none)
++  (define-location-class ... :min-range-length 100000)
+ 
+-

The argument :min-range-length none avoids forming of ranges. +-Arbitrary numbers instead of none define the minimum length of a +-sequence of location references that are needed to form a range. ++

Arbitrary numbers define the minimum length of a sequence of location references that are needed to form a range. ++The use of a sufficiently large number (such as :min-range-length 100000) avoids forming of ranges ++(unless your document has more than 100.000 pages and an index entry spans all of them; in this unlikely case, just increase ++the number sufficiently). + xindys default value is 2. +

+

+diff --git a/doc/manual-3.html b/doc/manual-3.html +index ad2163e..10d4a72 100644 +--- a/doc/manual-3.html ++++ b/doc/manual-3.html +@@ -185,8 +185,8 @@ strings representing separators. Separators must follow the + keyword argument :sep. If the keyword :min-range-length is + specified we define the minimum range length to be used when + building ranges. The argument num must be a positive integer +-number or the keyword none in which case the building of ranges +-is disallowed. If the switch :var is specified the declared class ++number. Use a sufficiently large number (such as 10000) to disallow the building of ranges. ++If the switch :var is specified the declared class + is of type variable, i.e. it is a var-location-class. Since + building of ranges is currently only allowed for standard classes + :var and :min-range-length must not be used together. The +@@ -198,7 +198,7 @@ layers the hierarchy does contain. See command +

+

+   (define-location-class "page-numbers" ("arabic-numbers")
+-                         :minimum-range-length 3)
++                         :min-range-length 3)
+ 
+

Defines the location class page-numbers consisting of one layer + which is the alphabet arabic-numbers. Since the minimum +-- +2.48.1 + diff --git a/app-text/xindy/xindy-2.5.1.recipe b/app-text/xindy/xindy-2.5.1.recipe new file mode 100644 index 000000000..af51c2690 --- /dev/null +++ b/app-text/xindy/xindy-2.5.1.recipe @@ -0,0 +1,90 @@ +SUMMARY="A Flexible Indexing System" +DESCRIPTION="Xindy was developed after an impasse had been encountered in the attempt to complete \ +internationalisation of makeindex. +Xindy can be used to process indexes for documents marked up using (LA)TEX, Nroff family and \ +SGML-based languages. Xindy is highly configurable, both in markup terms and in terms of the \ +collating order of the text being processed." +HOMEPAGE="http://www.xindy.org/" +COPYRIGHT="2008–2014 Joachim Schrod" +LICENSE="GNU GPL v2" +REVISION="1" +SOURCE_URI="https://mirrors.ctan.org/indexing/xindy/base/xindy-$portVersion.tar.gz" +CHECKSUM_SHA256="2c8ee91db7217b5776b1ee5272dd259686f7ba3ec1d25c678f75a6c03fe9ba43" +PATCHES="xindy-$portVersion.patchset" + +ARCHITECTURES="all !x86_gcc2" +SECONDARY_ARCHITECTURES="x86" + +# On x86_gcc2 we don't want to install the commands in bin//, but in bin/. +commandSuffix=$secondaryArchSuffix +commandBinDir=$binDir +if [ "$targetArchitecture" = x86_gcc2 ]; then + commandSuffix= + commandBinDir=$prefix/bin +fi + +PROVIDES=" + xindy$secondaryArchSuffix = $portVersion + cmd:tex2xindy$commandSuffix + cmd:texindy$commandSuffix + cmd:xindy$commandSuffix + " +REQUIRES=" + haiku$secondaryArchSuffix + cmd:clisp + cmd:perl + tex:xindy + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + tex:infwarerr # needed for docs + tex:latex + # The following TeX packages are needed for creating tex formats: + # (because of texlive packaging, all hyphenation patterns are needed, + # the list contains one package from each collection) + tex:hyphen_afrikaans + tex:hyphen_ancientgreek + tex:hyphen_arabic + tex:hyphen_basque + tex:hyphen_belarusian + tex:hyphen_catalan + tex:hyphen_chinese + tex:hyphen_croatian + tex:hyphen_czech + tex:hyphen_english + tex:hyphen_german + tex:hyphen_italian + tex:hyphen_polish + tex:hyphen_portuguese + " +BUILD_PREREQUIRES=" + cmd:autoconf + cmd:automake + cmd:awk + cmd:clisp + cmd:gcc$secondaryArchSuffix + cmd:latex + cmd:make + cmd:perl + " + +defineDebugInfoPackage xindy$secondaryArchSuffix \ + "$commandBinDir"/tex2xindy + +BUILD() +{ + autoreconf -fi + runConfigure --omit-dirs binDir ./configure --bindir=$commandBinDir --enable-docs + make $jobArgs +} + +INSTALL() +{ + make install +} + +TEST() +{ + make check +}