Skip to content

Commit

Permalink
cargo-tauri{,_1}: use finalAttrs pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
TomaSajt committed Jan 13, 2025
1 parent c7e77c4 commit 94fe111
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 32 deletions.
13 changes: 6 additions & 7 deletions pkgs/by-name/ca/cargo-tauri/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
webkitgtk_4_1,
}:

rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage (finalAttrs: {
pname = "tauri";
version = "2.2.1";

src = fetchFromGitHub {
owner = "tauri-apps";
repo = "tauri";
tag = "tauri-v${version}";
tag = "tauri-v${finalAttrs.version}";
hash = "sha256-v9o+oqs6OZWhHv+PExo9juzTt7W80YOTkynzwvxpHGM=";
};

Expand All @@ -35,14 +35,13 @@ rustPlatform.buildRustPackage rec {
];

cargoBuildFlags = [ "--package tauri-cli" ];
cargoTestFlags = cargoBuildFlags;

passthru = {
# See ./doc/hooks/tauri.section.md
hook = callPackage ./hook.nix { };
hook = callPackage ./hook.nix { cargo-tauri = finalAttrs.finalPackage; };

tests = {
hook = callPackage ./test-app.nix { };
hook = callPackage ./test-app.nix { cargo-tauri = finalAttrs.finalPackage; };
};

updateScript = nix-update-script {
Expand All @@ -56,7 +55,7 @@ rustPlatform.buildRustPackage rec {
meta = {
description = "Build smaller, faster, and more secure desktop applications with a web frontend";
homepage = "https://tauri.app/";
changelog = "https://github.com/tauri-apps/tauri/releases/tag/tauri-v${version}";
changelog = "https://github.com/tauri-apps/tauri/releases/tag/tauri-v${finalAttrs.version}";
license = with lib.licenses; [
asl20 # or
mit
Expand All @@ -68,4 +67,4 @@ rustPlatform.buildRustPackage rec {
];
mainProgram = "cargo-tauri";
};
}
})
31 changes: 6 additions & 25 deletions pkgs/by-name/ca/cargo-tauri_1/package.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
cargo-tauri,
cargo-tauri_1,
gtk3,
libsoup_2_4,
openssl,
Expand All @@ -26,14 +24,12 @@ cargo-tauri.overrideAttrs (
# https://discourse.nixos.org/t/difficulty-using-buildrustpackage-with-a-src-containing-multiple-cargo-workspaces/10202
sourceRoot = "${newAttrs.src.name}/tooling/cli";

cargoDeps = rustPlatform.fetchCargoTarball {
inherit (newAttrs)
pname
version
src
sourceRoot
;
hash = "sha256-OIXC4kwGIemIL8KaqK5SUDZZrOX3PX0w3h9bNiM/pCw=";
cargoLock = null;
useFetchCargoVendor = false;
cargoHash = "sha256-OIXC4kwGIemIL8KaqK5SUDZZrOX3PX0w3h9bNiM/pCw=";

passthru = {
inherit (oldAttrs.passthru) hook;
};

buildInputs =
Expand All @@ -43,20 +39,5 @@ cargo-tauri.overrideAttrs (
libsoup_2_4
webkitgtk_4_0
];

passthru = {
hook = cargo-tauri.hook.override { cargo-tauri = cargo-tauri_1; };
};

meta = {
inherit (oldAttrs.meta)
description
homepage
changelog
license
maintainers
mainProgram
;
};
}
)

0 comments on commit 94fe111

Please sign in to comment.