What a Windows editor saves, and a standard user's Windows install (from dev 9d6f66456a3d)

- CRLF line endings are read as newlines on every system (the reader used
  to delete the pair, collapsing a Notepad++ file into one line on Linux
  and macOS); a leading UTF-8 byte-order mark is ignored; a UTF-16 or
  Windows-1252 source is refused with the encoding, the place and the
  remedy named. .gitattributes pins LF in every clone.
- Windows source install: the repository path must hold no space (GNU
  Make), accented letters are fine (every linker input is relative now);
  python.org's Python is selected ahead of an MSYS2 one that poppler pulls
  in; TeX Live goes to its Windows default C:\texlive\2026.
- The Python binding needs an ASCII installation path on Windows, and its
  suite says so there.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
ackandClaude Fable 5.1 committed 2026-09-26 16:17:59 +02:00
1 parent fc2e848e91
commit 715d939727
15 files changed
+236 -41

No files matched your search

+13
View File
@@ -34,6 +34,19 @@ endif
ifneq (,$(filter MINGW% MSYS%,$(UNAME_S)))
PYTHON := python
PYTHON_PREFIX := $(shell cygpath -m "$$($(PYTHON) -c 'import sys; print(sys.base_prefix)')")
# The interpreter "python" resolves to must be python.org's, which has an
# import library under libs/. MSYS2's own python (installed as a dependency
# of poppler, through glib2) sits in /ucrt64/bin ahead of it and has none:
# a build against it compiles nothing (no Include/Python.h) or embeds an
# interpreter without the user's pip packages. env/runtime.env puts
# python.org's directory first; refuse rather than build the wrong thing.
# (Asked of the interpreter, not $(wildcard): the prefix "C:/Program Files"
# has a space, on which wildcard splits.)
ifeq (,$(NOPYTHON))
ifneq (yes,$(shell $(PYTHON) -c 'import os, sys; print("yes" if os.path.isdir(os.path.join(sys.base_prefix, "libs")) else "no")'))
$(error "python" is $(PYTHON_PREFIX)/python, not python.org's interpreter (no libs/ there); source env/runtime.env, which puts python.org's Python first on PATH)
endif
endif
PYTHON_INC := -I"$(PYTHON_PREFIX)/Include"
PYTHON_LIB := -L"$(PYTHON_PREFIX)/libs" -l$(shell $(PYTHON) -c 'import sys; print("python%d%d" % sys.version_info[:2])')
else
+27 -6
View File
@@ -31,6 +31,21 @@ case "$_kt_uname" in
export KLAMMERTEXT_HOME="$(cygpath -m "$KLAMMERTEXT_HOME")"
export TMPDIR="$(cygpath -m "${TMPDIR:-/tmp}")"
export PYTHON="${PYTHON:-python}" # python.org installs no python3
# "python" must be python.org's interpreter: the build embeds it and
# pip installs OpenImageIO into it. But the UCRT64 shell puts
# /ucrt64/bin first on PATH, and an MSYS2 package installed as a
# dependency (poppler -> glib2 -> python) puts ITS python there, which
# then shadows python.org's for make, the suites and the tooling.
# python.org's launcher knows only python.org installs: put the
# directory of the interpreter it selects first. (Its output ends
# in CR LF, hence the tr.)
if command -v py >/dev/null 2>&1; then
_kt_py="$(py -3 -c 'import sys; print(sys.executable)' 2>/dev/null | tr -d '\r')"
if [ -n "$_kt_py" ]; then
export PATH="$(dirname "$(cygpath -u "$_kt_py")"):$PATH"
fi
unset _kt_py
fi
;;
esac
@@ -50,13 +65,19 @@ fi
# just returns nothing. The -path pattern keeps the 4-digit-year restriction.
# 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)"
# Windows also: TeX Live's own default, C:\texlive\<year> -- the place for a
# user whose profile path holds a space or an accented letter, which TeX
# Live's installer and kpathsea do not take (2026-09-26). The newest YEAR
# wins across both roots (the year is the sort key, not the path).
_kt_tlroot="$HOME/external/texlive"; _kt_tlroot2=""
case "$_kt_uname" in MINGW*|MSYS*) _kt_tlroot="$(cygpath -u "$USERPROFILE")/external/texlive"; _kt_tlroot2="/c/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
[ -n "$_kt_tlroot2" ] && find "$_kt_tlroot2" -maxdepth 3 -type d \
-path "*/[0-9][0-9][0-9][0-9]/bin/$_kt_arch" 2>/dev/null; } \
| awk -F/ '{ print $(NF-2) " " $0 }' | sort -V | tail -1 | cut -d' ' -f2-)"
[ -n "$_kt_tl" ] && export KLAMMERTEXT_TEXLIVE_BIN="$_kt_tl"
unset _kt_tl _kt_arch _kt_tlroot
unset _kt_tl _kt_arch _kt_tlroot _kt_tlroot2
# --- PATH (TeX Live appended only if one was found) ---------------------------
export PATH="$_kt_home_posix/bin:$_kt_home_posix/tst${KLAMMERTEXT_TEXLIVE_BIN:+:$KLAMMERTEXT_TEXLIVE_BIN}:$PATH"