Skip to content

Commit

Permalink
quarto: use pandoc 3.5 (#357687)
Browse files Browse the repository at this point in the history
  • Loading branch information
Atemu authored Dec 11, 2024
2 parents 90175dd + 093558f commit 648124c
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 10 deletions.
23 changes: 16 additions & 7 deletions pkgs/by-name/pa/pandoc/package.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
{ stdenv, lib, haskellPackages, haskell, removeReferencesTo, installShellFiles }:
{
stdenv,
lib,
haskellPackages,
haskell,
removeReferencesTo,
installShellFiles,
selectPandocCLI ? (p: p.pandoc-cli), # The version of pandoc-cli choosen from haskellPackages.
}:

let
# Since pandoc 3.0 the pandoc binary resides in the pandoc-cli package.
static = haskell.lib.compose.justStaticExecutables haskellPackages.pandoc-cli;
static = haskell.lib.compose.justStaticExecutables pandoc-cli;
pandoc-cli = selectPandocCLI haskellPackages;

in
(haskell.lib.compose.overrideCabal (drv: {
configureFlags = drv.configureFlags or [] ++ ["-fembed_data_files"];
buildDepends = drv.buildDepends or [] ++ [haskellPackages.file-embed];
buildDepends = drv.buildDepends or [] ++ [pandoc-cli.scope.file-embed];
buildTools = (drv.buildTools or []) ++ [
removeReferencesTo
installShellFiles
Expand All @@ -22,13 +31,13 @@ in
# For details see: https://github.com/NixOS/nixpkgs/issues/34376
postInstall = drv.postInstall or "" + ''
remove-references-to \
-t ${haskellPackages.pandoc-types} \
-t ${pandoc-cli.scope.pandoc-types} \
$out/bin/pandoc
remove-references-to \
-t ${haskellPackages.warp} \
-t ${pandoc-cli.scope.warp} \
$out/bin/pandoc
remove-references-to \
-t ${haskellPackages.pandoc} \
-t ${pandoc-cli.scope.pandoc} \
$out/bin/pandoc
'' + lib.optionalString (stdenv.buildPlatform == stdenv.hostPlatform) ''
mkdir -p $out/share/bash-completion/completions
Expand All @@ -44,5 +53,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 haskellPackages.pandoc ];
disallowedReferences = [ pandoc-cli.scope.pandoc-types pandoc-cli.scope.warp pandoc-cli.scope.pandoc ];
})
18 changes: 18 additions & 0 deletions pkgs/development/haskell-modules/configuration-common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1964,6 +1964,24 @@ self: super: {
)
];

# Pandoc 3.5 improves the quality of PDF rendering in Quarto >=1.6.30.
# https://github.com/NixOS/nixpkgs/pull/349683
pandoc-cli_3_5 = super.pandoc-cli_3_5.overrideScope (
self: super: {
doclayout = self.doclayout_0_5;
hslua-module-doclayout = self.hslua-module-doclayout_1_2_0;
lpeg = self.lpeg_1_1_0;
pandoc = self.pandoc_3_5;
pandoc-lua-engine = self.pandoc-lua-engine_0_3_3;
pandoc-server = self.pandoc-server_0_1_0_9;
texmath = self.texmath_0_12_8_11;
tls = self.tls_2_0_6;
toml-parser = self.toml-parser_2_0_1_0;
typst = self.typst_0_6;
typst-symbols = self.typst-symbols_0_1_6;
}
);

# 2020-12-06: Restrictive upper bounds w.r.t. pandoc-types (https://github.com/owickstrom/pandoc-include-code/issues/27)
pandoc-include-code = doJailbreak super.pandoc-include-code;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ extra-packages:
- tls < 2.1.0 # 2024-07-19: requested by darcs == 2.18.3
- extensions == 0.1.0.2 # 2024-10-20: for GHC 9.10/Cabal 3.12
- network-run == 0.4.0 # 2024-10-20: for GHC 9.10/network == 3.1.*
- typst-symbols >=0.1.6 && <0.1.7 # 2024-11-20: for pandoc 3.5 and quarto

package-maintainers:
abbradar:
Expand Down
12 changes: 12 additions & 0 deletions pkgs/development/haskell-modules/hackage-packages.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions pkgs/development/libraries/quarto/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ stdenv
, lib
, pandoc
, pandoc_3_5
, typst
, esbuild
, deno
Expand All @@ -16,7 +16,6 @@
, extraPythonPackages ? ps: []
, sysctl
}:

stdenv.mkDerivation (final: {
pname = "quarto";
version = "1.6.37";
Expand All @@ -39,7 +38,7 @@ stdenv.mkDerivation (final: {
preFixup = ''
wrapProgram $out/bin/quarto \
--prefix QUARTO_DENO : ${lib.getExe deno} \
--prefix QUARTO_PANDOC : ${lib.getExe pandoc} \
--prefix QUARTO_PANDOC : ${lib.getExe pandoc_3_5} \
--prefix QUARTO_ESBUILD : ${lib.getExe esbuild} \
--prefix QUARTO_DART_SASS : ${lib.getExe dart-sass} \
--prefix QUARTO_TYPST : ${lib.getExe typst} \
Expand Down
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4746,6 +4746,8 @@ with pkgs;

pakcs = callPackage ../development/compilers/pakcs { };

pandoc_3_5 = callPackage ../by-name/pa/pandoc/package.nix { selectPandocCLI = (p: p.pandoc-cli_3_5); };

paperwork = callPackage ../applications/office/paperwork/paperwork-gtk.nix { };

parallel = callPackage ../tools/misc/parallel { };
Expand Down

0 comments on commit 648124c

Please sign in to comment.