From 57d00f085573f1bf3efc6e39481686c5abe86f9c Mon Sep 17 00:00:00 2001 From: Seth Flynn Date: Thu, 21 Aug 2025 18:10:29 -0400 Subject: [PATCH] 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 ]