about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/quarto
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-06-16 06:56:35 +0000
committerAlyssa Ross <hi@alyssa.is>2023-06-16 06:56:35 +0000
commit99fcaeccb89621dd492203ce1f2d551c06f228ed (patch)
tree41cb730ae07383004789779b0f6e11cb3f4642a3 /nixpkgs/pkgs/development/libraries/quarto
parent59c5f5ac8682acc13bb22bc29c7cf02f7d75f01f (diff)
parent75a5ebf473cd60148ba9aec0d219f72e5cf52519 (diff)
downloadnixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.gz
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.bz2
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.lz
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.xz
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.zst
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.zip
Merge branch 'nixos-unstable' of https://github.com/NixOS/nixpkgs
Conflicts:
	nixpkgs/nixos/modules/config/console.nix
	nixpkgs/nixos/modules/services/mail/mailman.nix
	nixpkgs/nixos/modules/services/mail/public-inbox.nix
	nixpkgs/nixos/modules/services/mail/rss2email.nix
	nixpkgs/nixos/modules/services/networking/ssh/sshd.nix
	nixpkgs/pkgs/applications/networking/instant-messengers/dino/default.nix
	nixpkgs/pkgs/applications/networking/irc/weechat/default.nix
	nixpkgs/pkgs/applications/window-managers/sway/default.nix
	nixpkgs/pkgs/build-support/go/module.nix
	nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix
	nixpkgs/pkgs/development/interpreters/python/default.nix
	nixpkgs/pkgs/development/node-packages/overrides.nix
	nixpkgs/pkgs/development/tools/b4/default.nix
	nixpkgs/pkgs/servers/dict/dictd-db.nix
	nixpkgs/pkgs/servers/mail/public-inbox/default.nix
	nixpkgs/pkgs/tools/security/pinentry/default.nix
	nixpkgs/pkgs/tools/text/unoconv/default.nix
	nixpkgs/pkgs/top-level/all-packages.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/quarto')
-rw-r--r--nixpkgs/pkgs/development/libraries/quarto/default.nix77
-rw-r--r--nixpkgs/pkgs/development/libraries/quarto/fix-deno-path.patch8
2 files changed, 85 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/quarto/default.nix b/nixpkgs/pkgs/development/libraries/quarto/default.nix
new file mode 100644
index 000000000000..4d24206b43ee
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/quarto/default.nix
@@ -0,0 +1,77 @@
+{ stdenv
+, lib
+, pandoc
+, esbuild
+, deno
+, fetchurl
+, nodePackages
+, rWrapper
+, rPackages
+, extraRPackages ? []
+, makeWrapper
+, python3
+, extraPythonPackages ? ps: with ps; []
+}:
+
+stdenv.mkDerivation rec {
+  pname = "quarto";
+  version = "1.2.475";
+  src = fetchurl {
+    url = "https://github.com/quarto-dev/quarto-cli/releases/download/v${version}/quarto-${version}-linux-amd64.tar.gz";
+    sha256 = "sha256-oyKjDlTKt2fIzirOqgNRrpuM7buNCG5mmgIztPa28rY=";
+  };
+
+  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_PANDOC : ${pandoc}/bin/pandoc \
+      --prefix QUARTO_ESBUILD : ${esbuild}/bin/esbuild \
+      --prefix QUARTO_DART_SASS : ${nodePackages.sass}/bin/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 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; [ minijackson mrtarantoga ];
+    platforms = [ "x86_64-linux" ];
+    sourceProvenance = with sourceTypes; [ binaryNativeCode binaryBytecode ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/quarto/fix-deno-path.patch b/nixpkgs/pkgs/development/libraries/quarto/fix-deno-path.patch
new file mode 100644
index 000000000000..895419712ad8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/quarto/fix-deno-path.patch
@@ -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}" "$@"