From f72cd87737b9c467344d551b1e6506206fd153d2 Mon Sep 17 00:00:00 2001 From: Jost Alemann Date: Fri, 7 Mar 2025 12:17:49 +0100 Subject: [PATCH 1/2] typst: 0.13.0 -> 0.13.1 Diff: https://github.com/typst/typst/compare/v0.13.0...v0.13.1 Changelog: https://github.com/typst/typst/blob/main/docs/changelog/0.13.1.md --- pkgs/by-name/ty/typst/package.nix | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/pkgs/by-name/ty/typst/package.nix b/pkgs/by-name/ty/typst/package.nix index f124c0e4c86c..6bfc6f431c9d 100644 --- a/pkgs/by-name/ty/typst/package.nix +++ b/pkgs/by-name/ty/typst/package.nix @@ -2,7 +2,6 @@ lib, rustPlatform, fetchFromGitHub, - fetchpatch, installShellFiles, pkg-config, openssl, @@ -13,27 +12,17 @@ rustPlatform.buildRustPackage rec { pname = "typst"; - version = "0.13.0"; + version = "0.13.1"; src = fetchFromGitHub { owner = "typst"; repo = "typst"; tag = "v${version}"; - hash = "sha256-3YLdHwDgQDQyW4R3BpZAEL49BBpgigev/5lbnhDIFgI="; + hash = "sha256-vbBwIQt4xWZaKpXgFwDsRQIQ0mmsQPRR39m8iZnnuj0="; }; useFetchCargoVendor = true; - cargoHash = "sha256-ey5pFGLgj17+RZGjpLOeN7Weh29jJyvuRrJ8wsIlC58="; - - patches = [ - (fetchpatch { - # typst 0.13.0 has a regression regarding usage of inotify when running `typst watch` - # also affects NixOS: https://github.com/typst/typst/issues/5903#issuecomment-2680985045 - name = "fix-high-cpu-in-watch-mode.patch"; - url = "https://patch-diff.githubusercontent.com/raw/typst/typst/pull/5905.patch"; - hash = "sha256-qq5Dj5kKSjdlHp8FOH+gQtzZGqzBscvG8ufSrL94tsY="; - }) - ]; + cargoHash = "sha256-4kVj2BODEFjLcrh5sxfcgsdLF2Zd3K1GnhA4DEz1Nl4="; nativeBuildInputs = [ installShellFiles From 9773a03aedf95fb31fc50e96229426693f4636f6 Mon Sep 17 00:00:00 2001 From: Jost Alemann Date: Fri, 7 Mar 2025 12:36:05 +0100 Subject: [PATCH 2/2] typst: use finalAttrs --- pkgs/by-name/ty/typst/package.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/ty/typst/package.nix b/pkgs/by-name/ty/typst/package.nix index 6bfc6f431c9d..14f8bce13750 100644 --- a/pkgs/by-name/ty/typst/package.nix +++ b/pkgs/by-name/ty/typst/package.nix @@ -10,14 +10,14 @@ versionCheckHook, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "typst"; version = "0.13.1"; src = fetchFromGitHub { owner = "typst"; repo = "typst"; - tag = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-vbBwIQt4xWZaKpXgFwDsRQIQ0mmsQPRR39m8iZnnuj0="; }; @@ -39,8 +39,8 @@ 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 = '' - # Fix for "Found argument '--test-threads' which wasn't expected, or isn't valid in this context" substituteInPlace tests/src/tests.rs --replace-fail 'ARGS.num_threads' 'ARGS.test_threads' substituteInPlace tests/src/args.rs --replace-fail 'num_threads' 'test_threads' ''; @@ -63,7 +63,7 @@ rustPlatform.buildRustPackage rec { passthru.updateScript = nix-update-script { }; meta = { - changelog = "https://github.com/typst/typst/releases/tag/v${version}"; + changelog = "https://github.com/typst/typst/releases/tag/v${finalAttrs.version}"; description = "New markup-based typesetting system that is powerful and easy to learn"; homepage = "https://github.com/typst/typst"; license = lib.licenses.asl20; @@ -74,4 +74,4 @@ rustPlatform.buildRustPackage rec { kanashimia ]; }; -} +})