Browse Source

bug 1807834

Bill Gianopoulos 1 year ago
parent
commit
cfe1f02f41

+ 56 - 0
mozilla-central/patches/1807834-respect-dmg-hfs-env.patch

@@ -0,0 +1,56 @@
+# HG changeset patch
+# User Mac Tosh <mac198442@yahoo.com>
+# Date 1672226897 0
+Bug 1807834 - Respect DMG_TOOL, HFS_TOOL and MKFSHFS environment variables.
+
+diff --git a/python/mozbuild/mozbuild/action/make_dmg.py b/python/mozbuild/mozbuild/action/make_dmg.py
+--- a/python/mozbuild/mozbuild/action/make_dmg.py
++++ b/python/mozbuild/mozbuild/action/make_dmg.py
+@@ -1,15 +1,18 @@
+ # This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+ # file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ 
+ import argparse
+ import platform
+ import sys
++
++import buildconfig
++
+ from pathlib import Path
+ 
+ from mozpack import dmg
+ 
+ from mozbuild.bootstrap import bootstrap_toolchain
+ from mozbuild.repackaging.application_ini import get_application_ini_value
+ 
+ is_linux = platform.system() == "Linux"
+@@ -41,19 +44,25 @@ def main(args):
+     if options.volume_name:
+         volume_name = options.volume_name
+     else:
+         volume_name = get_application_ini_value(
+             options.inpath, "App", "CodeName", fallback="Name"
+         )
+ 
+     # Resolve required tools
+-    dmg_tool = bootstrap_toolchain("dmg/dmg")
+-    hfs_tool = bootstrap_toolchain("dmg/hfsplus")
+-    mkfshfs_tool = bootstrap_toolchain("hfsplus/newfs_hfs")
++    dmg_tool = buildconfig.substs.get("DMG_TOOL")
++    if dmg_tool == "":
++        dmg_tool = bootstrap_toolchain("dmg/dmg")
++    hfs_tool = buildconfig.substs.get("HFS_TOOL")
++    if hfs_tool == "":
++        hfs_tool = bootstrap_toolchain("dmg/hfsplus")
++    mkfshfs_tool= buildconfig.substs.get("MKFSHFS")
++    if mkfshfs_tool == "":
++        mkfshfs_tool = bootstrap_toolchain("hfsplus/newfs_hfs")
+ 
+     dmg.create_dmg(
+         source_directory=Path(options.inpath),
+         output_dmg=Path(options.dmgfile),
+         volume_name=volume_name,
+         extra_files=extra_files,
+         dmg_tool=dmg_tool,
+         hfs_tool=hfs_tool,

+ 1 - 0
mozilla-central/patches/series

@@ -1,3 +1,4 @@
 1624546-vs2019-runtime-mc.patch
 1624546-vs2019-runtime-mc.patch
 9999999-with-vs2019.patch
 9999999-with-vs2019.patch
 9999999-NSSgetentropy.patch
 9999999-NSSgetentropy.patch
+1807834-respect-dmg-hfs-env.patch