From f7d7b5d93fe037f734bf62f5d6c63e52584ce548 Mon Sep 17 00:00:00 2001 From: sterni Date: Sat, 14 Mar 2026 14:01:33 +0100 Subject: [PATCH] libcmd: remove support for lowdown < 1.4.0 NixOS 25.05 which distributed lowdown < 1.4 has been EOL for a bit now, 25.11 ships lowdown 2.0.4. Dropping support means we can tweak the lowdown options for terminal output which have been added in 1.4.0 without having diverging behavior in possible builds of Lix. Change-Id: Icae97cf5e9e680766b8a6f4e85514f4c4625d1dd --- doc/manual/change-authors.yml | 4 ++++ doc/manual/rl-next/minimum-lowdown-1.4.md | 10 ++++++++++ lix/libcmd/markdown.cc | 8 -------- meson.build | 7 +------ 4 files changed, 15 insertions(+), 14 deletions(-) create mode 100644 doc/manual/rl-next/minimum-lowdown-1.4.md diff --git a/doc/manual/change-authors.yml b/doc/manual/change-authors.yml index 92b782f4e..084e9807e 100644 --- a/doc/manual/change-authors.yml +++ b/doc/manual/change-authors.yml @@ -252,6 +252,10 @@ rootile: seppel3210: github: Seppel3210 +sterni: + forgejo: sterni + github: sternenseemann + stevalkr: github: stevalkr diff --git a/doc/manual/rl-next/minimum-lowdown-1.4.md b/doc/manual/rl-next/minimum-lowdown-1.4.md new file mode 100644 index 000000000..3a3874b59 --- /dev/null +++ b/doc/manual/rl-next/minimum-lowdown-1.4.md @@ -0,0 +1,10 @@ +--- +synopsis: "Lix now requires lowdown 1.4.0 or later" +issues: [] +cls: [5374] +category: Packaging +credits: [sterni] +--- + +Support for linking against `lowdown < 1.4.0` has been removed from Lix since +all supported Nixpkgs channels distribute lowdown 2.0.4 or later. diff --git a/lix/libcmd/markdown.cc b/lix/libcmd/markdown.cc index c96287330..3734f2c15 100644 --- a/lix/libcmd/markdown.cc +++ b/lix/libcmd/markdown.cc @@ -55,7 +55,6 @@ std::string renderMarkdownToTerminal(std::string_view markdown, StandardOutputSt struct lowdown_opts opts{ .type = LOWDOWN_TERM, -#ifdef LOWDOWN_SEPARATE_TERM_OPTS .term = { .cols = lowdown_cols, @@ -65,14 +64,7 @@ std::string renderMarkdownToTerminal(std::string_view markdown, StandardOutputSt .vmargin = 0, .centre = 0, }, - // maxdepth needs to be part of the ifdefs to match declaration order .maxdepth = 20, -#else - .maxdepth = 20, - .cols = lowdown_cols, - .hmargin = 0, - .vmargin = 0, -#endif /* LOWDOWN_SEPARATE_TERM_OPTS */ .feat = LOWDOWN_COMMONMARK | LOWDOWN_FENCED | LOWDOWN_DEFLIST | LOWDOWN_TABLES, #ifdef LOWDOWN_CONSOLIDATED_OFLAGS .oflags = LOWDOWN_NOLINK, diff --git a/meson.build b/meson.build index 171f75695..fc2e348ea 100644 --- a/meson.build +++ b/meson.build @@ -376,12 +376,7 @@ curl = dependency('libcurl', 'curl', required : true, include_type : 'system') editline = dependency('libeditline', 'editline', version : '>=1.14', required : true, include_type : 'system') -lowdown = dependency('lowdown', version : '>=0.9.0', required : true, include_type : 'system') - -# TODO(sterni): drop the corresponding #ifdef after NixOS 25.05 is EOL which still distributes lowdown < 1.4.0 -if lowdown.version().version_compare('>= 1.4.0') - add_project_arguments('-DLOWDOWN_SEPARATE_TERM_OPTS', language: 'cpp') -endif +lowdown = dependency('lowdown', version : '>=1.4.0', required : true, include_type : 'system') # 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')