magic/scripts
Darryl L. Miles 3f4a9633d6 build: auto-detect latex/dvips and regenerate docs in default make
When latex and dvips are available, the default no-arg "make" now
regenerates the PostScript documentation from its .tex sources into the
build tree; otherwise the pre-built PostScript shipped in the source tree
is used as-is at install time.  Documentation is always available either
way -- installing latex simply refreshes it from source.

configure (scripts/configure.in, regenerated scripts/configure):
* AC_PATH_PROG for latex + dvips; DOCS_TARGET = "docs" only when both are
  found; AC_SUBST(LATEX/DVIPS/DOCS_TARGET).
* Configuration summary prints "LaTeX docs: yes/no".

scripts/defs.mak.in: export LATEX/DVIPS.

Makefile.in:
* all: ... $(DOCS_TARGET) -- pulls in "docs" only when latex was found.
* docs: best-effort -- `make -k` + a warning on failure so a document
  that will not typeset (or a missing texlive package) never fails the
  build; install falls back to the pre-built PostScript for those.

doc/latexfiles/Makefile:
* use ${LATEX}/${DVIPS} from defs.mak.
* the .tex include figures as ../psfigures/*.ps; point the build-tree
  ../psfigures at ${MAGICSRC}/doc/psfigures (no-op in-tree) so latex and
  dvips find them while outputs stay in the build tree.

CI: main.yml and main-aarch64.yml install
texlive-latex-base/-recommended + texlive-fonts-recommended so the Linux
builds exercise doc regeneration (best-effort, never fatal).

README.Tcl: document latex/dvips as an optional prerequisite for docs.

.gitignore: ignore in-tree doc build artifacts (doc/latexfiles/psfiles/,
*.dvi/*.aux/*.log); the pre-built doc/psfiles/ stays tracked.

Verified out-of-tree with TeX Live 2024: configure reports "LaTeX docs:
yes"; `make` regenerates 27/28 documents into the build tree (maint1.tex
has a genuine LaTeX error and falls back), stays exit 0; `make install`
installs the 27 regenerated PostScript from the build tree and maint1
from the source pre-built copy; the source tree is not modified.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-26 14:54:11 -04:00
..
.gitignore Allow Python 3 to not be in PATH, Fix `clean` re-building dependencies 2023-08-29 22:43:11 +03:00
config.guess Update config.guess/config.log 2020-12-24 21:59:14 -05:00
config.sub Update config.guess/config.log 2020-12-24 21:59:14 -05:00
configure build: auto-detect latex/dvips and regenerate docs in default make 2026-07-26 14:54:11 -04:00
configure.in build: auto-detect latex/dvips and regenerate docs in default make 2026-07-26 14:54:11 -04:00
configure_mac GHA: MacOS maintenance update 2025-01-04 11:23:39 -05:00
defs.mak.in build: auto-detect latex/dvips and regenerate docs in default make 2026-07-26 14:54:11 -04:00
install-sh Initial commit at Tue Apr 25 08:41:48 EDT 2017 by tim on stravinsky 2017-04-25 08:41:48 -04:00
magic.spec.in Initial commit at Tue Apr 25 08:41:48 EDT 2017 by tim on stravinsky 2017-04-25 08:41:48 -04:00
makedbh.in makedbh.in _DATABASE_H => _MAGIC__DATABASE__DATABASE_H 2025-07-29 10:50:32 -04:00
missing Initial commit at Tue Apr 25 08:41:48 EDT 2017 by tim on stravinsky 2017-04-25 08:41:48 -04:00
mkdirs Initial commit at Tue Apr 25 08:41:48 EDT 2017 by tim on stravinsky 2017-04-25 08:41:48 -04:00
mkinstalldirs Convert $Id$ placeholders to $Header$ placeholders. 2020-05-23 17:00:38 -04:00
preproc.py Use raw strings in preproc.py 2024-01-23 09:38:23 -06:00
printmans Build Updates 2023-08-25 12:24:14 -04:00