From 8520aa81ac3ec37b181b412e10f5cf3d72e271ce Mon Sep 17 00:00:00 2001 From: Michael Herrmann Date: Wed, 8 Oct 2025 19:23:54 +0200 Subject: [PATCH] Add dep `crx` to GN target create_dist_mac (#31702) Add dep crx to target create_dist_mac This lets us use `npm run create_dist` to build the crx for macOS. --- build/mac/BUILD.gn | 21 +++++++++++---------- build/mac/config.gni | 3 +++ updater/.gitignore | 1 - 3 files changed, 14 insertions(+), 11 deletions(-) delete mode 100644 updater/.gitignore diff --git a/build/mac/BUILD.gn b/build/mac/BUILD.gn index b142598c454..eadb1bb5096 100644 --- a/build/mac/BUILD.gn +++ b/build/mac/BUILD.gn @@ -401,16 +401,17 @@ group("create_dist_mac") { } } } + if (dmg_crx_private_key != "") { + deps += [ ":crx" ] + } } -crx3("crx") { - inputs = [ dmg_path ] - output = "$packaged_basename.crx3" - base_dir = get_path_info(dmg_path, "dir") - - # The private key file is not in Git for obvious reasons. It needs to be - # copied into this directory manually. Changing the private key requires - # also changing kBravePublisherKeyHash in crx_verifier.cc. - key = "//brave/updater/crx-private-key.der" - deps = [ ":package" ] +if (dmg_crx_private_key != "") { + crx3("crx") { + inputs = [ dmg_path ] + output = "$packaged_basename.crx3" + base_dir = get_path_info(dmg_path, "dir") + key = dmg_crx_private_key + deps = [ ":package" ] + } } diff --git a/build/mac/config.gni b/build/mac/config.gni index e2711b91cac..cab3effc83d 100644 --- a/build/mac/config.gni +++ b/build/mac/config.gni @@ -23,6 +23,9 @@ declare_args() { # we have fully migrated to Omaha 4, we will remove this GN arg with a default # value of true. install_omaha4_with_pkg = false + + # Path to the private key that is used to sign browser updates. + dmg_crx_private_key = "" } if (host_os == "mac") { diff --git a/updater/.gitignore b/updater/.gitignore deleted file mode 100644 index 5fd958c7beb..00000000000 --- a/updater/.gitignore +++ /dev/null @@ -1 +0,0 @@ -crx-private-key.der