summaryrefslogtreecommitdiff
path: root/Master/tlpkg/libexec
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/libexec')
-rwxr-xr-xMaster/tlpkg/libexec/ctan2tds128
1 files changed, 80 insertions, 48 deletions
diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds
index dcff1297c51..16ef84ff144 100755
--- a/Master/tlpkg/libexec/ctan2tds
+++ b/Master/tlpkg/libexec/ctan2tds
@@ -4140,7 +4140,7 @@ sub xsystem {
#
sub exeext {
my ($platform) = @_;
- my $ext = $platform =~ /^(win[0-9]+|.*-cygwin)$/ ? ".exe" : "";
+ my $ext = $platform =~ /^(windows.*|.*-cygwin)$/ ? ".exe" : "";
return $ext;
}
@@ -6597,66 +6597,87 @@ sub POSTcontext {
print "POST$package - rearrange, remove\n";
&xchdir ($DEST);
+ # put files in context subdirs.
+ &mv_with_mkdir ("colors/icc/context", "tex/context/colors/icc");
+ &mv_with_mkdir ("README.adoc", "doc/context");
+
# clean up files Hans wants in his distribution but are confusing or
# problematic in TeX Live.
- &mv_with_mkdir ("colors/icc/context", "tex/context/colors/icc");
&SYSTEM ("$RM -rf colors"); # nonfree
&SYSTEM ("$RM -rf fonts/truetype/hoekwater/lm/");# lmtypewriter10-regular.ttf
&SYSTEM ("$RM -rf fonts/data/tests/"); # texmfhome.otf
+ &SYSTEM ("$RM -rf source"); # entire engine source
&SYSTEM ("$RM -rf web2c/"); # context*cnf*, texlive*cnf.lua
- &SYSTEM ("find -name koeiel\* -o -name jmn | xargs rm -rf");
+ # nonfree (first two) and unused (jmn) fonts.
+ &SYSTEM ("find -name \*koeiel\* -o -name \*lucida\* -o -name jmn"
+ . "| xargs rm -rfv");
- # remove mptopdf files, since they are in a separate package.
+ # mkii removals
+ &SYSTEM ("$RM -rf doc/context/scripts/mkii/");
+ &SYSTEM ("$RM -rf fonts/enc/");
+ &SYSTEM ("$RM -rf fonts/map/");
+ &SYSTEM ("$RM -rf scripts/context/ruby/");
+ &SYSTEM ("$RM -rf scripts/context/stubs/");
+ &SYSTEM ("$RM -rf tex/context/*/mkii/"); # base, fonts, etc.
+ &SYSTEM ("$RM -rf metapost/context/base/mpii/");
+
+ # mptopdf removals, since that is a separate package.
+ print "still POST$package - removing mptopdf since separate package\n";
chomp (my @mptopdf_files = `tlpfiles mptopdf | sed 's,[^/]*/,,'`);
&SYSTEM ("$RM -f @mptopdf_files ");
&SYSTEM ("$RM doc/context/scripts/mkii/mptopdf.man");
-
- print "still POST$package - user-level executables\n";
- # executables go in both the Master bin dir and the
- # Build linked_scripts dir. The executables are cherry-picked from
- # ConTeXt's stubs directory.
- my $w32_bindir = "$TOPDEST/bin/windows";
- &xmkdir ($w32_bindir);
- #
- my $pkg_subdir = "stubs/unix"; # where hans keeps them
- &xchdir ("$DEST/scripts/$package/$pkg_subdir");
- my @exec = ();
- for my $exec (qw(context contextjit luatools
- mtxrun mtxrunjit texexec texmfstart)) {
- &SYSTEM ("chmod a+x $exec");
- &bindirs_symlink ($exec);
- &build_scripts_copy ($exec, $pkg_subdir);
- &SYSTEM ("$CP ../mswin/$exec.exe $w32_bindir/");
- push (@exec, $exec);
+
+ print "still POST$package - copy user-level .lua to windows\n";
+ my $w_bindir = "$TOPDEST/bin/windows";
+ &xmkdir ($w_bindir);
+ # because bindirs_symlink uses cwd to determine the link:
+ &xchdir ("$DEST/scripts/$package/lua");
+ my @exec = qw(context mtxrun);
+ for my $exec (@exec) {
+ my $luafile = "$exec.lua";
+ # these should exist.
+ die "POSTcontext: no context lua file $luafile" unless -s $luafile;
+ &SYSTEM ("$CP $luafile $w_bindir/");
+ &bindirs_symlink ($luafile, $luafile);
}
- # mtxrun on Windows needs more than just the .exe.
- &xchdir ("../mswin");
- &SYSTEM ("$CP mtxrun.dll mtxrun.lua $w32_bindir/");
+ # but i386-netbsd is not supported.
+ my $i386_netbsd_bindir = "$TOPDEST/bin/i386-netbsd";
+ &SYSTEM ("$RM $i386_netbsd_bindir/context.lua");
+ &SYSTEM ("$RM $i386_netbsd_bindir/mtxrun.lua");
- print "still POST$package - man pages\n";
+ print "still POST$package - user-level executable man pages\n";
&xchdir ("$DEST/doc/$package/scripts");
my $mandest = "$TOPDEST/texmf-dist/doc/man/man1";
&xmkdir ($mandest);
for my $exec (@exec) {
- # man pages might be under mkii or mkiv, just check both.
- my $mansrc = (-r "mkii/$exec.man" ? "mkii/$exec.man" : "mkiv/$exec.man");
+ # we only want mkiv man pages
+ my $mansrc = "mkiv/$exec.man";
&SYSTEM ("$CP $mansrc $mandest/$exec.1");
}
+
+ print "still POST$package - mtx-*.man pages\n";
# In addition, there is mtx-*.man for subcommands in mkiv.
- &xchdir ("mkiv");
+ &xchdir ("$DEST/doc/$package/scripts/mkiv");
for my $mtxman (<mtx-*.man>) {
(my $mtxmanbase = $mtxman) =~ s/\.man$//;
&SYSTEM ("$CP $mtxman $mandest/$mtxmanbase.1");
}
&tl_man_to_pdf ();
+
+ # do last so man pages are there.
+ print "still POST$package - preserving binaries\n";
+ &POST_preserve_bin ("luametatex", "context", "mtxrun");
}
# Called for the ConTeXt scripts, though conceivably could be used for
# other things. Make a symlink in each Unix bindir (Windows is not
-# handled here) to EXEC, assuming its location is relative to pwd.
+# handled here) to EXEC, assuming its location is relative to cwd.
+#
+# If LINKNAME is not given, the symlink is named as the basename of EXEC
+# with any extension removed.
#
sub bindirs_symlink {
- my ($exec) = @_;
+ my ($exec,$linkname) = @_;
chomp (my $pwd = `pwd`);
(my $intermediate_dirs = $pwd) =~ s,^.*/$DEST_TREE/,,;
@@ -6664,11 +6685,16 @@ sub bindirs_symlink {
my $linktarget = "../../$DEST_TREE";
$linktarget .= "/$intermediate_dirs";
$linktarget .= "/$exec";
+ print ("\t bindirs_symlink: linktarget = $linktarget\n");
#
- (my $linkname = $exec) =~ s,.*/,,; # just the basename
- $linkname =~ s,\.[^./]+$,,; # rm extension too
+ if (! $linkname) {
+ ($linkname = $exec) =~ s,.*/,,; # just the basename
+ $linkname =~ s,\.[^./]+$,,; # rm extension too
+ }
+ print ("\t bindirs_symlink: linkname = $linkname\n");
chomp (my @platforms = `cd $Master/bin && ls`);
+ print ("\t bindirs_symlink: platforms = @platforms\n");
for my $p (@platforms) {
next if $p =~ /win32|windows/; # windows handled separately
next if $p eq "man"; # non-platform pain
@@ -6678,11 +6704,12 @@ sub bindirs_symlink {
}
}
-# Called both for ConTeXt and from doscripts: Update copy of EXEC under
-# Build/.../linked_scripts. If second arg INTERMEDIATE_DIRS is given
-# (done by ConTeXt), that path is appended under linked_scripts/. In
-# any case, just the basename of EXEC is used in the destination, and
-# the full EXEC, whatever it is, is used for the source of the copy.
+# Called both from doscripts and could be used for ConTeXt: Update copy
+# of EXEC under Build/.../linked_scripts. If second arg
+# INTERMEDIATE_DIRS is given (used to be done by ConTeXt), that path is
+# appended under linked_scripts/. In any case, just the basename of EXEC
+# is used in the destination, and the full EXEC, whatever it is, is used
+# for the source of the copy.
#
sub build_scripts_copy {
my ($exec,$intermediate_dirs) = @_;
@@ -7671,12 +7698,13 @@ sub POST_preserve_man {
&preserve_man_pages ($package);
}
-# Move .1 and .5 files from source dir to man dir (if needed), and make
-# our pdfs from them.
+# Move .1 and .5 files from SRC_MANDIR to installed man dir (if needed),
+# and make our pdfs from them.
#
-# has to be post instead of specialman when we use the tds.zip.
+# Has to be post instead of specialman when we use the tds.zip.
# Optional argument is directory where the man pages are as distributed
-# on CTAN, else doc/*/$package.
+# on CTAN, else doc/*/$package or similar.
+#
sub POST_do_man {
my ($src_mandir) = @_;
print "POST_do_man - src_mandir = $src_mandir\n";
@@ -7690,7 +7718,7 @@ sub POST_do_man {
} elsif (<$DEST/doc/$package/*.1>) {
$src_mandir = "doc/$package";
} else {
- warn ("$0: could not find man pages starting from " . `pwd`);
+ warn ("$0: POST_do_man: could not find man pages starting from " . `pwd`);
}
#
my $mandest = "$TOPDEST/texmf-dist/doc/man/man1";
@@ -7713,10 +7741,10 @@ sub POST_do_man {
sub POST_preserve_bin {
print "POST_preserve_bin - binaries = @_\n";
- # the pmx package, among others, includes binaries made from Build,
- # and normal scripts and support files. The latter can get updated
- # without needing to update the former, so we support it. Which means
- # preserving the binaries from the Build.
+ # The ConTeXt and pmx packages, among others, includes binaries made
+ # from Build, and normal scripts and support files. The latter can get
+ # updated without needing to update the former, so we support it.
+ # Which means preserving the binaries from the Build.
#
# The ctan2tds output will look weird since all the binaries will show
# up as new files, since they are in <pkg>.<platform> subpackages. And
@@ -7730,7 +7758,11 @@ sub POST_preserve_bin {
&xmkdir ($platdir);
my $exeext = &exeext ($p);
for my $b (@binaries) {
- &SYSTEM ("$CP $Master/bin/$p/$b$exeext $platdir/");
+ # use -a so we'll copy symlinks (context, mtxrun) without dereferencing.
+ # but on cygwin, no exeext for symlinks.
+ my $src = "$Master/bin/$p/$b";
+ $src .= "$exeext" unless -l $src;
+ &SYSTEM ("$CP -a $src $platdir/");
}
}