Unverified Commit 57d00f08 authored by Seth Flynn's avatar Seth Flynn
Browse files

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
parent e987fe73
Loading
Loading
Loading
Loading
+19 −11
Original line number Diff line number Diff line
{
  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 ];
  nativeBuildInputs = lib.optionals (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isLinux) [
    pkg-config
  ];

  buildInputs = [
    openssl
  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 [
    gtk4
    webkitgtk_4_1
      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 { };
+3 −0
Original line number Diff line number Diff line
@@ -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
    ]