From 57d00f085573f1bf3efc6e39481686c5abe86f9c Mon Sep 17 00:00:00 2001 From: Seth Flynn Date: Thu, 21 Aug 2025 18:10:29 -0400 Subject: [PATCH 1/5] cargo-tauri: cleanup dependencies This removes the {,webkit}gtk dependencies that aren't directly used by the CLI, while explicitly declaring the some dependencies that were previously being pulled in through {,webkit}gtk or just vendored by crates --- pkgs/by-name/ca/cargo-tauri/package.nix | 30 ++++++++++++++--------- pkgs/by-name/ca/cargo-tauri_1/package.nix | 3 +++ 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/pkgs/by-name/ca/cargo-tauri/package.nix b/pkgs/by-name/ca/cargo-tauri/package.nix index 317b40b2735a..f2acfc74c8e1 100644 --- a/pkgs/by-name/ca/cargo-tauri/package.nix +++ b/pkgs/by-name/ca/cargo-tauri/package.nix @@ -1,14 +1,14 @@ { lib, stdenv, + bzip2, callPackage, rustPlatform, fetchFromGitHub, - gtk4, nix-update-script, - openssl, pkg-config, - webkitgtk_4_1, + xz, + zstd, }: rustPlatform.buildRustPackage rec { @@ -24,19 +24,27 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-nkY1ydc2VewRwY+B5nR68mz8Ff3FK1KoHE4dLzNtPkY="; - nativeBuildInputs = [ pkg-config ]; - - buildInputs = [ - openssl - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - gtk4 - webkitgtk_4_1 + nativeBuildInputs = lib.optionals (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isLinux) [ + pkg-config ]; + buildInputs = + # Required for tauri-macos-sign and RPM support in tauri-bundler + lib.optionals (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isLinux) [ + bzip2 + xz + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + zstd + ]; + cargoBuildFlags = [ "--package tauri-cli" ]; cargoTestFlags = cargoBuildFlags; + env = lib.optionalAttrs stdenv.hostPlatform.isLinux { + ZSTD_SYS_USE_PKG_CONFIG = true; + }; + passthru = { # See ./doc/hooks/tauri.section.md hook = callPackage ./hook.nix { }; diff --git a/pkgs/by-name/ca/cargo-tauri_1/package.nix b/pkgs/by-name/ca/cargo-tauri_1/package.nix index 453295d5fa78..cc05adcca3cb 100644 --- a/pkgs/by-name/ca/cargo-tauri_1/package.nix +++ b/pkgs/by-name/ca/cargo-tauri_1/package.nix @@ -8,6 +8,7 @@ gtk3, libsoup_2_4, openssl, + pkg-config, webkitgtk_4_0, }: @@ -36,6 +37,8 @@ cargo-tauri.overrideAttrs ( hash = "sha256-t5sR02qC06H7A2vukwyZYKA2XMVUzJrgIOYuNSf42mE="; }; + nativeBuildInputs = oldAttrs.nativeBuildInputs or [ ] ++ [ pkg-config ]; + buildInputs = [ openssl ] From 91d17ed9d768ca106a92eda767ba2daa4401ae79 Mon Sep 17 00:00:00 2001 From: Seth Flynn Date: Thu, 21 Aug 2025 19:25:50 -0400 Subject: [PATCH 2/5] cargo-tauri: rec -> finalAttrs --- pkgs/by-name/ca/cargo-tauri/package.nix | 14 +++++++------- pkgs/by-name/ca/cargo-tauri_1/package.nix | 5 +---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/pkgs/by-name/ca/cargo-tauri/package.nix b/pkgs/by-name/ca/cargo-tauri/package.nix index f2acfc74c8e1..bf466fd86d9c 100644 --- a/pkgs/by-name/ca/cargo-tauri/package.nix +++ b/pkgs/by-name/ca/cargo-tauri/package.nix @@ -11,14 +11,14 @@ zstd, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "tauri"; version = "2.7.1"; src = fetchFromGitHub { owner = "tauri-apps"; repo = "tauri"; - tag = "tauri-cli-v${version}"; + tag = "tauri-cli-v${finalAttrs.version}"; hash = "sha256-0J55AvAvvqTVls4474GcgLPBtSC+rh8cXVKluMjAVBE="; }; @@ -39,7 +39,7 @@ rustPlatform.buildRustPackage rec { ]; cargoBuildFlags = [ "--package tauri-cli" ]; - cargoTestFlags = cargoBuildFlags; + cargoTestFlags = finalAttrs.cargoBuildFlags; env = lib.optionalAttrs stdenv.hostPlatform.isLinux { ZSTD_SYS_USE_PKG_CONFIG = true; @@ -47,10 +47,10 @@ rustPlatform.buildRustPackage rec { passthru = { # See ./doc/hooks/tauri.section.md - hook = callPackage ./hook.nix { }; + hook = callPackage ./hook.nix { cargo-tauri = finalAttrs.finalPackage; }; tests = { - hook = callPackage ./test-app.nix { }; + hook = callPackage ./test-app.nix { cargo-tauri = finalAttrs.finalPackage; }; }; updateScript = nix-update-script { @@ -64,7 +64,7 @@ rustPlatform.buildRustPackage rec { meta = { description = "Build smaller, faster, and more secure desktop applications with a web frontend"; homepage = "https://tauri.app/"; - changelog = "https://github.com/tauri-apps/tauri/releases/tag/${src.tag}"; + changelog = "https://github.com/tauri-apps/tauri/releases/tag/tauri-cli-v${finalAttrs.version}"; license = with lib.licenses; [ asl20 # or mit @@ -76,4 +76,4 @@ rustPlatform.buildRustPackage rec { ]; mainProgram = "cargo-tauri"; }; -} +}) diff --git a/pkgs/by-name/ca/cargo-tauri_1/package.nix b/pkgs/by-name/ca/cargo-tauri_1/package.nix index cc05adcca3cb..03ba763bb62d 100644 --- a/pkgs/by-name/ca/cargo-tauri_1/package.nix +++ b/pkgs/by-name/ca/cargo-tauri_1/package.nix @@ -4,7 +4,6 @@ rustPlatform, fetchFromGitHub, cargo-tauri, - cargo-tauri_1, gtk3, libsoup_2_4, openssl, @@ -48,9 +47,7 @@ cargo-tauri.overrideAttrs ( webkitgtk_4_0 ]; - passthru = { - hook = cargo-tauri.hook.override { cargo-tauri = cargo-tauri_1; }; - }; + passthru = { inherit (oldAttrs.passthru) hook; }; meta = { inherit (oldAttrs.meta) From ca436e95e26d97efd31bcf748767d291d1bdaf69 Mon Sep 17 00:00:00 2001 From: Seth Flynn Date: Thu, 21 Aug 2025 19:54:47 -0400 Subject: [PATCH 3/5] cargo-tauri: add version test --- pkgs/by-name/ca/cargo-tauri/package.nix | 2 ++ pkgs/by-name/ca/cargo-tauri_1/package.nix | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/ca/cargo-tauri/package.nix b/pkgs/by-name/ca/cargo-tauri/package.nix index bf466fd86d9c..befe5011f2dc 100644 --- a/pkgs/by-name/ca/cargo-tauri/package.nix +++ b/pkgs/by-name/ca/cargo-tauri/package.nix @@ -7,6 +7,7 @@ fetchFromGitHub, nix-update-script, pkg-config, + testers, xz, zstd, }: @@ -51,6 +52,7 @@ rustPlatform.buildRustPackage (finalAttrs: { tests = { hook = callPackage ./test-app.nix { cargo-tauri = finalAttrs.finalPackage; }; + version = testers.testVersion { package = finalAttrs.finalPackage; }; }; updateScript = nix-update-script { diff --git a/pkgs/by-name/ca/cargo-tauri_1/package.nix b/pkgs/by-name/ca/cargo-tauri_1/package.nix index 03ba763bb62d..9c82a73ca686 100644 --- a/pkgs/by-name/ca/cargo-tauri_1/package.nix +++ b/pkgs/by-name/ca/cargo-tauri_1/package.nix @@ -47,7 +47,10 @@ cargo-tauri.overrideAttrs ( webkitgtk_4_0 ]; - passthru = { inherit (oldAttrs.passthru) hook; }; + passthru = { + inherit (oldAttrs.passthru) hook; + tests = { inherit (oldAttrs.passthru.tests) version; }; + }; meta = { inherit (oldAttrs.meta) From 1f9e69f7535e03f12e103bf2a655681a9cca6955 Mon Sep 17 00:00:00 2001 From: Seth Flynn Date: Thu, 21 Aug 2025 19:08:00 -0400 Subject: [PATCH 4/5] cargo-tauri_1: cleanup dependencies This removes the {,webkit}gtk dependencies that aren't directly used by the CLI, while explicitly declaring the some dependencies that were previously being pulled in through {,webkit}gtk or just vendored by crates --- pkgs/by-name/ca/cargo-tauri_1/package.nix | 26 ++++++++++++----------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/ca/cargo-tauri_1/package.nix b/pkgs/by-name/ca/cargo-tauri_1/package.nix index 9c82a73ca686..0facf494764b 100644 --- a/pkgs/by-name/ca/cargo-tauri_1/package.nix +++ b/pkgs/by-name/ca/cargo-tauri_1/package.nix @@ -1,14 +1,13 @@ { lib, stdenv, - rustPlatform, + bzip2, fetchFromGitHub, - cargo-tauri, - gtk3, - libsoup_2_4, - openssl, pkg-config, - webkitgtk_4_0, + rustPlatform, + xz, + zstd, + cargo-tauri, }: cargo-tauri.overrideAttrs ( @@ -39,13 +38,16 @@ cargo-tauri.overrideAttrs ( nativeBuildInputs = oldAttrs.nativeBuildInputs or [ ] ++ [ pkg-config ]; buildInputs = [ - openssl + # Required by `zip` in `tauri-bundler` + bzip2 + zstd ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - gtk3 - libsoup_2_4 - webkitgtk_4_0 - ]; + # Required by `rpm` in `tauri-bundler` + ++ lib.optionals stdenv.hostPlatform.isLinux [ xz ]; + + env = { + ZSTD_SYS_USE_PKG_CONFIG = true; + }; passthru = { inherit (oldAttrs.passthru) hook; From e3a9a74a5e3e7fdcdf71a2b79dd7a74dddc7a229 Mon Sep 17 00:00:00 2001 From: Seth Flynn Date: Thu, 21 Aug 2025 19:41:57 -0400 Subject: [PATCH 5/5] cargo-tauri_1: 1.8.1 -> 1.6.6 This appears to be a downgrade, but is actually a upgrade! Previously this package tracked the main `tauri` crate, and not the actual CLI. Oops. Diff: https://github.com/tauri-apps/tauri/compare/tauri-v1.8.1...tauri-cli-v1.6.6 Changelog: https://github.com/tauri-apps/tauri/releases/tag/tauri-cli-v1.6.6 --- pkgs/by-name/ca/cargo-tauri_1/package.nix | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/pkgs/by-name/ca/cargo-tauri_1/package.nix b/pkgs/by-name/ca/cargo-tauri_1/package.nix index 0facf494764b..fd19b708fdcd 100644 --- a/pkgs/by-name/ca/cargo-tauri_1/package.nix +++ b/pkgs/by-name/ca/cargo-tauri_1/package.nix @@ -2,7 +2,6 @@ lib, stdenv, bzip2, - fetchFromGitHub, pkg-config, rustPlatform, xz, @@ -11,28 +10,25 @@ }: cargo-tauri.overrideAttrs ( - newAttrs: oldAttrs: { - version = "1.8.1"; + finalAttrs: oldAttrs: { + version = "1.6.6"; - src = fetchFromGitHub { - owner = "tauri-apps"; - repo = "tauri"; - rev = "tauri-v${newAttrs.version}"; - hash = "sha256-z8dfiLghN6m95PLCMDgpBMNo+YEvvsGN9F101fAcVF4="; + src = oldAttrs.src.override { + hash = "sha256-UE/mJ0WdbVT4E1YuUCtu80UB+1WR+KRWs+4Emy3Nclc="; }; # Manually specify the sourceRoot since this crate depends on other crates in the workspace. Relevant info at # https://discourse.nixos.org/t/difficulty-using-buildrustpackage-with-a-src-containing-multiple-cargo-workspaces/10202 - sourceRoot = "${newAttrs.src.name}/tooling/cli"; + sourceRoot = "${finalAttrs.src.name}/tooling/cli"; cargoDeps = rustPlatform.fetchCargoVendor { - inherit (newAttrs) + inherit (finalAttrs) pname version src sourceRoot ; - hash = "sha256-t5sR02qC06H7A2vukwyZYKA2XMVUzJrgIOYuNSf42mE="; + hash = "sha256-kAaq6Kam3e5n8569Y4zdFEiClI8q97XFX1hBD7NkUqw="; }; nativeBuildInputs = oldAttrs.nativeBuildInputs or [ ] ++ [ pkg-config ];