1
1
class BitwardenCli < Formula
2
2
desc "Secure and free password manager for all of your devices"
3
3
homepage "https://bitwarden.com/"
4
- url "https://github.com/bitwarden/clients/archive/refs/tags/cli-v2025.2 .0.tar.gz"
5
- sha256 "2c31f8f66e197d5bcbc656c258d4556c97e49a940cabad3ec76ff3742b5252c7 "
4
+ url "https://github.com/bitwarden/clients/archive/refs/tags/cli-v2025.5 .0.tar.gz"
5
+ sha256 "247ca881c8a9f407c494977f7e8555fe11beff017d0cfda6a6d437ec0c0978d6 "
6
6
license "GPL-3.0-only"
7
7
8
8
livecheck do
@@ -23,12 +23,25 @@ class BitwardenCli < Formula
23
23
depends_on "node"
24
24
25
25
def install
26
- system "npm" , "ci" , "--ignore-scripts"
26
+ # Fix to build error with xcode 16.3 for `argon2`
27
+ # Issue ref:
28
+ # - https://github.com/bitwarden/clients/issues/15000
29
+ # - https://github.com/ranisalt/node-argon2/issues/448
30
+ inreplace "package.json" , '"argon2": "0.41.1"' , '"argon2": "0.43.0"'
31
+ inreplace "apps/cli/package.json" , '"argon2": "0.41.1"' , '"argon2": "0.43.0"'
32
+
33
+ # Fix to Error: Cannot find module 'semver'
34
+ # PR ref: https://github.com/bitwarden/clients/pull/15005
35
+ system "npm" , "install" , "semver" , *std_npm_args
36
+ system "npm" , "install" , *std_npm_args
27
37
28
38
cd buildpath /"apps/cli" do
29
39
# The `oss` build of Bitwarden is a GPL backed build
30
40
system "npm" , "run" , "build:oss:prod" , "--ignore-scripts"
31
41
cd "./build" do
42
+ # Fix to Error: Cannot find module 'semver'
43
+ # PR ref: https://github.com/bitwarden/clients/pull/15005
44
+ system "npm" , "install" , "semver" , *std_npm_args
32
45
system "npm" , "install" , *std_npm_args
33
46
bin . install_symlink Dir [ libexec /"bin/*" ]
34
47
end
@@ -37,10 +50,13 @@ def install
37
50
# Remove incompatible pre-built `argon2` binaries
38
51
os = OS . kernel_name . downcase
39
52
arch = Hardware ::CPU . intel? ? "x64" : Hardware ::CPU . arch . to_s
40
- node_modules = libexec /"lib/node_modules/@bitwarden/cli/node_modules"
41
- ( node_modules /"argon2/prebuilds/linux-arm64/argon2.armv8.musl.node" ) . unlink
42
- ( node_modules /"argon2/prebuilds/linux-x64/argon2.musl.node" ) . unlink
43
- ( node_modules /"argon2/prebuilds" ) . each_child { |dir | rm_r ( dir ) if dir . basename . to_s != "#{ os } -#{ arch } " }
53
+ base = ( libexec /"lib/node_modules/@bitwarden" )
54
+ universals = "{@microsoft/signalr/node_modules/utf-8-validate,bufferutil,utf-8-validate}"
55
+ base . glob ( "clients/node_modules/#{ universals } /prebuilds/{darwin-x64+arm64,linux-x64}/*.node" ) . each ( &:unlink )
56
+ base . glob ( "{cli,clients}/node_modules/argon2/prebuilds" ) do |path |
57
+ path . glob ( "**/*.musl.node" ) . each ( &:unlink )
58
+ path . children . each { |dir | rm_r ( dir ) if dir . directory? && dir . basename . to_s != "#{ os } -#{ arch } " }
59
+ end
44
60
45
61
generate_completions_from_executable ( bin /"bw" , "completion" , shells : [ :zsh ] , shell_parameter_format : :arg )
46
62
end
0 commit comments