diff --git a/flake.nix b/flake.nix index 23b8cfd47..61e851e14 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 { }; @@ -243,6 +246,30 @@ boehmgc-nix = final.nix.passthru.boehmgc-nix; # And same thing for our build-release-notes package. build-release-notes = final.nix.passthru.build-release-notes; + + # 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.1"; + src = final.fetchurl { + url = "https://kristaps.bsd.lv/lowdown/snapshots/lowdown-${finalAttrs.version}.tar.gz"; + sha512 = "fe68e1b7ff23f3992398356d7aa9a330dfd7b72e22bea9a91eeef74182b209ecea0c9f3e2b2216e1a07b2358da2b746238ec9cbbdeebdd3551cef14dd2d79f46"; + }; + + # no longer compiles with GNU make + nativeBuildInputs = prevAttrs.nativeBuildInputs ++ [ final.bmake ]; + # dylib fixups on darwin are no longer necessary + postInstall = ""; + # doesn't work on darwin due to disallowed nested sandboxes + doInstallCheck = prevAttrs.doInstallCheck && !(final.stdenv.hostPlatform.isDarwin); + doCheck = prevAttrs.doCheck && !(final.stdenv.hostPlatform.isDarwin); + } + ); + }; in { @@ -257,6 +284,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; + } + ); + devShell = forAllSystems (system: { default = self.devShells.${system}.default; clang = self.devShells.${system}.native-clangStdenvPackages; diff --git a/lix/libcmd/markdown.cc b/lix/libcmd/markdown.cc index 5b0d980bc..b54992ee4 100644 --- a/lix/libcmd/markdown.cc +++ b/lix/libcmd/markdown.cc @@ -34,7 +34,11 @@ std::string renderMarkdownToTerminal(std::string_view markdown) .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()) { opts.oflags |= LOWDOWN_TERM_NOANSI; diff --git a/meson.build b/meson.build index 52aa60725..f9493cc20 100644 --- a/meson.build +++ b/meson.build @@ -345,6 +345,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.