From 0990e10ecf113d082c69c198af203f83308f587c Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Wed, 1 Apr 2026 21:55:33 +0200 Subject: [PATCH 1/2] 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. --- pkgs/by-name/pa/pandoc/package.nix | 2 -- pkgs/development/haskell-modules/configuration-nix.nix | 10 ++++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/pa/pandoc/package.nix b/pkgs/by-name/pa/pandoc/package.nix index 3fd7ed8e9150..72faf5ec68f0 100644 --- a/pkgs/by-name/pa/pandoc/package.nix +++ b/pkgs/by-name/pa/pandoc/package.nix @@ -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 diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix index 8c596d8e66bb..cd1e0e4a7ac7 100644 --- a/pkgs/development/haskell-modules/configuration-nix.nix +++ b/pkgs/development/haskell-modules/configuration-nix.nix @@ -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 + # . + # 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 From 3dc5816c7591e34e0f2790ee3e0ca9ba3f8c977c Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Thu, 2 Apr 2026 14:12:33 +0200 Subject: [PATCH 2/2] pandoc: add pandoc-server symlink --- pkgs/development/haskell-modules/configuration-nix.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix index cd1e0e4a7ac7..843d56a4dac3 100644 --- a/pkgs/development/haskell-modules/configuration-nix.nix +++ b/pkgs/development/haskell-modules/configuration-nix.nix @@ -335,6 +335,16 @@ builtins.intersectAttrs super { (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