Unverified Commit f70fb77e authored by seth's avatar seth
Browse files

cargo-tauri: add test for setup hooks

parent b833d6a1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -50,6 +50,10 @@ rustPlatform.buildRustPackage rec {
  passthru = {
    # See ./doc/hooks/tauri.section.md
    hook = callPackage ./hook.nix { };

    tests = {
      setupHooks = callPackage ./test-app.nix { };
    };
  };

  meta = {
+60 −0
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  rustPlatform,
  cargo-tauri,
  darwin,
  glib-networking,
  libsoup,
  openssl,
  pkg-config,
  webkitgtk,
  wrapGAppsHook3,
}:

rustPlatform.buildRustPackage rec {
  pname = "test-app";
  inherit (cargo-tauri) version src;

  # Basic example provided by upstream
  sourceRoot = "${src.name}/examples/workspace";

  cargoPatches = [
    # https://github.com/NixOS/nixpkgs/issues/332957
    ./update-time-crate.patch
  ];

  cargoHash = "sha256-ull9BWzeKsnMi4wcH67FnKFzTjqEdiRlM3f+EKIPvvU=";

  nativeBuildInputs = [
    cargo-tauri.hook

    pkg-config
    wrapGAppsHook3
  ];

  buildInputs =
    [ openssl ]
    ++ lib.optionals stdenv.isLinux [
      glib-networking
      libsoup
      webkitgtk
    ]
    ++ lib.optionals stdenv.isDarwin (
      with darwin.apple_sdk.frameworks;
      [
        AppKit
        CoreServices
        Security
        WebKit
      ]
    );

  # No one should be actually running this, so lets save some time
  buildType = "debug";
  doCheck = false;

  meta = {
    inherit (cargo-tauri.hook.meta) platforms;
  };
}
+1378 −0

File added.

Preview size limit exceeded, changes collapsed.