Klammertext runs natively on Windows; a Windows source-install guide; the bundled sh for @eval :shell
Assembled from klammertext-dev f344a37d0f6e. 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
fe475e774a
55 files changed
+1182
-153
No files matched your search
@@ -151,7 +151,7 @@ std::vector<std::string> klammerset_search_dirs(const std::string& local_dir)
|
||||
// A repeated directory (e.g. the local stage already IS
|
||||
// $KLAMMERTEXT_HOME) adds nothing and clutters error messages.
|
||||
auto push_unique = [&result](const std::string& dir) {
|
||||
std::string canonical = fs::weakly_canonical(dir).string();
|
||||
std::string canonical = fs::weakly_canonical(dir).generic_string();
|
||||
if (!is_in(canonical, result)) {
|
||||
result.push_back(canonical);
|
||||
}
|
||||
@@ -171,22 +171,10 @@ std::vector<std::string> klammerset_search_dirs(const std::string& local_dir)
|
||||
// a document could extend its own search path between one declaration and
|
||||
// the next. Nothing intended that -- it fell out of a fresh getenv and an
|
||||
// in-process interpreter.
|
||||
static const std::string paths = [] {
|
||||
const char* env = std::getenv("KLAMMERTEXT_KLAMMERSETS");
|
||||
if (env && *env) {
|
||||
return std::string(env);
|
||||
}
|
||||
if (const char* home = std::getenv("HOME"); home && *home) {
|
||||
return std::string(home) + "/.klammertext/klammersets";
|
||||
}
|
||||
return std::string();
|
||||
}();
|
||||
std::stringstream ss(paths);
|
||||
std::string dir;
|
||||
while (std::getline(ss, dir, ':')) {
|
||||
if (!dir.empty()) {
|
||||
push_unique(dir);
|
||||
}
|
||||
static const strings_t installed =
|
||||
directory_list("KLAMMERTEXT_KLAMMERSETS", ".klammertext/klammersets");
|
||||
for (const std::string& dir : installed) {
|
||||
push_unique(dir);
|
||||
}
|
||||
if (const char* kthome = std::getenv(klammertext_home_var.c_str()); kthome && *kthome) {
|
||||
push_unique(kthome);
|
||||
@@ -280,11 +268,11 @@ std::string describe_klammerset_search(const std::string& local_dir, int margin)
|
||||
if (!is_klammerset_symbol(symbol) || !fs::is_regular_file(declaration)) {
|
||||
continue;
|
||||
}
|
||||
std::string line = tab + symbol + sp_arrow + declaration.string();
|
||||
std::string line = tab + symbol + sp_arrow + declaration.generic_string();
|
||||
if (first_hit.count(symbol)) {
|
||||
line += " (shadowed by " + first_hit[symbol] + ")";
|
||||
} else {
|
||||
first_hit[symbol] = declaration.string();
|
||||
first_hit[symbol] = declaration.generic_string();
|
||||
}
|
||||
// What a set IS, under where it lives: the symbol and the path
|
||||
// say which file would load, and nothing at all about whether
|
||||
|
||||
Reference in new issue
Block a user