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
This commit is contained in:
Seth Flynn
2025-08-21 19:48:10 -04:00
parent e987fe735e
commit 57d00f0855
2 changed files with 22 additions and 11 deletions
+19 -11
View File
@@ -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 { };
@@ -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
]