diff --git a/pkgs/development/libraries/quarto/default.nix b/pkgs/development/libraries/quarto/default.nix index acdb76cc52b2f8..752168c3f08007 100644 --- a/pkgs/development/libraries/quarto/default.nix +++ b/pkgs/development/libraries/quarto/default.nix @@ -1,10 +1,11 @@ { stdenv , lib -, pandoc , typst , esbuild , deno , fetchurl +, haskell +, haskellPackages , dart-sass , rWrapper , rPackages @@ -15,8 +16,40 @@ , quarto , extraPythonPackages ? ps: [] , sysctl +, removeReferencesTo +, installShellFiles }: +let + pandoc_3_5 = lib.lists.elemAt (lib.lists.filter (x: x.name or "" == "pandoc-3.5") static.buildInputs) 0; + static = haskell.lib.compose.justStaticExecutables haskellPackages.pandoc-cli_3_5; + pandoc = (haskell.lib.compose.overrideCabal (drv: { + configureFlags = drv.configureFlags or [] ++ ["-fembed_data_files"]; + buildDepends = drv.buildDepends or [] ++ [haskellPackages.file-embed]; + buildTools = (drv.buildTools or []) ++ [ + removeReferencesTo + installShellFiles + ]; + postInstall = drv.postInstall or "" + '' + remove-references-to \ + -t ${haskellPackages.pandoc-types} \ + $out/bin/pandoc + remove-references-to \ + -t ${haskellPackages.warp} \ + $out/bin/pandoc + remove-references-to \ + -t ${pandoc_3_5} \ + $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 + '' + '' + installManPage man/* + ''; + }) static).overrideAttrs (drv: { + disallowedReferences = [ haskellPackages.pandoc-types haskellPackages.warp haskellPackages.pandoc pandoc_3_5 ]; + }); +in stdenv.mkDerivation (final: { pname = "quarto"; version = "1.6.33";