about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/pandoc
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-05-12 14:45:39 +0000
committerAlyssa Ross <hi@alyssa.is>2020-05-12 14:56:01 +0000
commiteb7dadee9c0f903f1152f8dd4165453bfa48ccf4 (patch)
treea6bd66dcbec895aae167465672af08a1ca70f089 /nixpkgs/pkgs/development/tools/pandoc
parent3879b925f5dae3a0eb5c98b10c1ac5a0e4d729a3 (diff)
parent683c68232e91f76386db979c461d8fbe2a018782 (diff)
downloadnixlib-eb7dadee9c0f903f1152f8dd4165453bfa48ccf4.tar
nixlib-eb7dadee9c0f903f1152f8dd4165453bfa48ccf4.tar.gz
nixlib-eb7dadee9c0f903f1152f8dd4165453bfa48ccf4.tar.bz2
nixlib-eb7dadee9c0f903f1152f8dd4165453bfa48ccf4.tar.lz
nixlib-eb7dadee9c0f903f1152f8dd4165453bfa48ccf4.tar.xz
nixlib-eb7dadee9c0f903f1152f8dd4165453bfa48ccf4.tar.zst
nixlib-eb7dadee9c0f903f1152f8dd4165453bfa48ccf4.zip
Merge commit '683c68232e91f76386db979c461d8fbe2a018782'
Diffstat (limited to 'nixpkgs/pkgs/development/tools/pandoc')
-rw-r--r--nixpkgs/pkgs/development/tools/pandoc/default.nix29
1 files changed, 29 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/tools/pandoc/default.nix b/nixpkgs/pkgs/development/tools/pandoc/default.nix
new file mode 100644
index 000000000000..ce7132b0007b
--- /dev/null
+++ b/nixpkgs/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
+    '';
+  })