summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/support
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-10-17 20:39:55 +0000
committerKarl Berry <karl@freefriends.org>2018-10-17 20:39:55 +0000
commitc4b3fe8be2d6c5e856eb3629430e2e177fd7c2db (patch)
treef69d22a2e6560326dfcfbbd3deec69d3b61c550d /Master/texmf-dist/source/support
parentf5112bd8d60b74a14f806899d414c8142393529d (diff)
latex-make (17oct18)
git-svn-id: svn://tug.org/texlive/trunk@48925 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/support')
-rw-r--r--Master/texmf-dist/source/support/latex-make/figlatex.dtx3
-rw-r--r--Master/texmf-dist/source/support/latex-make/latex-make.dtx149
-rw-r--r--Master/texmf-dist/source/support/latex-make/pdfswitch.dtx2
-rw-r--r--Master/texmf-dist/source/support/latex-make/texdepends.dtx23
4 files changed, 130 insertions, 47 deletions
diff --git a/Master/texmf-dist/source/support/latex-make/figlatex.dtx b/Master/texmf-dist/source/support/latex-make/figlatex.dtx
index 59f28cec92a..bf0e727b513 100644
--- a/Master/texmf-dist/source/support/latex-make/figlatex.dtx
+++ b/Master/texmf-dist/source/support/latex-make/figlatex.dtx
@@ -28,7 +28,7 @@
%<compat> \ProvidesPackage{texgraphicx}%
% \fi
% \ProvidesFile{figlatex.dtx}
-[2018/09/04 v2.2.5 No changes in figlatex.dtx]
+[2018/10/17 v2.3.0 No changes in figlatex.dtx]
% \iffalse
%<*driver>
\documentclass{ltxdoc}
@@ -113,6 +113,7 @@
% \changes{v2.2.4}{2018/05/29}{Add missing required package 'ifthen'}
% \changes{v2.2.4}{2018/05/29}{Fix python syntax for python3}
% \changes{v2.2.5}{2018/09/04}{No changes in figlatex.dtx}
+% \changes{v2.2.5}{2018/10/17}{No changes in figlatex.dtx}
%
% \makeatletter
% \def\SpecialOptionIndex#1{\@bsphack
diff --git a/Master/texmf-dist/source/support/latex-make/latex-make.dtx b/Master/texmf-dist/source/support/latex-make/latex-make.dtx
index e0862cbcfb1..b7fa836658f 100644
--- a/Master/texmf-dist/source/support/latex-make/latex-make.dtx
+++ b/Master/texmf-dist/source/support/latex-make/latex-make.dtx
@@ -2,7 +2,7 @@
%
%<*dtx>
\ProvidesFile{latex-make.dtx}
-[2018/09/04 v2.2.5 fix output format of figdepth.py]
+[2018/10/17 v2.3.0 handle TDS for local install]
%</dtx>
% \fi
% \iffalse
@@ -30,7 +30,7 @@
\g@addto@macro{\IndexParms}{\hbadness=10000}
\g@addto@macro{\GlossaryParms}{\hbadness=10000}
\makeatother
-\newenvironment{source}[1][.8\linewidth]{%
+\newenvironment{source}[1][.9\linewidth]{%
\begin{center}%
\begin{boxedminipage}[c]{#1}\tt%
\vspace{1em}%
@@ -101,7 +101,7 @@
% documents with the help of a Makefile. Dependencies are
% automatically tracked with the help of the |texdepends.sty| package.
% \end{abstract}
-% \CheckSum{332}
+% \CheckSum{344}
%
% \changes{v2.0.0}{2006/03/09}{First autocommented version}
% \changes{v2.1.0}{2008/01/28}{That's the question}
@@ -113,6 +113,8 @@
% \changes{v2.2.3}{2017/01/08}{Add LuaLaTeX support}
% \changes{v2.2.4}{2018/05/29}{Fix directory permissions on install}
% \changes{v2.2.5}{2018/09/04}{fix output format of figdepth.py}
+% \changes{v2.3.0}{2018/10/17}{Add DEPENDS-EXCLUDE, add doc and
+% support for local texmf tree}
%
% \makeatletter
% \def\SpecialOptionIndex#1{\@bsphack
@@ -222,17 +224,65 @@
% If you work with other people that do not have installed (and do not
% want to install) \LaTeX-Make, you can use the
% |LaTeX-Make-local-install| target in |LaTeX.mk| to install required
-% files locally in the current directory. You can them commit these
-% files into your control version system so all co-authors will be
-% able to use \LaTeX-Make without installing it.
-% However, note that:
+% files in a local TEXMF tree. You can them commit this
+% tree into your control version system. Then, in your |Makefile|,
+% replace the single line\par
+% \begin{source}
+% include LaTeX.mk
+% \end{source}
+% with something like\par
+% \begin{source}\small
+% export TEXMFHOME:=\$(CURDIR)/relpath/to/local/tree/texmf\\
+% include \$(shell env TEXMFHOME=\$(TEXMFHOME) $\backslash$\\
+% \hspace*{12ex}kpsewhich -format texmfscripts LaTeX.mk)
+% \end{source}
+% If you have a previous value for |TEXMFHOME| that you do not want to
+% override, you can use the following (more complexe) snipset\par
+% \begin{source}\small
+% \# Adapt the following line to find the local texmf tree\\
+% LOCAL\_TEXMF:=\$(CURDIR)/\$(firstword \$(wildcard texmf $\backslash$\\
+% \hspace*{16ex}../texmf ../../texmf ../../../texmf))\\
+% \# Get the old TEXMFHOME value\\
+% TEXMFHOME:=\$(shell kpsewhich -var-value TEXMFHOME)\\
+% \# If the new tree is already in it, do nothing, else add it\\
+% ifeq (\$(filter \$(LOCAL\_TEXMF)//%,\$(TEXMFHOME)),)\\
+% TEXMFHOME := \$(LOCAL\_TEXMF)\$(addprefix :,\$(TEXMFHOME))\\
+% \# display info so that users know what to define in order to\\
+% \# compile documents directly with (pdf)latex\\
+% \$(warning export TEXMFHOME=\$(TEXMFHOME))\\
+% export TEXMFHOME\\
+% endif\\
+% ~\\
+% include \$(shell env TEXMFHOME=\$(TEXMFHOME) $\backslash$\\
+% \hspace*{12ex}kpsewhich -format texmfscripts LaTeX.mk)
+% \end{source}
+% Doing so, all co-authors will be able to use \LaTeX-Make without
+% installing it. However, note that:
% \begin{itemize}
% \item you wont beneficit of an update of \LaTeX-Make in your system
-% (you will continue to use the locally installed files)
+% (you will continue to use the locally installed files) ;
% \item there is no support for upgrading locally installed files (but
% reexecuting the installation should do a correct upgrade most of
-% the time)
+% the time) ;
+% \item if a user tries to compile the \LaTeX{} source code directly
+% with |[pdf]latex|, he must before either have LaTeX-Make installed
+% or define and export |TEXMFHOME|.
% \end{itemize}
+%
+% Another possibility is to install package files (|*.sty|) into a
+% directory pointed by |TEXINPUTS|, scripts files (|*.py|) into a
+% directory pointed bt |TEXMFSCRIPTS|, and to directly include
+% |LaTeX.mk|. For example:
+% \begin{source}\small
+% \# use local files by default\\
+% \# packages in sty/ subdir and scripts in bin/\\
+% TEXINPUTS:=sty\$(addprefix :,\$(TEXINPUTS))::\\
+% TEXMFSCRIPTS:=bin\$(addprefix :,\$(TEXMFSCRIPTS))::\\
+% export TEXINPUTS\\
+% export TEXMFSCRIPTS\\
+% \# Force using local LaTeX.mk and not system-wide LaTeX.mk if available\\
+% include \$(CURDIR)/LaTeX.mk
+% \end{source}
% \subsection{Customization}
% Of course, lots of things can be customized. Here are the most
% useful ones. Look at the section \ref{sec:reference} for more detailed
@@ -611,6 +661,8 @@
% \variable{MAIN}{SET}{Document}{Master \texttt{tex} source
% file\default{\texttt{\emph{master}.tex}}}%
% \variable{DEPENDS}{ADD}{Target}{List of dependencies}%
+% \variable{DEPENDS\_EXCLUDE}{ADD}{Target}{Dependencies to
+% forget. Useful when LaTeX Make wrongly auto-detect false dependencies}%
% \variable{\emph{progvarname}}{SET}{Target}{Program to launch for
% the corresponding flavor}%
% \variable{\emph{progvarname}\_OPTIONS}{ADD}{Target}{Options to use
@@ -1120,19 +1172,36 @@ $(eval $(call lu-setvar-global,FIG2DEV,fig2dev))
$(eval $(call lu-setvar-global,EPSTOPDF,epstopdf))
$(eval $(call lu-setvar-global,MAKEINDEX,makeindex))
-# Look for local version, then texmfscript, then in PATH of our program
+# workaround the fact that $(shell ...) ignore locally exported variables
+# get only the variables with plain names
+_LU_MAKE_ENV := $(shell echo '$(.VARIABLES)' | awk -v RS=' ' '/^[a-zA-Z0-9]+$$/')
+_LU_SHELL_EXPORT := $(foreach v,$(_LU_MAKE_ENV),$(v)='$($(v))')
+_lu_run_kpsewhich=$(shell $(_LU_SHELL_EXPORT) kpsewhich -format $1 $2)
+
+# Look first into the TDS (texmfscripts), then in PATH for our program
# At each location, we prefer with suffix than without
define _lu_which # VARNAME progname
ifeq ($(origin _LU_$(1)_DEFAULT), undefined)
_LU_$(1)_DEFAULT := $$(firstword $$(wildcard \
- $$(addprefix bin/,$(2) $$(basename $(2))) \
- $$(addprefix ./,$(2) $$(basename $(2))) \
- $$(shell kpsewhich -format texmfscripts $(2)) \
- $$(shell kpsewhich -format texmfscripts $$(basename $(2))) \
+ $$(call _lu_run_kpsewhich,texmfscripts,$(2)) \
+ $$(call _lu_run_kpsewhich,texmfscripts,$$(basename $(2))) \
$$(foreach dir,$$(subst :, ,$$(PATH)), \
$$(dir)/$(2) $$(dir)/$$(basename $(2))) \
) $(2))
export _LU_$(1)_DEFAULT
+ _LU_$(1)_DEFAULT_OLD := $$(firstword $$(wildcard \
+ $$(addprefix bin/,$(2) $$(basename $(2))) \
+ $$(addprefix ./,$(2) $$(basename $(2)))))
+ $$(if $$(filter-out $$(_LU_$(1)_DEFAULT), $$(_LU_$(1)_DEFAULT_OLD)),\
+ $$(if $$(_lu_scripts_warnings),, \
+ $$(eval _lu_scripts_warnings:=done) \
+ $$(warning By default, this version of LaTeX-Make do not use \
+ scripts in $$(dir $$(_LU_$(1)_DEFAULT_OLD)) anymore.) \
+ $$(warning For example $$(_LU_$(1)_DEFAULT) is used instead of $$(_LU_$(1)_DEFAULT_OLD))\
+ $$(warning If you want to keep the old behavior, add into your \
+ Makefile something like:)\
+ $$(warning export TEXMFSCRIPTS:=$$(dir $$(_LU_$(1)_DEFAULT_OLD))$$$$(addprefix :,$$$$(TEXMFSCRIPTS))::)))
+ #$$(warning _LU_$(1)_DEFAULT=$$(_LU_$(1)_DEFAULT))
endif
$$(eval $$(call lu-setvar-global,$(1),$$(_LU_$(1)_DEFAULT)))
endef
@@ -1370,8 +1439,9 @@ define lu-master-texflavor-rules # MASTER FLAVOR ext(.dvi/.pdf)
$$(sort $$(call lu-getvalues,BIBFILES,$(1),$(2)) \
$$(wildcard $$(call lu-getvalues,BIBSTYLES,$(1),$(2))))
$(1)$(3): %$(3): \
- $$(call lu-getvalues,DEPENDS,$(1),$(2)) \
- $$(call lu-getvalues,REQUIRED,$(1),$(2)) \
+ $$(filter-out $$(call lu-getvalues,DEPENDS_EXCLUDE,$(1),$(2)), \
+ $$(call lu-getvalues,DEPENDS,$(1),$(2)) \
+ $$(call lu-getvalues,REQUIRED,$(1),$(2))) \
$$(if $$(wildcard $(1)$(3)_FAILED),LU_FORCE,) \
$$(if $$(wildcard $(1)$(3)_NEED_REBUILD),LU_FORCE,) \
$$(if $$(wildcard $(1)$(3)_NEED_REBUILD_IN_PROGRESS),LU_FORCE,)
@@ -1667,42 +1737,37 @@ endif
$(COMMON_PREFIX)$(call lu-call-prog,BIBTEX) $*
%MAKEFILE
-_LaTeX_Make_GROUPS=BIN TEX
-_LaTeX_Make_BIN = figdepth.py gensubfig.py svg2dev.py svgdepth.py latexfilter.py
-_LaTeX_Make_BINDIR=bin
-_LaTeX_Make_BINORIGDIR= /FIXME_TDS_ROOT/scripts/latex-make
-_LaTeX_Make_TEX = figlatex.sty pdfswitch.sty texdepends.sty texgraphicx.sty
-_LaTeX_Make_TEXDIR=.
-_LaTeX_Make_TEXORIGDIR= /FIXME_TDS_ROOT/tex/latex/latex-make
+_LaTeX_Make_GROUPS=texmfscripts tex
+_LaTeX_Make_texmfscripts = LaTeX.mk figdepth.py gensubfig.py svg2dev.py svgdepth.py latexfilter.py
+_LaTeX_Make_texmfscripts_DIR = scripts/latex-make
+_LaTeX_Make_tex = figlatex.sty pdfswitch.sty texdepends.sty texgraphicx.sty
+_LaTeX_Make_tex_DIR = tex/latex/latex-make
.PHONY: LaTeX-Make-local-install LaTeX-Make-local-uninstall
-.PHONY: _LaTeX-Make-local-install-done
-_LaTeX-Make-local-install-done:
LaTeX-Make-local-uninstall::
+ $(if $(TEXMF_INSTALL_ROOT_DIR),,\
+ $(error TEXMF_INSTALL_ROOT_DIR must be set when calling LaTeX-Make-local-uninstall))
$(foreach g,$(_LaTeX_Make_GROUPS),\
$(foreach f,$(_LaTeX_Make_$(g)), \
- $(LU_RM) $(_LaTeX_Make_$(g)DIR)/$f && \
- ) (rmdir $(_LaTeX_Make_$(g)DIR) || true) && \
+ $(LU_RM) $(TEXMF_INSTALL_ROOT_DIR)/$(_LaTeX_Make_$(g)_DIR)/$f && \
+ ) (rmdir $(TEXMF_INSTALL_ROOT_DIR)/$(_LaTeX_Make_$(g)_DIR) || true) && \
) $(LU_RM) LaTeX.mk
-LaTeX-Make-local-install:: _LaTeX-Make-local-install-done
+LU_INSTALL_PKSEWHICH?=env -u TEXMFHOME kpsewhich
+LaTeX-Make-local-install::
+ $(if $(TEXMF_INSTALL_ROOT_DIR),,\
+ $(error TEXMF_INSTALL_ROOT_DIR must be set when calling LaTeX-Make-local-install))
+ $(if $(filter texmf,$(notdir $(TEXMF_INSTALL_ROOT_DIR))),,\
+ $(if $(FORCE),,\
+ $(warning TEXMF_INSTALL_ROOT_DIR does not end with 'texmf')\
+ $(error Use FORCE=1 if you really want to use this value of TEXMF_INSTALL_ROOT_DIR)))
$(foreach g,$(_LaTeX_Make_GROUPS),\
- mkdir -p $(_LaTeX_Make_$(g)DIR) && \
+ mkdir -p $(TEXMF_INSTALL_ROOT_DIR)/$(_LaTeX_Make_$(g)_DIR) && \
$(foreach f,$(_LaTeX_Make_$(g)), \
- $(LU_CP) $(_LaTeX_Make_$(g)ORIGDIR)/$f $(_LaTeX_Make_$(g)DIR) && \
- )) $(LU_CP) $(_LaTeX_Make_BINORIGDIR)/LaTeX.mk .
- @echo >> LaTeX.mk
- @echo "_LaTeX-Make-local-install-done:" >> LaTeX.mk
- @echo " @echo " >> LaTeX.mk
- @echo " @echo 'You must remove (at least) the locally installed LaTeX.mk file if you wish to'" >> LaTeX.mk
- @echo " @echo 'restart the installation.'" >> LaTeX.mk
- @echo " @echo 'You can try \"make LaTeX-Make-local-uninstall\"'" >> LaTeX.mk
- @echo " @echo " >> LaTeX.mk
- @echo " @exit 1" >> LaTeX.mk
- @echo
- @echo "=> All LaTeX-Make files are locally copied"
- @echo
+ $(LU_CP) -v $$($(LU_INSTALL_PKSEWHICH) -format $g $f) $(TEXMF_INSTALL_ROOT_DIR)/$(_LaTeX_Make_$(g)_DIR) && \
+ )) echo "Installation into $(TEXMF_INSTALL_ROOT_DIR) done."
+ @echo "==> You must ensure your TEXMFHOME contains this path <=="
%</makefile>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/support/latex-make/pdfswitch.dtx b/Master/texmf-dist/source/support/latex-make/pdfswitch.dtx
index 3e89ef54a50..a5603a74b58 100644
--- a/Master/texmf-dist/source/support/latex-make/pdfswitch.dtx
+++ b/Master/texmf-dist/source/support/latex-make/pdfswitch.dtx
@@ -26,7 +26,7 @@
%<package>\ProvidesPackage{pdfswitch}%
% \fi
% \ProvidesFile{pdfswitch.dtx}
-[2018/09/04 v2.2.5 No changes in pdfswitch.dtx]
+[2018/10/17 v2.3.0 No changes in pdfswitch.dtx]
%<*package>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% SWITCH FOR PDFLATEX or LATEX
diff --git a/Master/texmf-dist/source/support/latex-make/texdepends.dtx b/Master/texmf-dist/source/support/latex-make/texdepends.dtx
index 8f5447ff503..252d4230117 100644
--- a/Master/texmf-dist/source/support/latex-make/texdepends.dtx
+++ b/Master/texmf-dist/source/support/latex-make/texdepends.dtx
@@ -27,7 +27,7 @@
%<package>\ProvidesPackage{texdepends}%
% \fi
% \ProvidesFile{texdepends.dtx}
-[2018/09/04 v2.2.5 No changes in texdepends.dtx]
+[2018/09/04 v2.3.0 ignore comment.cut file from the comment package]
% \iffalse
%<*driver>
\documentclass{ltxdoc}
@@ -100,7 +100,7 @@
% This package allows \LaTeX\space to automatically generate
% dependencies while compiling documents.
% \end{abstract}
-% \CheckSum{785}
+% \CheckSum{793}
%
% \changes{v1.0.1}{2005/03/22}{Version 1.0.1 at last}
% \changes{v1.0.2}{2005/10/22}{Add support for package index.sty}
@@ -109,6 +109,7 @@
% \changes{v1.2.0}{2008/01/28}{Better management of subfig files}
% \changes{v1.3.0}{2011/09/25}{Management of svg files}
% \changes{v2.2.5}{2018/09/04}{No changes in texdepends.dtx}
+% \changes{v2.3.0}{2018/10/17}{ignore comment.cut file from the comment package}
%
% \makeatletter
% \def\SpecialOptionIndex#1{\@bsphack
@@ -344,6 +345,14 @@
% \end{macrocode}
% \end{macro}
% \begin{macro}{\TD@printFig}
+% We want to ignore a dependency
+% \begin{macrocode}
+\def\TD@printNoDependsFile#1{%
+ \TD@print{TD_\jobname\TD@extention _DEPENDS_EXCLUDE\space += #1}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\TD@printFig}
% We need an |XFig| file
% \begin{macrocode}
\def\TD@printFig#1{%
@@ -1007,7 +1016,7 @@
% \end{macrocode}
% \subsubsection{Package bibtopic}
% \begin{macrocode}
-% Pour le package bibtopic
+% For the bibtopic package
\def\TD@btSect{%
\@ifnextchar[{\TD@btSect@opt}{\TD@btSect@noopt}}
\def\TD@btSect@opt[#1]#2{%
@@ -1031,6 +1040,14 @@
\TD@docswitch{btSect}%
}%
% \end{macrocode}
+% \subsubsection{Package comment}
+% \begin{macrocode}
+% For the comment package, the |comment.cut| file must not be used as
+% a dependency: it is read and written several times during a compilation.
+\TD@PackagePostDivert{comment}{%
+ \TD@printNoDependsFile{comment.cut}%
+}%
+% \end{macrocode}
% \begin{macrocode}
%</package>
% \end{macrocode}