texlive[53309] Master/tlpkg: * TLPSRC.pm (from_file): also expand

commits+karl at tug.org commits+karl at tug.org
Fri Jan 3 19:32:13 CET 2020


Revision: 53309
          http://tug.org/svn/texlive?view=revision&revision=53309
Author:   karl
Date:     2020-01-03 19:32:13 +0100 (Fri, 03 Jan 2020)
Log Message:
-----------
* TLPSRC.pm (from_file): also expand global ${wndws} as super-special case.
(make_tlpobj): expand global tlpvars in patterns too.
(find_default_patterns): allow wndws.
* 00texlive.autopatterns.tlpsrc (wndws): define, as a first step towards
  also supporting w64.
* 00texlive.installer.tlpsrc: use it.

* 00texlive.autopatterns.tlpsrc (global_no_luajit_platforms): define since
  we now support global vars in patterns.
* luajittex.tlpsrc,
* mflua.tlpsrc: use it.

Modified Paths:
--------------
    trunk/Master/tlpkg/TeXLive/TLPSRC.pm
    trunk/Master/tlpkg/tlpsrc/00texlive.autopatterns.tlpsrc
    trunk/Master/tlpkg/tlpsrc/00texlive.installer.tlpsrc
    trunk/Master/tlpkg/tlpsrc/luajittex.tlpsrc
    trunk/Master/tlpkg/tlpsrc/mflua.tlpsrc

Modified: trunk/Master/tlpkg/TeXLive/TLPSRC.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLPSRC.pm	2020-01-03 00:54:19 UTC (rev 53308)
+++ trunk/Master/tlpkg/TeXLive/TLPSRC.pm	2020-01-03 18:32:13 UTC (rev 53309)
@@ -143,12 +143,12 @@
       # check that no variables remain unexpanded, or rather, for any
       # remaining $ (which we don't otherwise allow in tlpsrc files, so
       # should never occur) ... except for ${ARCH} which we specially
-      # expand in TLTREE.pm, and ${global_*} which need to be defined in
-      # 00texlive.autopatterns.tlpsrc. (We distribute one file dvi$pdf.bat,
-      # but fortunately it is matched by a directory.)
+      # expand in TLTREE.pm, and ${global_*} (and ${wndws}) which need to
+      # be defined in 00texlive.autopatterns.tlpsrc. (We distribute one
+      # file dvi$pdf.bat, but fortunately it is matched by a directory.)
       # 
       (my $testline = $line) =~ s,\$\{ARCH\},,g;
-      $testline =~ s,\$\{global_[^}]*\},,g;
+      $testline =~ s,\$\{(global_[^}]*|wndws)\},,g;
       $testline =~ /\$/
         && die "$srcfile:$lineno: variable undefined or syntax error: $line\n";
       #debug: warn "new line $line, from $origline\n" if $origline ne $line;
@@ -363,6 +363,11 @@
     @autoaddpat = ();
     $usedefault = 1;
     foreach my $p (@{$self->{${pattype} . 'patterns'}}) {
+      # Expansion of ${global_...} variables from autopatterns.
+      for my $key (keys %global_tlpvars) {
+        $p =~ s/\$\{\Q$key\E\}/$global_tlpvars{$key}/g;
+      }
+      
       if ($p =~ m/^a\s+(.*)\s*$/) {
         # format 
         #   a toplevel1 toplevel2 toplevel3 ...
@@ -559,7 +564,7 @@
 # 
 # The returned hash has an additional key C<tlpvars> for global tlpsrc
 # variables, which can be used in any C<.tlpsrc> files. The names of these
-# variables all start with C<global_>.
+# variables all start with C<global_>, except for super-special ${wndws}.
 # 
 # =cut 
 # (all doc at bottom, let's not rewrite now.)
@@ -618,7 +623,7 @@
   # check defined variables to ensure their names start with "global_".
   my %gvars = %{$tlsrc->_tlpvars};
   for my $v (keys %gvars) {
-    if ($v !~ /^global_[-_a-zA-Z0-9]+$/) {
+    if ($v !~ /^(global_[-_a-zA-Z0-9]+|wndws)$/) {
       tlwarn("$apfile: variable does not start with global_: $v\n")
         unless $v eq "PKGNAME";
         # the auto-defined PKGNAME is not expected to be global.
@@ -972,9 +977,10 @@
 Ordinarily, variables can be used only within the C<.tlpsrc> file where
 they are defined. There is one exception: global tlpsrc variables can be
 defined in the C<00texlive.autopatterns.tlpsrc> file (mentioned below);
-their names must start with C<global_>, and can only be used in
-C<depend> and C<execute> directives, or another C<tlpsetvar>. For
-example, our C<autopatterns.tlpsrc> defines:
+their names must start with C<global_> (plus super-special C<wndws>),
+and can only be used in C<depend>, C<execute>, and C<...pattern>
+directives, another C<tlpsetvar>. For example, our
+C<autopatterns.tlpsrc> defines:
 
   tlpsetvar global_latex_deps babel,cm,hyphen-base,latex-fonts
 

Modified: trunk/Master/tlpkg/tlpsrc/00texlive.autopatterns.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/00texlive.autopatterns.tlpsrc	2020-01-03 00:54:19 UTC (rev 53308)
+++ trunk/Master/tlpkg/tlpsrc/00texlive.autopatterns.tlpsrc	2020-01-03 18:32:13 UTC (rev 53309)
@@ -23,6 +23,15 @@
 tlpsetvar global_luatex_deps cm,etex,hyphen-base,knuth-lib,plain,\
 tex-ini-files,unicode-data
 #
+# Platforms that don't support jit.
+tlpsetvar global_no_luajit_platforms x86_64-solaris
+#
+# We define the Windows platform names here, so we can use ${wndws} in
+# the patterns, in preparation for supporting w64 in addition to w32,
+# and perhaps others in the future. The name ${global_wndws} was just
+# too long, so we made a super-special case in the code.
+tlpsetvar wndws win32
+
 # It would be ideal to be able to specify the non-jit platforms here,
 # but it's not crucial, so we haven't implemented ${global_} expansion
 # in binpatterns.

Modified: trunk/Master/tlpkg/tlpsrc/00texlive.installer.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/00texlive.installer.tlpsrc	2020-01-03 00:54:19 UTC (rev 53308)
+++ trunk/Master/tlpkg/tlpsrc/00texlive.installer.tlpsrc	2020-01-03 18:32:13 UTC (rev 53309)
@@ -24,14 +24,14 @@
 runpattern !f tlpkg/installer/tar.exe
 #
 # Windows only:
-binpattern d/win32 tlpkg/tlperl
-binpattern f/win32 tlpkg/tltcl/tclkit.exe
-binpattern f/win32 tlpkg/tltcl/tclkit.exe.manifest
-binpattern f/win32 tlpkg/installer/tar.exe
-binpattern f/win32 tlpkg/installer/wget/wget.exe
-binpattern f/win32 tlpkg/installer/xz/xz.exe
-binpattern f/win32 install-tl-windows.bat
-binpattern f/win32 install-tl-advanced.bat
+binpattern d/${wndws} tlpkg/tlperl
+binpattern f/${wndws} tlpkg/tltcl/tclkit.exe
+binpattern f/${wndws} tlpkg/tltcl/tclkit.exe.manifest
+binpattern f/${wndws} tlpkg/installer/tar.exe
+binpattern f/${wndws} tlpkg/installer/wget/wget.exe
+binpattern f/${wndws} tlpkg/installer/xz/xz.exe
+binpattern f/${wndws} install-tl-windows.bat
+binpattern f/${wndws} install-tl-advanced.bat
 #
 # xz binaries for all
 binpattern f tlpkg/installer/xz/xz.${ARCH}

Modified: trunk/Master/tlpkg/tlpsrc/luajittex.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/luajittex.tlpsrc	2020-01-03 00:54:19 UTC (rev 53308)
+++ trunk/Master/tlpkg/tlpsrc/luajittex.tlpsrc	2020-01-03 18:32:13 UTC (rev 53309)
@@ -1,13 +1,10 @@
 category TLCore
 shortdesc LuaTeX with just-in-time (jit) compiler
 
-# must keep in sync with mflua.tlpsrc.
-tlpsetvar no_luajit_platforms x86_64-solaris
+binpattern f/!${global_no_luajit_platforms} bin/${ARCH}/luajittex
+binpattern f/!${global_no_luajit_platforms} bin/${ARCH}/texluajit
+binpattern f/!${global_no_luajit_platforms} bin/${ARCH}/texluajitc
 #
-binpattern f/!${no_luajit_platforms} bin/${ARCH}/luajittex
-binpattern f/!${no_luajit_platforms} bin/${ARCH}/texluajit
-binpattern f/!${no_luajit_platforms} bin/${ARCH}/texluajitc
-#
 binpattern f bin/win32/luajit51.dll
 binpattern f bin/win32/luajittex.dll
 #

Modified: trunk/Master/tlpkg/tlpsrc/mflua.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/mflua.tlpsrc	2020-01-03 00:54:19 UTC (rev 53308)
+++ trunk/Master/tlpkg/tlpsrc/mflua.tlpsrc	2020-01-03 18:32:13 UTC (rev 53309)
@@ -3,9 +3,6 @@
 longdesc For information on this Lua-enabled Metafont,
 longdesc see, for example: tug.org/TUGboat/tb32-2/tb101scarso.pdf.
 
-# must keep in sync with luatex.tlpsrc.
-tlpsetvar no_luajit_platforms x86_64-solaris
-
 # disabled until there is a user base.
 tlpsetvar fmtdeps luatex,metafont
 execute AddFormat name=mflua engine=mflua-nowin options="mf.ini" \
@@ -17,8 +14,8 @@
 binpattern f bin/${ARCH}/mflua
 binpattern f bin/${ARCH}/mflua-nowin
 
-binpattern f/!${no_luajit_platforms} bin/${ARCH}/mfluajit
-binpattern f/!${no_luajit_platforms} bin/${ARCH}/mfluajit-nowin
+binpattern f/!${global_no_luajit_platforms} bin/${ARCH}/mfluajit
+binpattern f/!${global_no_luajit_platforms} bin/${ARCH}/mfluajit-nowin
 
 # need metafont for support files, luatex for dll's, etc.
 depend metafont



More information about the tex-live-commits mailing list