Klammertext runs natively on Windows; a Windows source-install guide; the bundled sh for @eval :shell
Assembled from klammertext-dev f344a37d772c. The commands, the library,
the Standard Klammer Set, the reflection klammerset and the Python
binding build and run natively on Windows (MSYS2 UCRT64 gcc, python.org
Python), and both test tiers pass there. doc/install/windows_source_install.md
is the fifth install guide: a source install parallel to the Linux and
macOS ones, verified by following it on a pristine Windows 11.
Behaviour on every system: paths Klammertext prints use forward slashes;
output is LF; the command line is UTF-8 on Windows; @eval :shell is a
POSIX shell command everywhere -- on Windows it runs the sh Klammertext
ships, BusyBox for Windows (win/busybox/, GPLv2, with its licence and the
source pointer). KLAMMERTEXT_FONTS and KLAMMERTEXT_KLAMMERSETS are lists in
the system's PATH convention (';' on Windows). On Linux and macOS nothing
observable changes.
This commit is contained in:
1 parent
f9af1ff869
commit
830b19394d
55 files changed
+1182
-153
No files matched your search
Vendored
+23
-3
@@ -20,6 +20,19 @@ export KLAMMERTEXT_HOME="$(cd "$(dirname "$_kt_self")/.." && pwd)"
|
||||
unset _kt_self
|
||||
|
||||
_kt_uname="$(uname -s)"
|
||||
# Windows under MSYS2: the commands are native programs and never understand
|
||||
# MSYS's /c/... spelling, so KLAMMERTEXT_HOME and TMPDIR reach them in Windows
|
||||
# form (C:/..., cygpath -m). bash's own PATH keeps the POSIX form -- a colon
|
||||
# inside a PATH entry splits it. Python (python.org's) is the user's to put on
|
||||
# PATH; an MSYS2 login shell does not inherit the Windows PATH by default.
|
||||
_kt_home_posix="$KLAMMERTEXT_HOME"
|
||||
case "$_kt_uname" in
|
||||
MINGW*|MSYS*)
|
||||
export KLAMMERTEXT_HOME="$(cygpath -m "$KLAMMERTEXT_HOME")"
|
||||
export TMPDIR="$(cygpath -m "${TMPDIR:-/tmp}")"
|
||||
export PYTHON="${PYTHON:-python}" # python.org installs no python3
|
||||
;;
|
||||
esac
|
||||
|
||||
# --- KLAMMERTEXT_TEXLIVE_BIN: newest installed TeX Live under ~/external -------
|
||||
# Klammertext's TeX Live installs are named by 4-digit year (2024, 2025, 2026).
|
||||
@@ -27,20 +40,27 @@ _kt_uname="$(uname -s)"
|
||||
# are never selected; sort -V then picks the newest year.
|
||||
if [ "$_kt_uname" = "Darwin" ]; then
|
||||
_kt_arch="universal-darwin"
|
||||
elif case "$_kt_uname" in MINGW*|MSYS*) true;; *) false;; esac; then
|
||||
_kt_arch="windows" # TeX Live's bin/windows
|
||||
else
|
||||
_kt_arch="$(uname -m)-linux" # e.g. x86_64-linux
|
||||
fi
|
||||
# Use `find` with a -path pattern, NOT a shell glob: on macOS/zsh an unmatched
|
||||
# glob (no texlive installed) is a hard "no matches found" error, whereas find
|
||||
# just returns nothing. The -path pattern keeps the 4-digit-year restriction.
|
||||
_kt_tl="$(find "$HOME/external/texlive" -maxdepth 3 -type d \
|
||||
# Windows: a user installs under the Windows home, %USERPROFILE%\external
|
||||
# (MSYS2's $HOME is C:\msys64\home\<user>, which no Windows guide would name).
|
||||
_kt_tlroot="$HOME/external/texlive"
|
||||
case "$_kt_uname" in MINGW*|MSYS*) _kt_tlroot="$(cygpath -u "$USERPROFILE")/external/texlive";; esac
|
||||
_kt_tl="$(find "$_kt_tlroot" -maxdepth 3 -type d \
|
||||
-path "*/[0-9][0-9][0-9][0-9]/bin/$_kt_arch" 2>/dev/null \
|
||||
| sort -V | tail -1)"
|
||||
[ -n "$_kt_tl" ] && export KLAMMERTEXT_TEXLIVE_BIN="$_kt_tl"
|
||||
unset _kt_tl _kt_arch
|
||||
unset _kt_tl _kt_arch _kt_tlroot
|
||||
|
||||
# --- PATH (TeX Live appended only if one was found) ---------------------------
|
||||
export PATH="$KLAMMERTEXT_HOME/bin:$KLAMMERTEXT_HOME/tst${KLAMMERTEXT_TEXLIVE_BIN:+:$KLAMMERTEXT_TEXLIVE_BIN}:$PATH"
|
||||
export PATH="$_kt_home_posix/bin:$_kt_home_posix/tst${KLAMMERTEXT_TEXLIVE_BIN:+:$KLAMMERTEXT_TEXLIVE_BIN}:$PATH"
|
||||
unset _kt_home_posix
|
||||
|
||||
# --- The Python binding (kpy/) -----------------------------------------------
|
||||
# "import klammertext" with no setup, as the container image already arranges
|
||||
|
||||
Reference in new issue
Block a user