1{ stdenv
2, lib
3, pandoc
4, esbuild
5, deno
6, fetchurl
7, nodePackages
8, rWrapper
9, rPackages
10, makeWrapper
11, python3
12}:
13
14stdenv.mkDerivation rec {
15 pname = "quarto";
16 version = "1.1.251";
17 src = fetchurl {
18 url = "https://github.com/quarto-dev/quarto-cli/releases/download/v${version}/quarto-${version}-linux-amd64.tar.gz";
19 sha256 = "sha256-VEYUEI4xzQPXlyTbCThAW2npBCZNPDJ5x2cWnkNz7RE=";
20 };
21
22 nativeBuildInputs = [
23 makeWrapper
24 ];
25
26 patches = [
27 ./fix-deno-path.patch
28 ];
29
30 dontStrip = true;
31
32 preFixup = ''
33 wrapProgram $out/bin/quarto \
34 --prefix PATH : ${lib.makeBinPath [ deno ]} \
35 --prefix QUARTO_PANDOC : ${pandoc}/bin/pandoc \
36 --prefix QUARTO_ESBUILD : ${esbuild}/bin/esbuild \
37 --prefix QUARTO_DART_SASS : ${nodePackages.sass}/bin/sass \
38 --prefix QUARTO_R : ${rWrapper.override { packages = [ rPackages.rmarkdown]; }}/bin/R \
39 --prefix QUARTO_PYTHON : ${python3.withPackages (ps: with ps; [ jupyter ipython ])}/bin/python3
40 '';
41
42 installPhase = ''
43 runHook preInstall
44
45 mkdir -p $out/bin $out/share
46
47 rm -r bin/tools
48
49 mv bin/* $out/bin
50 mv share/* $out/share
51
52 runHook preInstall
53 '';
54
55 meta = with lib; {
56 description = "Open-source scientific and technical publishing system built on Pandoc";
57 longDescription = ''
58 Quarto is an open-source scientific and technical publishing system built on Pandoc.
59 Quarto documents are authored using markdown, an easy to write plain text format.
60 '';
61 homepage = "https://quarto.org/";
62 changelog = "https://github.com/quarto-dev/quarto-cli/releases/tag/v${version}";
63 license = licenses.gpl2Plus;
64 maintainers = with maintainers; [ mrtarantoga ];
65 platforms = [ "x86_64-linux" ];
66 sourceProvenance = with sourceTypes; [ binaryNativeCode binaryBytecode ];
67 };
68}