From 0cebd281a7244b7552e6983d94c208e916639673 Mon Sep 17 00:00:00 2001 From: quantenzitrone Date: Fri, 6 Feb 2026 22:10:13 +0100 Subject: [PATCH] cargo-mobile2: refactor this shouldn't create any rebuilds --- pkgs/by-name/ca/cargo-mobile2/package.nix | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/ca/cargo-mobile2/package.nix b/pkgs/by-name/ca/cargo-mobile2/package.nix index d7d8b6830443..ecb7bddbd8fc 100644 --- a/pkgs/by-name/ca/cargo-mobile2/package.nix +++ b/pkgs/by-name/ca/cargo-mobile2/package.nix @@ -8,16 +8,14 @@ makeWrapper, }: -let +rustPlatform.buildRustPackage (finalAttrs: { pname = "cargo-mobile2"; version = "0.22.2"; -in -rustPlatform.buildRustPackage { - inherit pname version; + src = fetchFromGitHub { owner = "tauri-apps"; repo = "cargo-mobile2"; - rev = "cargo-mobile2-v${version}"; + rev = "cargo-mobile2-v${finalAttrs.version}"; hash = "sha256-pSp7w823Jjjg0PEnCc7jVLBbOgvR7JAjtD8OK5voC0A="; }; @@ -27,12 +25,6 @@ rustPlatform.buildRustPackage { cargoHash = "sha256-aci1QF/O2J6Yix4UkxPCVW+c+xoqm7AvdhlkF7y1GqA="; - preBuild = '' - mkdir -p $out/share/ - # during the install process tauri-mobile puts templates and commit information in CARGO_HOME - export CARGO_HOME=$out/share/ - ''; - buildInputs = [ openssl ]; nativeBuildInputs = [ pkg-config @@ -40,6 +32,12 @@ rustPlatform.buildRustPackage { makeWrapper ]; + preBuild = '' + mkdir -p $out/share/ + # during the install process tauri-mobile puts templates and commit information in CARGO_HOME + export CARGO_HOME=$out/share/ + ''; + preFixup = '' for bin in $out/bin/cargo-*; do wrapProgram $bin \ @@ -56,4 +54,4 @@ rustPlatform.buildRustPackage { ]; maintainers = with lib.maintainers; [ happysalada ]; }; -} +})