quarto: 1.3.450 -> 1.4.550

This commit is contained in:
Bruno Rodrigues 2024-02-25 15:29:37 +01:00
parent 288dc9554f
commit 27b830f645
2 changed files with 9 additions and 20 deletions

View File

@ -1,6 +1,7 @@
{ stdenv
, lib
, pandoc
, typst
, esbuild
, deno
, fetchurl
@ -18,35 +19,31 @@
stdenv.mkDerivation (final: {
pname = "quarto";
version = "1.3.450";
version = "1.4.550";
src = fetchurl {
url = "https://github.com/quarto-dev/quarto-cli/releases/download/v${final.version}/quarto-${final.version}-linux-amd64.tar.gz";
sha256 = "sha256-bcj7SzEGfQxsw9P8WkcLrKurPupzwpgIGtxoE3KVwAU=";
sha256 = "sha256-cWHd7ZWGBdRTaSHYVa8LuTDA5gefJ5baOGERS2g6Vvg=";
};
nativeBuildInputs = [
makeWrapper
];
patches = [
./fix-deno-path.patch
];
postPatch = ''
# Compat for Deno >=1.26
substituteInPlace bin/quarto.js \
--replace 'Deno.setRaw(stdin.rid, ' 'Deno.stdin.setRaw(' \
--replace 'Deno.setRaw(Deno.stdin.rid, ' 'Deno.stdin.setRaw('
--replace-fail ']))?.trim();' ']))?.trim().split(" ")[0];'
'';
dontStrip = true;
preFixup = ''
wrapProgram $out/bin/quarto \
--prefix PATH : ${lib.makeBinPath [ deno ]} \
--prefix QUARTO_PANDOC : ${pandoc}/bin/pandoc \
--prefix QUARTO_ESBUILD : ${esbuild}/bin/esbuild \
--prefix QUARTO_DART_SASS : ${dart-sass}/bin/dart-sass \
--prefix QUARTO_DENO : ${lib.getExe deno} \
--prefix QUARTO_PANDOC : ${lib.getExe pandoc} \
--prefix QUARTO_ESBUILD : ${lib.getExe esbuild} \
--prefix QUARTO_DART_SASS : ${lib.getExe dart-sass} \
--prefix QUARTO_TYPST : ${lib.getExe typst} \
${lib.optionalString (rWrapper != null) "--prefix QUARTO_R : ${rWrapper.override { packages = [ rPackages.rmarkdown ] ++ extraRPackages; }}/bin/R"} \
${lib.optionalString (python3 != null) "--prefix QUARTO_PYTHON : ${python3.withPackages (ps: with ps; [ jupyter ipython ] ++ (extraPythonPackages ps))}/bin/python3"}
'';

View File

@ -1,8 +0,0 @@
--- a/bin/quarto
+++ b/bin/quarto
@@ -125,4 +125,4 @@ fi
# Be sure to include any already defined QUARTO_DENO_OPTIONS
QUARTO_DENO_OPTIONS="--unstable --no-config --cached-only --allow-read --allow-write --allow-run --allow-env --allow-net --allow-ffi ${QUARTO_DENO_OPTIONS}"
-"${QUARTO_DENO}" ${QUARTO_ACTION} ${QUARTO_DENO_OPTIONS} ${QUARTO_DENO_EXTRA_OPTIONS} "${QUARTO_IMPORT_ARGMAP}" "${QUARTO_TARGET}" "$@"
+deno ${QUARTO_ACTION} ${QUARTO_DENO_OPTIONS} ${QUARTO_DENO_EXTRA_OPTIONS} "${QUARTO_IMPORT_ARGMAP}" "${QUARTO_TARGET}" "$@"