Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at fix-function-merge 88 lines 2.5 kB view raw
1{ stdenv 2, lib 3, pandoc 4, typst 5, esbuild 6, deno 7, fetchurl 8, dart-sass 9, rWrapper 10, rPackages 11, extraRPackages ? [] 12, makeWrapper 13, runCommand 14, python3 15, quarto 16, extraPythonPackages ? ps: with ps; [] 17, sysctl 18}: 19 20stdenv.mkDerivation (final: { 21 pname = "quarto"; 22 version = "1.5.55"; 23 src = fetchurl { 24 url = "https://github.com/quarto-dev/quarto-cli/releases/download/v${final.version}/quarto-${final.version}-linux-amd64.tar.gz"; 25 sha256 = "sha256-1HqjMENJ1H5RBaKIRZoUDGrdSEQOhhIiRLIQFqnkFlk="; 26 }; 27 28 nativeBuildInputs = [ 29 makeWrapper 30 ]; 31 32 postPatch = '' 33 # Compat for Deno >=1.26 34 substituteInPlace bin/quarto.js \ 35 --replace-fail ']))?.trim();' ']))?.trim().split(" ")[0];' 36 ''; 37 38 dontStrip = true; 39 40 preFixup = '' 41 wrapProgram $out/bin/quarto \ 42 --prefix QUARTO_DENO : ${lib.getExe deno} \ 43 --prefix QUARTO_PANDOC : ${lib.getExe pandoc} \ 44 --prefix QUARTO_ESBUILD : ${lib.getExe esbuild} \ 45 --prefix QUARTO_DART_SASS : ${lib.getExe dart-sass} \ 46 --prefix QUARTO_TYPST : ${lib.getExe typst} \ 47 ${lib.optionalString (rWrapper != null) "--prefix QUARTO_R : ${rWrapper.override { packages = [ rPackages.rmarkdown ] ++ extraRPackages; }}/bin/R"} \ 48 ${lib.optionalString (python3 != null) "--prefix QUARTO_PYTHON : ${python3.withPackages (ps: with ps; [ jupyter ipython ] ++ (extraPythonPackages ps))}/bin/python3"} 49 ''; 50 51 installPhase = '' 52 runHook preInstall 53 54 mkdir -p $out/bin $out/share 55 56 rm -r bin/tools 57 58 mv bin/* $out/bin 59 mv share/* $out/share 60 61 runHook postInstall 62 ''; 63 64 passthru.tests = { 65 quarto-check = runCommand "quarto-check" { 66 nativeBuildInputs = lib.optionals stdenv.isDarwin [ sysctl ]; 67 } '' 68 export HOME="$(mktemp -d)" 69 ${quarto}/bin/quarto check 70 touch $out 71 ''; 72 }; 73 74 meta = with lib; { 75 description = "Open-source scientific and technical publishing system built on Pandoc"; 76 mainProgram = "quarto"; 77 longDescription = '' 78 Quarto is an open-source scientific and technical publishing system built on Pandoc. 79 Quarto documents are authored using markdown, an easy to write plain text format. 80 ''; 81 homepage = "https://quarto.org/"; 82 changelog = "https://github.com/quarto-dev/quarto-cli/releases/tag/v${version}"; 83 license = licenses.gpl2Plus; 84 maintainers = with maintainers; [ minijackson mrtarantoga ]; 85 platforms = platforms.all; 86 sourceProvenance = with sourceTypes; [ binaryNativeCode binaryBytecode ]; 87 }; 88})