summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlpostcode/xetex.pl
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2009-05-12 21:09:25 +0000
committerNorbert Preining <preining@logic.at>2009-05-12 21:09:25 +0000
commit37113f58fb13727c34f6db56ca23deff5a2e4c19 (patch)
tree07252f29a1e8693a92c22de7aa8b32e97138de13 /Master/tlpkg/tlpostcode/xetex.pl
parenta49e54529a48ac82058bc6aa2ac582cb2fe611c4 (diff)
move over the tlpsrc files from branch
git-svn-id: svn://tug.org/texlive/trunk@13063 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlpostcode/xetex.pl')
-rw-r--r--Master/tlpkg/tlpostcode/xetex.pl78
1 files changed, 78 insertions, 0 deletions
diff --git a/Master/tlpkg/tlpostcode/xetex.pl b/Master/tlpkg/tlpostcode/xetex.pl
new file mode 100644
index 00000000000..5f0456ae24c
--- /dev/null
+++ b/Master/tlpkg/tlpostcode/xetex.pl
@@ -0,0 +1,78 @@
+# $Id: xetex.pl 12367 2009-03-11 16:18:41Z preining $
+# post action for xetex
+# Copyright 2008, 2009 Norbert Preining
+# This file is licensed under the GNU General Public License version 2
+# or any later version.
+
+my $texdir;
+my $mode;
+
+BEGIN {
+ $^W = 1;
+ $mode = $ARGV[0];
+ $texdir = $ARGV[1];
+ # make Perl find our packages first:
+ unshift (@INC, "$texdir/tlpkg");
+}
+
+use TeXLive::TLUtils qw(win32 mkdirhier conv_to_w32_path log info);
+
+#
+# bin-installs font-config related stuff
+my $texmfsysvar = `kpsewhich -var-value=TEXMFSYSVAR`;
+if (-r "$texdir/bin/win32/conf/fonts.conf") {
+ # we have installed w32, so put it into texmfsysvar
+ mkdirhier("$texmfsysvar/fonts");
+ TeXLive::TLUtils::rmtree("$texmfsysvar/fonts/conf");
+ TeXLive::TLUtils::rmtree("$texmfsysvar/fonts/cache");
+ my @cpycmd;
+ if (win32()) {
+ push @cpycmd, "xcopy", "/e", "/i", "/q", "/y";
+ } else {
+ push @cpycmd, "cp", "-R";
+ }
+ system(@cpycmd,
+ (win32() ? conv_to_w32_path("$texdir/bin/win32/conf") :
+ "$texdir/bin/win32/conf"),
+ (win32() ? conv_to_w32_path("$texmfsysvar/fonts/conf") :
+ "$texmfsysvar/fonts/conf"));
+ system(@cpycmd,
+ (win32() ? conv_to_w32_path("$texdir/bin/win32/cache") :
+ "$texdir/bin/win32/cache"),
+ (win32() ? conv_to_w32_path("$texmfsysvar/fonts/cache") :
+ "$texmfsysvar/fonts/cache"));
+ if (open(FONTSCONF, "<$texdir/bin/win32/conf/fonts.conf")) {
+ my @lines = <FONTSCONF>;
+ close(FONTSCONF);
+ if (open(FONTSCONF, ">$texmfsysvar/fonts/conf/fonts.conf")) {
+ my $winfontdir;
+ if (win32()) {
+ $winfontdir = $ENV{'SystemRoot'}.'/fonts';
+ $winfontdir =~ s!\\!/!g;
+ }
+ foreach (@lines) {
+ $_ =~ s!c:/Program Files/texlive/$TeXLive::TLConfig::ReleaseYear!$texdir!;
+ $_ =~ s!c:/windows/fonts!$winfontdir! if win32();
+ print FONTSCONF;
+ }
+ close(FONTSCONF);
+ } else {
+ warn("Cannot open $texmfsysvar/fonts/conf/fonts.conf for writing\n");
+ }
+ } else {
+ warn("Cannot open $texdir/bin/win32/conf/fonts.conf\n");
+ }
+}
+# call fc-cache but only when we install on w32!
+if (win32()) {
+ info("Running fc-cache -v -r\n");
+ log(`fc-cache -v -r 2>&1`);
+ #system("fc-cache","-v", "-r");
+}
+
+### Local Variables:
+### perl-indent-level: 2
+### tab-width: 2
+### indent-tabs-mode: nil
+### End:
+# vim:set tabstop=2 expandtab: #