nixpkgs/pkgs/by-name/ca/cargo-tauri/test-app.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

74 lines
1.5 KiB
Nix
Raw Normal View History

2024-08-17 23:31:20 +00:00
{
lib,
stdenv,
rustPlatform,
cargo-tauri,
glib-networking,
libayatana-appindicator,
nodejs,
2024-08-17 23:31:20 +00:00
openssl,
pkg-config,
pnpm_9,
webkitgtk_4_1,
wrapGAppsHook4,
2024-08-17 23:31:20 +00:00
}:
rustPlatform.buildRustPackage rec {
pname = "test-app";
inherit (cargo-tauri) version src;
cargoLock = {
inherit (cargo-tauri.cargoDeps) lockFile;
outputHashes = {
"schemars_derive-0.8.21" = "sha256-AmxBKZXm2Eb+w8/hLQWTol5f22uP8UqaIh+LVLbS20g=";
};
};
2024-08-17 23:31:20 +00:00
postPatch = lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace $cargoDepsCopy/libappindicator-sys-*/src/lib.rs \
--replace "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1"
'';
pnpmDeps = pnpm_9.fetchDeps {
inherit
pname
version
src
;
2024-08-17 23:31:20 +00:00
hash = "sha256-kTr61DFPIIYceB8tZrKFaMG65CZ//djGEOQBLRNPotk=";
};
2024-08-17 23:31:20 +00:00
nativeBuildInputs = [
cargo-tauri.hook
nodejs
2024-08-17 23:31:20 +00:00
pkg-config
pnpm_9.configHook
wrapGAppsHook4
2024-08-17 23:31:20 +00:00
];
buildInputs =
[ openssl ]
++ lib.optionals stdenv.isLinux [
glib-networking
libayatana-appindicator
webkitgtk_4_1
];
buildAndTestSubdir = "examples/api/src-tauri";
# This example depends on the actual `api` package to be built in-tree
preBuild = ''
pnpm --filter '@tauri-apps/api' build
'';
2024-08-17 23:31:20 +00:00
# No one should be actually running this, so lets save some time
buildType = "debug";
doCheck = false;
meta = {
inherit (cargo-tauri.hook.meta) platforms;
};
}