diff options
author | Potato Hatsue <1793913507@qq.com> | 2023-03-07 00:19:47 -0500 |
---|---|---|
committer | Potato Hatsue <1793913507@qq.com> | 2023-03-08 13:07:02 -0500 |
commit | dbdebe125f049c0baf844e09fb57497ddf3d7084 (patch) | |
tree | aefef28827892cba5d7ed0d896a8c6f415b66ba9 /pkgs/development/tools/pandoc | |
parent | 4aee971db19c5df4aa4e9cee7d24ec4ef90e0364 (diff) | |
download | nixlib-dbdebe125f049c0baf844e09fb57497ddf3d7084.tar nixlib-dbdebe125f049c0baf844e09fb57497ddf3d7084.tar.gz nixlib-dbdebe125f049c0baf844e09fb57497ddf3d7084.tar.bz2 nixlib-dbdebe125f049c0baf844e09fb57497ddf3d7084.tar.lz nixlib-dbdebe125f049c0baf844e09fb57497ddf3d7084.tar.xz nixlib-dbdebe125f049c0baf844e09fb57497ddf3d7084.tar.zst nixlib-dbdebe125f049c0baf844e09fb57497ddf3d7084.zip |
pandoc: remove reference to warp
Diffstat (limited to 'pkgs/development/tools/pandoc')
-rw-r--r-- | pkgs/development/tools/pandoc/default.nix | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/pkgs/development/tools/pandoc/default.nix b/pkgs/development/tools/pandoc/default.nix index c64e47686cf5..31396f800a1e 100644 --- a/pkgs/development/tools/pandoc/default.nix +++ b/pkgs/development/tools/pandoc/default.nix @@ -9,10 +9,20 @@ in buildDepends = drv.buildDepends or [] ++ [haskellPackages.file-embed]; buildTools = (drv.buildTools or []) ++ [ removeReferencesTo ]; + # Normally, the static linked executable shouldn't refer to any library or the compiler. + # This is not always the case when the dependency has Paths_* module generated by Cabal, + # where bindir, datadir, and libdir contain the path to the library, and thus make the + # executable indirectly refer to GHC. However, most Haskell programs only use Paths_*.version for + # getting the version at runtime, so it's safe to remove the references to them. + # This is true so far for pandoc-types and warp. + # For details see: https://github.com/NixOS/nixpkgs/issues/34376 postInstall = drv.postInstall or "" + '' remove-references-to \ -t ${haskellPackages.pandoc-types} \ $out/bin/pandoc + remove-references-to \ + -t ${haskellPackages.warp} \ + $out/bin/pandoc '' + lib.optionalString (stdenv.buildPlatform == stdenv.hostPlatform) '' mkdir -p $out/share/bash-completion/completions $out/bin/pandoc --bash-completion > $out/share/bash-completion/completions/pandoc @@ -25,5 +35,5 @@ in # 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 ]; + disallowedReferences = [ haskellPackages.pandoc-types haskellPackages.warp ]; }) |