magic/scripts
Darryl L. Miles 201b27e4e9 build: add run_magic*.sh launchers to run magic from the build tree
Four configure-generated launch scripts let you run magic straight from the
build directory without `make install`:

  * run_magic.sh          -- GUI magic (Cairo/X11)
  * run_magicnull.sh      -- batch / no-GUI (-dnull)
  * run_magic_gdb.sh      -- magic under gdb
  * run_magic_valgrind.sh -- magic under valgrind

magic resolves its runtime files through a single $CAD_ROOT root
($CAD_ROOT/magic/{sys,tcl}), but in the build tree they are scattered across
build/ (generated tech, .magicrc, magic.tcl, tclmagic, execs) and source/
(colormaps, dstyles, glyphs, fonts, tcl scripts).  On first run each launcher
self-stages ${builddir}/CAD_DIR as a symlink tree in that layout (no copies,
always current) via the shared scripts/magic_run_common.sh, exports
CAD_ROOT=${builddir}/CAD_DIR, and execs the right binary.  This pairs with the
preceding commit that made the C launchers honor CAD_ROOT.

magic_stage() is idempotent and re-runs on every launch.  Most staged entries
are files, but the bitmaps entry links a *directory*, so it uses `ln -sfn`
(--no-dereference; also accepted by BSD ln): a plain `ln -sf` would, on a second
run, dereference the existing symlink-to-directory and drop the new link *inside*
the target -- a magic/bitmaps/bitmaps self-loop in the source tree that trips up
find/tar/cp -r.

Verified: ./run_magicnull.sh self-stages (30 sys + 24 tcl symlinks) and runs --
`tech load scmos` reports 13 planes -- straight from the build dir.  gitignore
covers the generated scripts and the CAD_DIR tree.

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: add run_magic*.sh launchers to run magic from the build tree 2026-07-26 14:54:11 -04:00
configure.in build: add run_magic*.sh launchers to run magic from the build tree 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: remove bundled-readline wiring from the Makefiles (Patch 2) 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
magic_run_common.sh.in build: add run_magic*.sh launchers to run magic from the build tree 2026-07-26 14:54:11 -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
run_magic.sh.in build: add run_magic*.sh launchers to run magic from the build tree 2026-07-26 14:54:11 -04:00
run_magic_gdb.sh.in build: add run_magic*.sh launchers to run magic from the build tree 2026-07-26 14:54:11 -04:00
run_magic_valgrind.sh.in build: add run_magic*.sh launchers to run magic from the build tree 2026-07-26 14:54:11 -04:00
run_magicnull.sh.in build: add run_magic*.sh launchers to run magic from the build tree 2026-07-26 14:54:11 -04:00