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.4 KiB
Nix
Raw Normal View History

2024-08-17 23:31:20 +00:00
{
lib,
stdenv,
cargo-tauri,
glib-networking,
libayatana-appindicator,
nodejs,
2024-08-17 23:31:20 +00:00
openssl,
pkg-config,
pnpm_9,
rustPlatform,
webkitgtk_4_1,
wrapGAppsHook4,
2024-08-17 23:31:20 +00:00
}:
let
pnpm = pnpm_9;
in
stdenv.mkDerivation (finalAttrs: {
2024-08-17 23:31:20 +00:00
pname = "test-app";
inherit (cargo-tauri) version src;
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"
'';
inherit (cargo-tauri) cargoDeps;
pnpmDeps = pnpm.fetchDeps {
inherit (finalAttrs)
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.configHook
rustPlatform.cargoCheckHook
rustPlatform.cargoSetupHook
wrapGAppsHook4
2024-08-17 23:31:20 +00:00
];
buildInputs =
[ openssl ]
++ lib.optionals stdenv.hostPlatform.isLinux [
2024-08-17 23:31:20 +00:00
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;
};
})