diff options
-rw-r--r-- | pkgs/development/tools/pandoc/default.nix | 29 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 5 |
2 files changed, 30 insertions, 4 deletions
diff --git a/pkgs/development/tools/pandoc/default.nix b/pkgs/development/tools/pandoc/default.nix new file mode 100644 index 00000000000..ce7132b0007 --- /dev/null +++ b/pkgs/development/tools/pandoc/default.nix @@ -0,0 +1,29 @@ +{ haskellPackages, haskell, removeReferencesTo }: + +let + static = haskell.lib.justStaticExecutables haskellPackages.pandoc; + +in + (haskell.lib.overrideCabal static (drv: { + configureFlags = drv.configureFlags or [] ++ ["-fembed_data_files"]; + buildDepends = drv.buildDepends or [] ++ [haskellPackages.file-embed]; + buildTools = (drv.buildTools or []) ++ [ removeReferencesTo ]; + })).overrideAttrs (drv: { + + # These libraries are still referenced, because pandoc references + # their `Paths_*` module for figuring out their version. + # The `Paths_*` module is generated by Cabal, and contains the + # version, but also paths to e.g. the data directories, which + # lead to a transitive runtime dependency on the whole GHC distribution. + # This should ideally be fixed in haskellPackages (or even Cabal), + # but a minimal pandoc is important enough to patch it manually. + disallowedReferences = [ haskellPackages.pandoc-types haskellPackages.HTTP ]; + postInstall = '' + remove-references-to \ + -t ${haskellPackages.pandoc-types} \ + $out/bin/pandoc + remove-references-to \ + -t ${haskellPackages.HTTP} \ + $out/bin/pandoc + ''; + }) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a2fae02ba57..ba33311a39e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5752,10 +5752,7 @@ in pal = callPackage ../tools/misc/pal { }; - pandoc = haskell.lib.overrideCabal (haskell.lib.justStaticExecutables haskellPackages.pandoc) (drv: { - configureFlags = drv.configureFlags or [] ++ ["-fembed_data_files"]; - buildDepends = drv.buildDepends or [] ++ [haskellPackages.file-embed]; - }); + pandoc = callPackage ../development/tools/pandoc { }; pamtester = callPackage ../tools/security/pamtester { }; |