diff --git a/flake.nix b/flake.nix index 489d3318e..24b96762c 100644 --- a/flake.nix +++ b/flake.nix @@ -219,6 +219,9 @@ inherit versionSuffix officialRelease; stdenv = currentStdenv; busybox-sandbox-shell = final.busybox-sandbox-shell or final.default-busybox-sandbox-shell; + # See below + lowdown = final.lowdown_3_0; + lowdown-unsandboxed = final.lowdown_3_0.override { enableDarwinSandbox = false; }; }; lix-clang-tidy = final.callPackage ./subprojects/lix-clang-tidy { }; @@ -245,9 +248,21 @@ # And same thing for our build-release-notes package. build-release-notes = final.nix.passthru.build-release-notes; - lowdown = - assert lib.versionAtLeast prev.lowdown.version "2.0.0"; - prev.lowdown; + # As soon as Nixpkgs updates to >= 3.0.0, change to lowdown_2_0! + # We don't change the default version in order to not change the hash + # of Nix/Lix from upstream Nixpkgs. + lowdown_3_0 = + assert lib.versionOlder prev.lowdown.version "3.0.0"; + prev.lowdown.overrideAttrs ( + finalAttrs: _prevAttrs: { + version = "3.0.0"; + + src = final.fetchurl { + url = "https://kristaps.bsd.lv/lowdown/snapshots/lowdown-${finalAttrs.version}.tar.gz"; + sha512 = "94e97234d598382c3c3dc27f9bfdb3a3a2fcf7dbb6a8df3c85ee09f27f792449034a41d49d9cfd3d8450d2de01b8562c20c3d120e65c81af4d7d6c9454119e93"; + }; + } + ); capnproto = prev.capnproto.overrideAttrs (old: { patches = @@ -275,6 +290,15 @@ # Binary package for various platforms. build = forAllSystems (system: self.packages.${system}.nix); + # Ensure support for lowdown < 3.0 doesn't regress for NixOS 25.11 + build-lowdown_2_0.aarch64-linux = lib.genAttrs [ "aarch64-linux" ] ( + system: + self.packages.${system}.nix.override { + lowdown = nixpkgsFor.${system}.native.lowdown; + lowdown-unsandboxed = nixpkgsFor.${system}.native.lowdown-unsandboxed; + } + ); + # Building Lix twice in CI is expensive, but we can catch a lot of static # build regressions by at least making sure it evals and configures. configure-static = lib.genAttrs linux64BitSystems ( 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 c30f20d08..171f75695 100644 --- a/meson.build +++ b/meson.build @@ -383,6 +383,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.