From 9201c2e674f2a6985f115b04159023be9199f341 Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Sun, 31 Dec 2023 13:53:50 -0500 Subject: [PATCH 1/2] bitwarden: Filter patches for cargo sourceRoot Since we pass `sourceRoot` to `fetchCargoTarball`, any patches that affect files outside of that `sourceRoot` will fail to apply. So map each patch to remove any diff hunks outside that `sourceRoot`. This was only working before due to the FOD being cached from before such problematic patches were added (in commit 333dadbe66d8b97cc27b9806d869e615ecc05b37). --- pkgs/tools/security/bitwarden/default.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/security/bitwarden/default.nix b/pkgs/tools/security/bitwarden/default.nix index c08da90f59b4..7c2554f6365e 100644 --- a/pkgs/tools/security/bitwarden/default.nix +++ b/pkgs/tools/security/bitwarden/default.nix @@ -16,8 +16,10 @@ , moreutils , napi-rs-cli , nodejs_18 +, patchutils_0_4_2 , pkg-config , python3 +, runCommand , rustc , rustPlatform }: @@ -55,7 +57,16 @@ in buildNpmPackage rec { cargoDeps = rustPlatform.fetchCargoTarball { name = "${pname}-${version}"; - inherit patches src; + inherit src; + patches = map + (patch: runCommand + (builtins.baseNameOf patch) + { nativeBuildInputs = [ patchutils_0_4_2 ]; } + '' + < ${patch} filterdiff -p1 --include=${lib.escapeShellArg cargoRoot}'/*' > $out + '' + ) + patches; patchFlags = [ "-p4" ]; sourceRoot = "${src.name}/${cargoRoot}"; hash = "sha256-pCy3hGhI3mXm4uTOaFMykOzJqK2PC0t0hE8MrJKtA/k="; From 31928d049dc63579d6247f8dc999a5d24ce87e84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 27 Dec 2023 16:09:55 +0100 Subject: [PATCH 2/2] bitwarden: 2023.12.0 -> 2023.12.1 Diff: https://github.com/bitwarden/clients/compare/desktop-v2023.12.0...desktop-v2023.12.1 Changelog: https://github.com/bitwarden/clients/releases/tag/desktop-v2023.12.1 --- pkgs/tools/security/bitwarden/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/security/bitwarden/default.nix b/pkgs/tools/security/bitwarden/default.nix index 7c2554f6365e..f5091a4b084c 100644 --- a/pkgs/tools/security/bitwarden/default.nix +++ b/pkgs/tools/security/bitwarden/default.nix @@ -30,13 +30,13 @@ let electron = electron_27; in buildNpmPackage rec { pname = "bitwarden"; - version = "2023.12.0"; + version = "2023.12.1"; src = fetchFromGitHub { owner = "bitwarden"; repo = "clients"; rev = "desktop-v${version}"; - hash = "sha256-WYhLKV3j3Ktite5u1H4fSku38hCCrMzKoxtjq6aT9yo="; + hash = "sha256-kmMEi9jYMPFHIdXyZAkeu8rh+34fEAkFw9uhwUt5k9o="; }; patches = [ @@ -53,7 +53,7 @@ in buildNpmPackage rec { makeCacheWritable = true; npmWorkspace = "apps/desktop"; - npmDepsHash = "sha256-QwG+D0M94HN1AyQlmzKeScZyksiUr5A9igEaox9DYN4="; + npmDepsHash = "sha256-IDqyHiXdMezdPNlZDyRdNzwC3SO5G3gI3h5zoxzzz/g="; cargoDeps = rustPlatform.fetchCargoTarball { name = "${pname}-${version}"; @@ -69,7 +69,7 @@ in buildNpmPackage rec { patches; patchFlags = [ "-p4" ]; sourceRoot = "${src.name}/${cargoRoot}"; - hash = "sha256-pCy3hGhI3mXm4uTOaFMykOzJqK2PC0t0hE8MrJKtA/k="; + hash = "sha256-8A33f2q9GoSM8Wh55iqnSfqWIpeRBz+EQT+rmsZsuXs="; }; cargoRoot = "apps/desktop/desktop_native";