haskellPackages.pandoc: build with -f+embed_data_files

This embeds the data files into the pandoc library instead of referencing
the data output. This is not exactly desireable since it doesn't (necessarily)
make the executable relocatable or anything, but is required for pandoc-server
to work correctly (when built against pandoc) since it can't do I/O, i.e. can't
read from the data output.

The data files are still installed, but into $out, so that the reference can
more easily be removed when desired. (It is incurred even with a separate
data output.)

Previously, this was just enabled in pkgs.pandoc, but since that is no longer
the same as haskellPackages.pandoc, the flag has no effect.
Resolves #377637.
This commit is contained in:
sternenseemann
2026-04-02 14:09:12 +02:00
parent 459e685376
commit 0990e10ecf
2 changed files with 10 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
@@ -325,6 +325,16 @@ 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; })
];
# Use Nixpkgs' double-conversion library
double-conversion = disableCabalFlag "embedded_double_conversion" (
addBuildDepends [ pkgs.double-conversion ] super.double-conversion