From 1d36c544be51c5be19b5f84f1c2dd48c24495576 Mon Sep 17 00:00:00 2001 From: sterni Date: Sat, 14 Mar 2026 12:47:16 +0100 Subject: [PATCH] libcmd: add support for lowdown >= 3.0.0 lowdown 3.0.0 merged some flags into one to save on bits and did not add any aliases for backward compatibility. As with the changes for lowdown >= 1.4, we define a preprocessor flag to gate the changes on and add a job to CI to ensure that lowdown < 3.0 keeps working (which is used by NixOS 25.11). The channel version this Lix branch uses doesn't have bmake with support for all tested platforms, so we can't properly build lowdown 3.0 (which depends on it) for tests in CI. Given this is a relatively simple backport tested on other Lix branches, it's probably fine. Change-Id: I20a3e2fdaa05906f032ff66911c42867557fdd11 (cherry picked from commit e839708839aa132c8694abfdf83409a619f72c5a) --- lix/libcmd/markdown.cc | 4 ++++ meson.build | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/lix/libcmd/markdown.cc b/lix/libcmd/markdown.cc index 8e4fa94d1..c96287330 100644 --- a/lix/libcmd/markdown.cc +++ b/lix/libcmd/markdown.cc @@ -74,7 +74,11 @@ std::string renderMarkdownToTerminal(std::string_view markdown, StandardOutputSt .vmargin = 0, #endif /* LOWDOWN_SEPARATE_TERM_OPTS */ .feat = LOWDOWN_COMMONMARK | LOWDOWN_FENCED | LOWDOWN_DEFLIST | LOWDOWN_TABLES, +#ifdef LOWDOWN_CONSOLIDATED_OFLAGS + .oflags = LOWDOWN_NOLINK, +#else .oflags = LOWDOWN_TERM_NOLINK, +#endif /* LOWDOWN_CONSOLIDATED_OFLAGS */ }; if (!shouldANSI(fileno)) { opts.oflags |= LOWDOWN_TERM_NOANSI; diff --git a/meson.build b/meson.build index bede78a64..90c216bd8 100644 --- a/meson.build +++ b/meson.build @@ -350,6 +350,11 @@ if lowdown.version().version_compare('>= 1.4.0') add_project_arguments('-DLOWDOWN_SEPARATE_TERM_OPTS', language: 'cpp') endif +# TODO(sterni): drop the corresponding #ifdef after NixOS 25.11 is EOL which still distributes lowdown < 3.0.0 +if lowdown.version().version_compare('>= 3.0.0') + add_project_arguments('-DLOWDOWN_CONSOLIDATED_OFLAGS', language: 'cpp') +endif + # HACK(Qyriad): rapidcheck's pkg-config doesn't include the libs lol # Note: technically we 'check' for rapidcheck twice, for the internal-api-docs handling above, # but Meson will cache the result of the first one, and the required : arguments are different.