diff --git a/Makefile.config.in b/Makefile.config.in index 3100d2073..081894870 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -4,6 +4,7 @@ BOOST_LDFLAGS = @BOOST_LDFLAGS@ BUILD_SHARED_LIBS = @BUILD_SHARED_LIBS@ CC = @CC@ CFLAGS = @CFLAGS@ +CMARK_LIBS = @CMARK_LIBS@ CXX = @CXX@ CXXFLAGS = @CXXFLAGS@ CXXLTO = @CXXLTO@ diff --git a/configure.ac b/configure.ac index 198198dea..2a4b234a4 100644 --- a/configure.ac +++ b/configure.ac @@ -372,21 +372,24 @@ PKG_CHECK_MODULES([RAPIDCHECK], [rapidcheck rapidcheck_gtest]) PKG_CHECK_MODULES([NLOHMANN_JSON], [nlohmann_json >= 3.9]) +# Look for cmark library. +PKG_CHECK_MODULES([CMARK], [libcmark], [CXXFLAGS="$CMARK_CFLAGS $CXXFLAGS"]) + # Look for lowdown library. -AC_ARG_ENABLE([markdown], AS_HELP_STRING([--enable-markdown], [Enable Markdown rendering in the Nix binary (requires lowdown) [default=auto]]), - enable_markdown=$enableval, enable_markdown=auto) -AS_CASE(["$enable_markdown"], +AC_ARG_ENABLE([lowdown], AS_HELP_STRING([--enable-lowdown], [Enable Markdown rendering in the Nix binary (requires lowdown) [default=auto]]), + enable_lowdown=$enableval, enable_lowdown=auto) +AS_CASE(["$enable_lowdown"], [yes | auto], [ PKG_CHECK_MODULES([LOWDOWN], [lowdown >= 0.9.0], [ CXXFLAGS="$LOWDOWN_CFLAGS $CXXFLAGS" have_lowdown=1 AC_DEFINE(HAVE_LOWDOWN, 1, [Whether lowdown is available and should be used for Markdown rendering.]) ], [ - AS_IF([test "x$enable_markdown" == "xyes"], [AC_MSG_ERROR([--enable-markdown was specified, but lowdown was not found.])]) + AS_IF([test "x$enable_lowdown" == "xyes"], [AC_MSG_ERROR([--enable-lowdown was specified, but lowdown was not found.])]) ]) ], [no], [have_lowdown=], - [AC_MSG_ERROR([bad value "$enable_markdown" for --enable-markdown, must be one of: yes, no, auto])]) + [AC_MSG_ERROR([bad value "$enable_lowdown" for --enable-lowdown, must be one of: yes, no, auto])]) # Look for libgit2. diff --git a/package.nix b/package.nix index 8ab184667..6ae4d886b 100644 --- a/package.nix +++ b/package.nix @@ -23,6 +23,7 @@ , libseccomp , libsodium , man +, cmark , lowdown , mdbook , mdbook-linkcheck @@ -79,7 +80,7 @@ , enableGC ? !stdenv.hostPlatform.isWindows # Whether to enable Markdown rendering in the Nix binary. -, enableMarkdown ? !stdenv.hostPlatform.isWindows +, enableLowdown ? !stdenv.hostPlatform.isWindows # Which interactive line editor library to use for Nix's repl. # @@ -228,7 +229,8 @@ in { toml11 xz ({ inherit readline editline; }.${readlineFlavor}) - ] ++ lib.optionals enableMarkdown [ + cmark + ] ++ lib.optionals enableLowdown [ lowdown ] ++ lib.optionals buildUnitTests [ gtest @@ -255,7 +257,7 @@ in { (lib.enableFeature doInstallCheck "functional-tests") (lib.enableFeature enableManual "doc-gen") (lib.enableFeature enableGC "gc") - (lib.enableFeature enableMarkdown "markdown") + (lib.enableFeature enableLowdown "lowdown") (lib.enableFeature installUnitTests "install-unit-tests") (lib.withFeatureAs true "readline-flavor" readlineFlavor) ] ++ lib.optionals (!forDevShell) [ diff --git a/packaging/hydra.nix b/packaging/hydra.nix index cba1b2583..d2bfb474e 100644 --- a/packaging/hydra.nix +++ b/packaging/hydra.nix @@ -90,9 +90,9 @@ in # Toggles some settings for better coverage. Windows needs these # library combinations, and Debian build Nix with GNU readline too. - buildReadlineNoMarkdown = forAllSystems (system: + buildReadlineNoLowdown = forAllSystems (system: self.packages.${system}.nix.override { - enableMarkdown = false; + enableLowdown = false; readlineFlavor = "readline"; } );