cargo-tauri: add test for setup hooks

This commit is contained in:
seth
2024-08-17 19:31:20 -04:00
parent b833d6a1d3
commit f70fb77ea1
3 changed files with 1442 additions and 0 deletions
+4
View File
@@ -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
View File
@@ -0,0 +1,60 @@
{
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;
};
}
File diff suppressed because it is too large Load Diff