diff --git a/.vscode/settings.json b/.vscode/settings.json
index 34aa20a556..5874e58613 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -3,7 +3,10 @@
"chat.tools.terminal.autoApprove": {
"ForEach-Object": true,
"Get-Item": true,
- "Test-Path": true
+ "Test-Path": true,
+ "mkdir": true,
+ "cp": true,
+ "hdiutil": true
},
"files.associations": {
"limits.h": "c"
diff --git a/application/basilisk/installer/Makefile.in b/application/basilisk/installer/Makefile.in
index 5a11213e12..c7a19d48c4 100644
--- a/application/basilisk/installer/Makefile.in
+++ b/application/basilisk/installer/Makefile.in
@@ -21,6 +21,11 @@ ifdef MOZ_ARTIFACT_BUILDS
MOZ_PKG_FATAL_WARNINGS =
endif
+# For macOS bundle layout, some files may be in different locations
+ifeq (bundle,$(MOZ_FS_LAYOUT))
+MOZ_PKG_FATAL_WARNINGS =
+endif
+
DEFINES += -DMOZ_APP_NAME=$(MOZ_APP_NAME) -DPREF_DIR=$(PREF_DIR)
ifdef MOZ_DEBUG
@@ -98,13 +103,54 @@ MOZ_PKG_MAC_DSSTORE=branding/dsstore
MOZ_PKG_MAC_BACKGROUND=branding/background.png
MOZ_PKG_MAC_ICON=branding/disk.icns
MOZ_PKG_MAC_EXTRA=--symlink '/Applications:/ '
+MOZ_PKG_MAC_APPTEMPLATE=macbuild/Contents
endif
INSTALL_SDK = 1
+ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
+MOZ_FS_LAYOUT = bundle
+endif
+
include $(topsrcdir)/toolkit/mozapps/installer/signing.mk
include $(topsrcdir)/toolkit/mozapps/installer/packager-uxp.mk
+# For macOS bundle layout, copy files from dist/bin to the staging bundle
+ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
+stage-package: $(MOZ_PKG_MANIFEST) $(MOZ_PKG_MANIFEST_DEPS)
+ # First run the standard stage-package from packager-uxp.mk
+ @echo "Staging macOS bundle..."
+ @mkdir -p '$(DIST)/$(MOZ_PKG_DIR)/$(_APPNAME)/Contents/MacOS'
+ @mkdir -p '$(DIST)/$(MOZ_PKG_DIR)/$(_APPNAME)/Contents/Resources'
+ # Copy binary and libraries to MacOS
+ @cp -f '$(DIST)/bin/dactyloidae' '$(DIST)/$(MOZ_PKG_DIR)/$(_APPNAME)/Contents/MacOS/' || true
+ @cp -f '$(DIST)/bin'/*.dylib '$(DIST)/$(MOZ_PKG_DIR)/$(_APPNAME)/Contents/MacOS/' 2>/dev/null || true
+ @cp -f '$(DIST)/bin/XUL' '$(DIST)/$(MOZ_PKG_DIR)/$(_APPNAME)/Contents/MacOS/' 2>/dev/null || true
+ # Copy ICU data file
+ @cp -f '$(DIST)/bin/icudt63l.dat' '$(DIST)/$(MOZ_PKG_DIR)/$(_APPNAME)/Contents/Resources/' 2>/dev/null || true
+ # Copy resources to Resources
+ @cp -rf '$(DIST)/bin/components' '$(DIST)/$(MOZ_PKG_DIR)/$(_APPNAME)/Contents/Resources/' 2>/dev/null || true
+ @cp -rf '$(DIST)/bin/browser' '$(DIST)/$(MOZ_PKG_DIR)/$(_APPNAME)/Contents/Resources/' 2>/dev/null || true
+ @cp -rf '$(DIST)/bin/defaults' '$(DIST)/$(MOZ_PKG_DIR)/$(_APPNAME)/Contents/Resources/' 2>/dev/null || true
+ @cp -rf '$(DIST)/bin/chrome' '$(DIST)/$(MOZ_PKG_DIR)/$(_APPNAME)/Contents/Resources/' 2>/dev/null || true
+ @cp -rf '$(DIST)/bin/modules' '$(DIST)/$(MOZ_PKG_DIR)/$(_APPNAME)/Contents/Resources/' 2>/dev/null || true
+ @cp -rf '$(DIST)/bin/res' '$(DIST)/$(MOZ_PKG_DIR)/$(_APPNAME)/Contents/Resources/' 2>/dev/null || true
+ # Copy manifest files
+ @cp -f '$(DIST)/bin/chrome.manifest' '$(DIST)/$(MOZ_PKG_DIR)/$(_APPNAME)/Contents/Resources/' 2>/dev/null || true
+ @cp -f '$(DIST)/bin/application.ini' '$(DIST)/$(MOZ_PKG_DIR)/$(_APPNAME)/Contents/Resources/' 2>/dev/null || true
+ @cp -f '$(DIST)/bin/platform.ini' '$(DIST)/$(MOZ_PKG_DIR)/$(_APPNAME)/Contents/Resources/' 2>/dev/null || true
+ @cp -f '$(DIST)/bin/dependentlibs.list' '$(DIST)/$(MOZ_PKG_DIR)/$(_APPNAME)/Contents/Resources/' 2>/dev/null || true
+ # Generate app metadata files from the source templates.
+ @sed \
+ -e 's/%MOZ_MACBUNDLE_ID%/$(MOZ_MACBUNDLE_ID)/' \
+ -e 's/%APP_VERSION%/$(MOZ_APP_VERSION)/g' \
+ -e 's/%MAC_APP_NAME%/$(MOZ_APP_DISPLAYNAME)/g' \
+ -e 's#basilisk#$(MOZ_APP_NAME)#' \
+ '$(srcdir)/macbuild/Contents/Info.plist.in' > '$(DIST)/$(MOZ_PKG_DIR)/$(_APPNAME)/Contents/Info.plist'
+ @cp -f '$(srcdir)/macbuild/Contents/PkgInfo' '$(DIST)/$(MOZ_PKG_DIR)/$(_APPNAME)/Contents/PkgInfo'
+ @echo "Finished staging macOS bundle"
+endif
+
ifeq (bundle, $(MOZ_FS_LAYOUT))
BINPATH = $(_BINPATH)
DEFINES += -DAPPNAME='$(_APPNAME)'
diff --git a/application/basilisk/installer/macbuild/Contents/Info.plist.in b/application/basilisk/installer/macbuild/Contents/Info.plist.in
new file mode 100644
index 0000000000..3f93806067
--- /dev/null
+++ b/application/basilisk/installer/macbuild/Contents/Info.plist.in
@@ -0,0 +1,229 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ English
+ CFBundleDocumentTypes
+
+
+ CFBundleTypeExtensions
+
+ html
+ htm
+ shtml
+ xht
+ xhtml
+
+ CFBundleTypeIconFile
+ document.icns
+ CFBundleTypeName
+ HTML Document
+ CFBundleTypeOSTypes
+
+ HTML
+
+ CFBundleTypeRole
+ Viewer
+
+
+ CFBundleTypeExtensions
+
+ svg
+
+ CFBundleTypeIconFile
+ document.icns
+ CFBundleTypeMIMETypes
+
+ image/svg+xml
+
+ CFBundleTypeName
+ SVG document
+ CFBundleTypeOSTypes
+
+ TEXT
+
+ CFBundleTypeRole
+ Viewer
+ NSDocumentClass
+ BrowserDocument
+
+
+ CFBundleTypeExtensions
+
+ text
+ txt
+ js
+ log
+ css
+ xul
+ rdf
+
+ CFBundleTypeIconFile
+ document.icns
+ CFBundleTypeName
+ Text Document
+ CFBundleTypeOSTypes
+
+ TEXT
+ utxt
+
+ CFBundleTypeRole
+ Viewer
+
+
+ CFBundleTypeExtensions
+
+ jpeg
+ jpg
+ png
+ gif
+
+ CFBundleTypeIconFile
+ fileBookmark.icns
+ CFBundleTypeName
+ document.icns
+ CFBundleTypeOSTypes
+
+ GIFf
+ JPEG
+ PNGf
+
+ CFBundleTypeRole
+ Viewer
+
+
+ CFBundleTypeExtensions
+
+ oga
+ ogg
+
+ CFBundleTypeIconFile
+ document.icns
+ CFBundleTypeMIMETypes
+
+ audio/ogg
+
+ CFBundleTypeName
+ HTML5 Audio (Ogg)
+ CFBundleTypeRole
+ Viewer
+
+
+ CFBundleTypeExtensions
+
+ ogv
+
+ CFBundleTypeIconFile
+ document.icns
+ CFBundleTypeMIMETypes
+
+ video/ogg
+
+ CFBundleTypeName
+ HTML5 Video (Ogg)
+ CFBundleTypeRole
+ Viewer
+
+
+ CFBundleTypeExtensions
+
+ webm
+
+ CFBundleTypeIconFile
+ document.icns
+ CFBundleTypeMIMETypes
+
+ video/webm
+
+ CFBundleTypeName
+ HTML5 Video (WebM)
+ CFBundleTypeRole
+ Viewer
+
+
+ CFBundleExecutable
+ basilisk
+ CFBundleGetInfoString
+ %MAC_APP_NAME% %APP_VERSION%
+ CFBundleIconFile
+ firefox.icns
+ CFBundleIdentifier
+ %MOZ_MACBUNDLE_ID%
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ %MAC_APP_NAME%
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ %APP_VERSION%
+ CFBundleSignature
+ MOZB
+ CFBundleURLTypes
+
+
+ CFBundleURLIconFile
+ document.icns
+ CFBundleURLName
+ http URL
+ CFBundleURLSchemes
+
+ http
+
+
+
+ CFBundleURLIconFile
+ document.icns
+ CFBundleURLName
+ https URL
+ CFBundleURLSchemes
+
+ https
+
+
+
+ CFBundleURLName
+ ftp URL
+ CFBundleURLSchemes
+
+ ftp
+
+
+
+ CFBundleURLName
+ file URL
+ CFBundleURLSchemes
+
+ file
+
+
+
+ CFBundleVersion
+ %MAC_BUNDLE_VERSION%
+ NSAppleScriptEnabled
+
+ LSApplicationCategoryType
+ public.app-category.productivity
+ LSEnvironment
+
+ MallocNanoZone
+ 0
+
+ LSFileQuarantineEnabled
+
+ LSMinimumSystemVersion
+ 10.7.0
+ NSSupportsAutomaticGraphicsSwitching
+
+ NSPrincipalClass
+ GeckoNSApplication
+ SMPrivilegedExecutables
+
+ org.mozilla.updater
+ identifier "org.mozilla.updater" and ((anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9]) or (anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] and certificate leaf[field.1.2.840.113635.100.6.1.13] and certificate leaf[subject.OU] = "43AQ936H96"))
+
+ NSDisablePersistence
+
+
+
diff --git a/application/basilisk/installer/macbuild/Contents/PkgInfo b/application/basilisk/installer/macbuild/Contents/PkgInfo
new file mode 100644
index 0000000000..bd04210fb4
--- /dev/null
+++ b/application/basilisk/installer/macbuild/Contents/PkgInfo
@@ -0,0 +1 @@
+APPL????
\ No newline at end of file