forked from olynch/scientific-fhs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
103 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- 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}" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{ stdenv | ||
, lib | ||
, esbuild | ||
, deno | ||
, fetchurl | ||
, dart-sass | ||
, rWrapper | ||
, rPackages | ||
, extraRPackages ? [] | ||
, makeWrapper | ||
, runCommand | ||
, python3 | ||
, quarto | ||
, extraPythonPackages ? ps: with ps; [] | ||
, sysctl | ||
}: | ||
|
||
stdenv.mkDerivation (final: { | ||
pname = "quarto"; | ||
version = "1.3.450"; | ||
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="; | ||
}; | ||
|
||
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(' | ||
''; | ||
|
||
dontStrip = true; | ||
|
||
preFixup = '' | ||
wrapProgram $out/bin/quarto \ | ||
--prefix PATH : ${lib.makeBinPath [ deno ]} \ | ||
--prefix QUARTO_ESBUILD : ${esbuild}/bin/esbuild \ | ||
--prefix QUARTO_DART_SASS : ${dart-sass}/bin/dart-sass \ | ||
${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"} | ||
''; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
mkdir -p $out/bin $out/share | ||
rm -r bin/tools | ||
mv bin/* $out/bin | ||
mv share/* $out/share | ||
runHook postInstall | ||
''; | ||
|
||
passthru.tests = { | ||
quarto-check = runCommand "quarto-check" { | ||
nativeBuildInputs = lib.optionals stdenv.isDarwin [ sysctl ]; | ||
} '' | ||
export HOME="$(mktemp -d)" | ||
${quarto}/bin/quarto check | ||
touch $out | ||
''; | ||
}; | ||
|
||
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; [ minijackson mrtarantoga ]; | ||
platforms = platforms.all; | ||
sourceProvenance = with sourceTypes; [ binaryNativeCode binaryBytecode ]; | ||
}; | ||
}) |