From a73f6167693cdd22d538fb02b132597414d7b4e3 Mon Sep 17 00:00:00 2001 From: Gabriel Fontes Date: Fri, 17 May 2024 14:05:06 -0300 Subject: [PATCH 1/2] typst: add passthru.updateScript --- pkgs/by-name/ty/typst/package.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/by-name/ty/typst/package.nix b/pkgs/by-name/ty/typst/package.nix index af61bdedb11e..b5f29d73a3de 100644 --- a/pkgs/by-name/ty/typst/package.nix +++ b/pkgs/by-name/ty/typst/package.nix @@ -7,6 +7,7 @@ , xz , stdenv , darwin +, nix-update-script }: rustPlatform.buildRustPackage rec { @@ -53,6 +54,8 @@ rustPlatform.buildRustPackage rec { --zsh crates/typst-cli/artifacts/_typst ''; + passthru.updateScript = nix-update-script { }; + meta = { changelog = "https://github.com/typst/typst/releases/tag/${src.rev}"; description = "A new markup-based typesetting system that is powerful and easy to learn"; From 7bd6d9548ecf5424c825716215653d1a8177df8b Mon Sep 17 00:00:00 2001 From: Gabriel Fontes Date: Fri, 17 May 2024 14:23:47 -0300 Subject: [PATCH 2/2] typst: run tests --- pkgs/by-name/ty/typst/package.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/by-name/ty/typst/package.nix b/pkgs/by-name/ty/typst/package.nix index b5f29d73a3de..32c962e96e73 100644 --- a/pkgs/by-name/ty/typst/package.nix +++ b/pkgs/by-name/ty/typst/package.nix @@ -47,6 +47,12 @@ rustPlatform.buildRustPackage rec { OPENSSL_NO_VENDOR = true; }; + # Fix for "Found argument '--test-threads' which wasn't expected, or isn't valid in this context" + postPatch = '' + substituteInPlace tests/src/tests.rs --replace-fail 'ARGS.num_threads' 'ARGS.test_threads' + substituteInPlace tests/src/args.rs --replace-fail 'num_threads' 'test_threads' + ''; + postInstall = '' installManPage crates/typst-cli/artifacts/*.1 installShellCompletion \ @@ -54,6 +60,8 @@ rustPlatform.buildRustPackage rec { --zsh crates/typst-cli/artifacts/_typst ''; + cargoTestFlags = [ "--workspace" ]; + passthru.updateScript = nix-update-script { }; meta = {