haskellPackages.pandoc: build with -f+embed_data_files (#505790)

This commit is contained in:
sternenseemann
2026-04-04 12:01:44 +00:00
committed by GitHub
2 changed files with 20 additions and 2 deletions
-2
View File
@@ -15,8 +15,6 @@ let
in
(haskell.lib.compose.overrideCabal (drv: {
configureFlags = drv.configureFlags or [ ] ++ [ "-fembed_data_files" ];
buildDepends = drv.buildDepends or [ ] ++ [ pandoc-cli.scope.file-embed ];
buildTools = (drv.buildTools or [ ]) ++ [
removeReferencesTo
installShellFiles
@@ -347,6 +347,26 @@ builtins.intersectAttrs super {
# Heist's test suite requires system pandoc
heist = addTestToolDepend pkgs.pandoc super.heist;
pandoc = lib.pipe super.pandoc [
# pandoc can't do I/O (including reading data files). See
# <https://pandoc.org/pandoc-server.html#description>.
# It's simpler to just enable this globally rather than building multiple pandocs.
(enableCabalFlag "embed_data_files")
# pandoc still references these data files and we can't prevent their installation.
# pkgs.pandoc removes the reference to $out, so having everything in one place is best.
(overrideCabal { enableSeparateDataOutput = false; })
];
# So pandoc-server can be used:
# https://pandoc.org/MANUAL.html#running-pandoc-as-a-web-server
# TODO(@sternenseemann): provide pandoc-server.cgi symlink?
pandoc-cli = overrideCabal (drv: {
postInstall = ''
${drv.postInstall or ""}
ln -s "''${!outputBin}/bin/pandoc" "''${!outputBin}/bin/pandoc-server"
'';
}) super.pandoc-cli;
# Use Nixpkgs' double-conversion library
double-conversion = disableCabalFlag "embedded_double_conversion" (
addBuildDepends [ pkgs.double-conversion ] super.double-conversion