about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/pandoc/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-11-16 12:53:32 +0100
committerAlyssa Ross <hi@alyssa.is>2023-11-16 12:53:32 +0100
commit67419f0e56f99b0ebbe14574d3492110ac84c8d6 (patch)
tree3abc8e1606a2c80b6f5d14fef175e50800202163 /nixpkgs/pkgs/development/tools/pandoc/default.nix
parenta2c1eff83c3118a9aee8076c7f84f58137416b6e (diff)
parent9008bc4eb62c878d0812105ea1b34255d651df88 (diff)
downloadnixlib-67419f0e56f99b0ebbe14574d3492110ac84c8d6.tar
nixlib-67419f0e56f99b0ebbe14574d3492110ac84c8d6.tar.gz
nixlib-67419f0e56f99b0ebbe14574d3492110ac84c8d6.tar.bz2
nixlib-67419f0e56f99b0ebbe14574d3492110ac84c8d6.tar.lz
nixlib-67419f0e56f99b0ebbe14574d3492110ac84c8d6.tar.xz
nixlib-67419f0e56f99b0ebbe14574d3492110ac84c8d6.tar.zst
nixlib-67419f0e56f99b0ebbe14574d3492110ac84c8d6.zip
Merge branch 'nixos-unstable-small' of https://github.com/NixOS/nixpkgs into HEAD
Diffstat (limited to 'nixpkgs/pkgs/development/tools/pandoc/default.nix')
-rw-r--r--nixpkgs/pkgs/development/tools/pandoc/default.nix14
1 files changed, 13 insertions, 1 deletions
diff --git a/nixpkgs/pkgs/development/tools/pandoc/default.nix b/nixpkgs/pkgs/development/tools/pandoc/default.nix
index 1e9eec3f804c..c8c553afad6e 100644
--- a/nixpkgs/pkgs/development/tools/pandoc/default.nix
+++ b/nixpkgs/pkgs/development/tools/pandoc/default.nix
@@ -6,6 +6,15 @@ let
 
 in
   (haskell.lib.compose.overrideCabal (drv: {
+    # pandoc-cli's pandoc executable report the libraries version via --version, match that,
+    inherit (static.scope.pandoc) version;
+    # but prevent haskellPackages.mkDerivation from recomputing the src tarball based on that.
+    inherit (static) src;
+    # Make it possible to recover the cli version if necessary.
+    passthru = drv.passthru or {} // {
+      cliVersion = static.version;
+    };
+
     configureFlags = drv.configureFlags or [] ++ ["-fembed_data_files"];
     buildDepends = drv.buildDepends or [] ++ [haskellPackages.file-embed];
     buildTools = (drv.buildTools or []) ++ [ removeReferencesTo ];
@@ -24,6 +33,9 @@ in
       remove-references-to \
         -t ${haskellPackages.warp} \
         $out/bin/pandoc
+      remove-references-to \
+        -t ${haskellPackages.pandoc_3_1_8} \
+        $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
@@ -36,5 +48,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 haskellPackages.warp ];
+    disallowedReferences = [ haskellPackages.pandoc-types haskellPackages.warp haskellPackages.pandoc_3_1_8 ];
   })