diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2009-12-09 12:33:13 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2009-12-09 12:33:13 +0000 |
commit | 8a20fd8b3ea6703dee539af1cb343d5bec026e5c (patch) | |
tree | c0e3f22c15e268187773ae39008644616ca8abea /Build | |
parent | fe29d6bdbb0557a4c09258320428a1427682d635 (diff) |
xindy-new update
git-svn-id: svn://tug.org/texlive/trunk@16335 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
6 files changed, 228 insertions, 40 deletions
diff --git a/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/ChangeLog b/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/ChangeLog index 960d66ff256..86a4a1748a7 100644 --- a/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/ChangeLog +++ b/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/ChangeLog @@ -1,3 +1,11 @@ +2009-12-09 Peter Breitenlohner <peb@mppmu.mpg.de> + + * patch-20-TL-install-dirs: For TL, do not substitute @libdir@. + * patch-22-TL-xindy_pl (new): Adapt xindy perl script for use + in TL (still incomplete). Adapting code from + Vladimir Volovich <vvv@vsu.ru> (TL2008/09 version) and + Tomek T <t34www@googlemail.com>. + 2009-12-07 Peter Breitenlohner <peb@mppmu.mpg.de> * patch-21-TL-no-date (new): Avoid date in latin.xdy. diff --git a/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-20-TL-install-dirs b/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-20-TL-install-dirs index 5ffca247260..103ef772f61 100644 --- a/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-20-TL-install-dirs +++ b/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-20-TL-install-dirs @@ -1,9 +1,11 @@ Installation paths for TL and standalone builds. + For TL we do not want to substitute the value of $(libdir). + ToDo: - Determination of libdir and moduledir in the xindy perl script. + Determination of lib_dir and modules_dir in the xindy perl script. -diff -ur -x Makefile.in xindy.orig/configure.ac xindy/configure.ac +diff -ur -x Makefile.in -x autom4te.cache xindy.orig/configure.ac xindy/configure.ac --- xindy.orig/configure.ac 2009-12-03 11:52:02.000000000 +0100 +++ xindy/configure.ac 2009-12-03 11:59:47.000000000 +0100 @@ -35,6 +35,11 @@ @@ -26,7 +28,7 @@ diff -ur -x Makefile.in xindy.orig/configure.ac xindy/configure.ac # Check system type AC_CANONICAL_HOST -diff -ur -x Makefile.in xindy.orig/src/Makefile.am xindy/src/Makefile.am +diff -ur -x Makefile.in -x autom4te.cache xindy.orig/src/Makefile.am xindy/src/Makefile.am --- xindy.orig/src/Makefile.am 2009-12-03 11:53:59.000000000 +0100 +++ xindy/src/Makefile.am 2009-12-03 12:00:48.000000000 +0100 @@ -26,7 +26,7 @@ @@ -38,18 +40,19 @@ diff -ur -x Makefile.in xindy.orig/src/Makefile.am xindy/src/Makefile.am # Tell the dist target about our sources, define the object files for # our own rule and the .lib files for the clean definition. Don't use -diff -ur -x Makefile.in xindy.orig/user-commands/Makefile.am xindy/user-commands/Makefile.am +diff -ur -x Makefile.in -x autom4te.cache xindy.orig/user-commands/Makefile.am xindy/user-commands/Makefile.am --- xindy.orig/user-commands/Makefile.am 2009-12-03 01:31:28.000000000 +0100 -+++ xindy/user-commands/Makefile.am 2009-12-03 11:59:47.000000000 +0100 -@@ -20,7 +20,39 @@ ++++ xindy/user-commands/Makefile.am 2009-12-08 22:55:09.000000000 +0100 +@@ -20,10 +20,46 @@ ## Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ## Boston, MA 02110-1301 USA. -bin_SCRIPTS = texindy xindy xindy.v2 +scripts = texindy xindy + -+if TEXLIVE_BUILD +bin_SCRIPTS = ++ ++if TEXLIVE_BUILD +noinst_SCRIPTS = $(scripts) +scriptspath = texmf/scripts/xindy +scriptsdir = ${prefix}/$(scriptspath) @@ -76,9 +79,15 @@ diff -ur -x Makefile.in xindy.orig/user-commands/Makefile.am xindy/user-commands + rm -f $(DESTDIR)$(bindir)/$$f; \ + rm -f $(DESTDIR)$(scriptsdir)/$$f.pl; \ + done ++ ++xindy: xindy.in ++ cat $(srcdir)/xindy.in >xindy +else !TEXLIVE_BUILD +bin_SCRIPTS = $(scripts) xindy.v2 -+endif !TEXLIVE_BUILD xindy: xindy.in Makefile sed -e 's:@libdir\@:$(libdir):' $(srcdir)/xindy.in >xindy ++endif !TEXLIVE_BUILD + + xindy.v2: xindy.v2.in + cat $(srcdir)/xindy.v2.in >xindy.v2 diff --git a/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-22-TL-xindy_pl b/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-22-TL-xindy_pl new file mode 100644 index 00000000000..3873a03d233 --- /dev/null +++ b/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-22-TL-xindy_pl @@ -0,0 +1,132 @@ + Determine lib_dir and modules_dir in the xindy perl script. + + ToDo: + Modify call_xindy() to use "$xindy_run" if it exists. + +diff -ur -x Makefile.in -x autom4te.cache xindy.orig/user-commands/xindy.in xindy/user-commands/xindy.in +--- xindy.orig/user-commands/xindy.in 2009-12-03 01:27:06.000000000 +0100 ++++ xindy/user-commands/xindy.in 2009-12-09 11:50:09.000000000 +0100 +@@ -286,10 +286,58 @@ + # Determine environment. Where is our library directory, and our modules? + + use File::Basename; ++use Cwd; ++our ($isW32, $r0, $xindy_run); + our ($cmd_dir, $cmd, $lib_dir, $modules_dir); + BEGIN { +- $cmd_dir = dirname($0); +- $cmd = basename($0); ++ $isW32 = ($^O =~ /^MSWin/i) ? 1 : 0; ++ $r0 = Cwd::realpath($0); ++ $cmd = basename($r0); ++ ++ # FIXME: make two subroutines for TL2010 and !TL2010 part ++ ++ if ($cmd eq "xindy.pl") { # TL2010 ++ ++ $r0 = $0; ++ my $rcmd_dir = dirname($0); ++ $cmd = basename($0); ++ ++ if ($isW32) { ++ $cmd_dir = "$rcmd_dir/../../../bin/win32"; ++ } else { ++ $cmd_dir = $rcmd_dir; ++ my $rcmd = $cmd; ++ # Follow symlinks, but remember last one ++ while (-l $r0) { ++ $cmd_dir = $rcmd_dir; ++ $cmd = $rcmd; ++ $r0 = readlink($r0); ++ $r0 = "$cmd_dir/$r0" unless $r0 =~ m,^[\\/],; # relative link ++ $rcmd_dir = dirname($r0); ++ $rcmd = basename($r0); ++ } ++ # Now $r0 = $rcmd_dir/$rcmd is a real file (no symlink) and ++ # $cmd_dir/$cmd is either = $0 = $r0, or a symlink -> $r0. ++ } ++ ++ $modules_dir = "$rcmd_dir/../../xindy/modules"; ++ die "$cmd: Cannot locate xindy modules directory" unless -d $modules_dir; ++ ++ $lib_dir = $cmd_dir; ++ ++ if ($isW32 || $^O eq "cygwin") { ++ $xindy_run = "$lib_dir/xindy-lisp.exe"; ++ } else { ++ $xindy_run = "$lib_dir/xindy.run"; ++ } ++ # FIXME: what I really want to do is 'undefine' or 'delete' ++ $xindy_run = "" unless -e $xindy_run; ++ ++ # FIXME: modify call_xindy() to use "$xindy_run" if it exists ++ ++ } else { # !TL2010 ++ ++ $cmd_dir = dirname($r0); + + # library directory + if ( $ENV{XINDY_LIBDIR} ) { +@@ -316,6 +364,7 @@ + } else { + die "$cmd: Cannot locate xindy modules directory"; + } ++ } # !TL2010 + } + + +@@ -324,6 +373,7 @@ + use Getopt::Long qw(:config bundling); + use File::Temp qw(tempfile tmpnam); + use File::Spec; ++use POSIX qw(uname); + + + # Check arguments, store them in proper variables. +@@ -368,15 +418,31 @@ + $outfile, $logfile, $language, @codepages, @modules, $input_markup, + $interactive, $mem_file); + $input_markup = 'latex'; ++ + $mem_file = "$lib_dir/xindy.mem"; ++if ($^O eq 'darwin' && ! -e $mem_file) { # support universal binary on mac ++ my @uname = POSIX::uname(); ++ if ($uname[4] eq 'Power Macintosh') { ++ $mem_file = "$lib_dir/xindy-ppc.mem"; ++ } else { ++ $mem_file = "$lib_dir/xindy-i386.mem"; ++ } ++} ++die "$cmd: Cannot locate $mem_file" unless -e $mem_file; + + my @orig_argv = @ARGV; + parse_options(); + +-if ( @ARGV == 2 ) { +- if ( $ARGV[0] =~ /\.xdy$/ ) { +- exec "$cmd_dir/xindy.v2", @orig_argv; +- } ++if ( @ARGV == 2 && $ARGV[0] =~ /\.xdy$/ ) { ++ print STDERR <<EOF; ++$cmd: deprecated calling convention detected. ++Please change your command to ++ ++$cmd -I xindy -M $ARGV[0] $ARGV[1] ++ ++Run "$cmd --help" for full list of options, or read the documentation. ++EOF ++ exit 1; + } + + +@@ -711,7 +777,9 @@ + sub output_xindy_release () { + my $version = 'unknown'; + my $version_file; +- if ( -f "$cmd_dir/../VERSION" ) { ++ if ( -f "$modules_dir/../VERSION" ) { ++ $version_file = "$modules_dir/../VERSION"; ++ } elsif ( -f "$cmd_dir/../VERSION" ) { + $version_file = "$cmd_dir/../VERSION"; + } elsif ( -f "$lib_dir/VERSION" ) { + $version_file = "$lib_dir/VERSION"; diff --git a/Build/source/utils/xindy-new/xindy/user-commands/Makefile.am b/Build/source/utils/xindy-new/xindy/user-commands/Makefile.am index ba066c642e2..edc8376df7a 100644 --- a/Build/source/utils/xindy-new/xindy/user-commands/Makefile.am +++ b/Build/source/utils/xindy-new/xindy/user-commands/Makefile.am @@ -22,8 +22,9 @@ scripts = texindy xindy -if TEXLIVE_BUILD bin_SCRIPTS = + +if TEXLIVE_BUILD noinst_SCRIPTS = $(scripts) scriptspath = texmf/scripts/xindy scriptsdir = ${prefix}/$(scriptspath) @@ -50,12 +51,15 @@ uninstall-hook: rm -f $(DESTDIR)$(bindir)/$$f; \ rm -f $(DESTDIR)$(scriptsdir)/$$f.pl; \ done + +xindy: xindy.in + cat $(srcdir)/xindy.in >xindy else !TEXLIVE_BUILD bin_SCRIPTS = $(scripts) xindy.v2 -endif !TEXLIVE_BUILD xindy: xindy.in Makefile sed -e 's:@libdir\@:$(libdir):' $(srcdir)/xindy.in >xindy +endif !TEXLIVE_BUILD xindy.v2: xindy.v2.in cat $(srcdir)/xindy.v2.in >xindy.v2 diff --git a/Build/source/utils/xindy-new/xindy/user-commands/Makefile.in b/Build/source/utils/xindy-new/xindy/user-commands/Makefile.in index bd1ec4f73db..5c062e001bd 100644 --- a/Build/source/utils/xindy-new/xindy/user-commands/Makefile.in +++ b/Build/source/utils/xindy-new/xindy/user-commands/Makefile.in @@ -181,7 +181,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ scripts = texindy xindy @TEXLIVE_BUILD_FALSE@bin_SCRIPTS = $(scripts) xindy.v2 -@TEXLIVE_BUILD_TRUE@bin_SCRIPTS = +bin_SCRIPTS = @TEXLIVE_BUILD_TRUE@noinst_SCRIPTS = $(scripts) @TEXLIVE_BUILD_TRUE@scriptspath = texmf/scripts/xindy @TEXLIVE_BUILD_TRUE@scriptsdir = ${prefix}/$(scriptspath) @@ -487,8 +487,11 @@ uninstall-man: uninstall-man1 @TEXLIVE_BUILD_TRUE@ rm -f $(DESTDIR)$(scriptsdir)/$$f.pl; \ @TEXLIVE_BUILD_TRUE@ done -xindy: xindy.in Makefile - sed -e 's:@libdir\@:$(libdir):' $(srcdir)/xindy.in >xindy +@TEXLIVE_BUILD_TRUE@xindy: xindy.in +@TEXLIVE_BUILD_TRUE@ cat $(srcdir)/xindy.in >xindy + +@TEXLIVE_BUILD_FALSE@xindy: xindy.in Makefile +@TEXLIVE_BUILD_FALSE@ sed -e 's:@libdir\@:$(libdir):' $(srcdir)/xindy.in >xindy xindy.v2: xindy.v2.in cat $(srcdir)/xindy.v2.in >xindy.v2 diff --git a/Build/source/utils/xindy-new/xindy/user-commands/xindy.in b/Build/source/utils/xindy-new/xindy/user-commands/xindy.in index 1cdc662f3e7..f6c34b56f41 100644 --- a/Build/source/utils/xindy-new/xindy/user-commands/xindy.in +++ b/Build/source/utils/xindy-new/xindy/user-commands/xindy.in @@ -287,43 +287,58 @@ BEGIN { use File::Basename; use Cwd; -our ($cmd_dir, $cmd, $rcmd_dir, $rcmd, $xindy_run, $lib_dir, $modules_dir, $path_sep); +our ($isW32, $r0, $xindy_run); +our ($cmd_dir, $cmd, $lib_dir, $modules_dir); BEGIN { - $cmd_dir = dirname($0); - $cmd = basename($0); + $isW32 = ($^O =~ /^MSWin/i) ? 1 : 0; + $r0 = Cwd::realpath($0); + $cmd = basename($r0); - my $rcmd_path = Cwd::realpath($0); - $rcmd_dir = dirname($rcmd_path); - $rcmd = basename($rcmd_path); + # FIXME: make two subroutines for TL2010 and !TL2010 part - if ($rcmd eq "xindy.pl") { # TL2010 + if ($cmd eq "xindy.pl") { # TL2010 - if ($^O eq "MSWin32" || $^O eq "cygwin") { - $xindy_run = "xindy-lisp.exe"; - $path_sep = ";"; + $r0 = $0; + my $rcmd_dir = dirname($0); + $cmd = basename($0); + + if ($isW32) { + $cmd_dir = "$rcmd_dir/../../../bin/win32"; } else { - $xindy_run = "xindy.run"; - $path_sep = ":"; + $cmd_dir = $rcmd_dir; + my $rcmd = $cmd; + # Follow symlinks, but remember last one + while (-l $r0) { + $cmd_dir = $rcmd_dir; + $cmd = $rcmd; + $r0 = readlink($r0); + $r0 = "$cmd_dir/$r0" unless $r0 =~ m,^[\\/],; # relative link + $rcmd_dir = dirname($r0); + $rcmd = basename($r0); + } + # Now $r0 = $rcmd_dir/$rcmd is a real file (no symlink) and + # $cmd_dir/$cmd is either = $0 = $r0, or a symlink -> $r0. } + $modules_dir = "$rcmd_dir/../../xindy/modules"; - die "$cmd: Cannot locate xindy modules directory" if ! -d $modules_dir; + die "$cmd: Cannot locate xindy modules directory" unless -d $modules_dir; - if ($^O eq "MSWin32") { - $lib_dir = "$cmd_dir/../../../bin/win32"; # TL2010 woe32 + $lib_dir = $cmd_dir; + + if ($isW32 || $^O eq "cygwin") { + $xindy_run = "$lib_dir/xindy-lisp.exe"; } else { - # FIXME: this fails for symlink -> bin/ARCH/xindy - # should follow all but last symlink and recompute $cmd_dir - $lib_dir = $cmd_dir; + $xindy_run = "$lib_dir/xindy.run"; } - die "$cmd: Cannot locate xindy.mem" if ! -f "$lib_dir/xindy.mem"; + # FIXME: what I really want to do is 'undefine' or 'delete' + $xindy_run = "" unless -e $xindy_run; - # TODO: drop xindy.v2 (only for TL?) - # TODO: modify call_xindy() to use "$lib_dir/$xindy_run" if it exists - # TODO: maybe drop $path_sep - # TODO: maybe two subroutines for TL2010 and !TL2010 part + # FIXME: modify call_xindy() to use "$xindy_run" if it exists } else { # !TL2010 + $cmd_dir = dirname($r0); + # library directory if ( $ENV{XINDY_LIBDIR} ) { $lib_dir = $ENV{XINDY_LIBDIR}; @@ -358,6 +373,7 @@ BEGIN { use Getopt::Long qw(:config bundling); use File::Temp qw(tempfile tmpnam); use File::Spec; +use POSIX qw(uname); # Check arguments, store them in proper variables. @@ -402,15 +418,31 @@ our ($quiet, $verbose, %debug, $outfile, $logfile, $language, @codepages, @modules, $input_markup, $interactive, $mem_file); $input_markup = 'latex'; + $mem_file = "$lib_dir/xindy.mem"; +if ($^O eq 'darwin' && ! -e $mem_file) { # support universal binary on mac + my @uname = POSIX::uname(); + if ($uname[4] eq 'Power Macintosh') { + $mem_file = "$lib_dir/xindy-ppc.mem"; + } else { + $mem_file = "$lib_dir/xindy-i386.mem"; + } +} +die "$cmd: Cannot locate $mem_file" unless -e $mem_file; my @orig_argv = @ARGV; parse_options(); -if ( @ARGV == 2 ) { - if ( $ARGV[0] =~ /\.xdy$/ ) { - exec "$cmd_dir/xindy.v2", @orig_argv; - } +if ( @ARGV == 2 && $ARGV[0] =~ /\.xdy$/ ) { + print STDERR <<EOF; +$cmd: deprecated calling convention detected. +Please change your command to + +$cmd -I xindy -M $ARGV[0] $ARGV[1] + +Run "$cmd --help" for full list of options, or read the documentation. +EOF + exit 1; } |