2022-09-30 11:47:45 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, pandoc
|
|
|
|
, esbuild
|
|
|
|
, deno
|
|
|
|
, fetchurl
|
|
|
|
, nodePackages
|
|
|
|
, rWrapper
|
|
|
|
, rPackages
|
2023-03-30 22:05:00 +00:00
|
|
|
, extraRPackages ? []
|
2022-09-30 11:47:45 +00:00
|
|
|
, makeWrapper
|
|
|
|
, python3
|
2023-03-30 22:05:00 +00:00
|
|
|
, extraPythonPackages ? ps: with ps; []
|
2022-09-30 11:47:45 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "quarto";
|
2023-03-30 22:05:00 +00:00
|
|
|
version = "1.2.475";
|
2022-09-30 11:47:45 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/quarto-dev/quarto-cli/releases/download/v${version}/quarto-${version}-linux-amd64.tar.gz";
|
2023-03-30 22:05:00 +00:00
|
|
|
sha256 = "sha256-oyKjDlTKt2fIzirOqgNRrpuM7buNCG5mmgIztPa28rY=";
|
2022-09-30 11:47:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
./fix-deno-path.patch
|
|
|
|
];
|
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
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('
|
|
|
|
'';
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
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 : ${nodePackages.sass}/bin/sass \
|
2023-03-30 22:05:00 +00:00
|
|
|
--prefix QUARTO_R : ${rWrapper.override { packages = [ rPackages.rmarkdown ] ++ extraRPackages; }}/bin/R \
|
|
|
|
--prefix QUARTO_PYTHON : ${python3.withPackages (ps: with ps; [ jupyter ipython ] ++ (extraPythonPackages ps))}/bin/python3
|
2022-09-30 11:47:45 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/bin $out/share
|
|
|
|
|
|
|
|
rm -r bin/tools
|
|
|
|
|
|
|
|
mv bin/* $out/bin
|
|
|
|
mv share/* $out/share
|
|
|
|
|
|
|
|
runHook preInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Open-source scientific and technical publishing system built on Pandoc";
|
|
|
|
longDescription = ''
|
|
|
|
Quarto is an open-source scientific and technical publishing system built on Pandoc.
|
|
|
|
Quarto documents are authored using markdown, an easy to write plain text format.
|
|
|
|
'';
|
|
|
|
homepage = "https://quarto.org/";
|
|
|
|
changelog = "https://github.com/quarto-dev/quarto-cli/releases/tag/v${version}";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = with maintainers; [ mrtarantoga ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode binaryBytecode ];
|
|
|
|
};
|
|
|
|
}
|