[tbb-commits] [Git][tpo/applications/tor-browser-build][main] Bug 40569: Include the channel name on macOS dmgs.

Pier Angelo Vendrame (@pierov) git at gitlab.torproject.org
Wed Feb 14 11:08:40 UTC 2024



Pier Angelo Vendrame pushed to branch main at The Tor Project / Applications / tor-browser-build


Commits:
4e2b66e9 by Pier Angelo Vendrame at 2024-02-14T12:08:21+01:00
Bug 40569: Include the channel name on macOS dmgs.

This commits make alpha and nightlies macOS build include the channel
in the app bundle.

Also, it renames the Project_Name_Channel to display_name to make it
less ambiguous, and now Project_Name_Channel includes the channel also
for the release target, even though it will be rarely used.

- - - - -


17 changed files:

- + projects/browser/Bundle-Data/BaseBrowser.dmg/alpha.DS_Store
- + projects/browser/Bundle-Data/BaseBrowser.dmg/nightly.DS_Store
- projects/browser/Bundle-Data/BaseBrowser.dmg/.DS_Store → projects/browser/Bundle-Data/BaseBrowser.dmg/release.DS_Store
- + projects/browser/Bundle-Data/MullvadBrowser.dmg/alpha.DS_Store
- + projects/browser/Bundle-Data/MullvadBrowser.dmg/nightly.DS_Store
- projects/browser/Bundle-Data/MullvadBrowser.dmg/.DS_Store → projects/browser/Bundle-Data/MullvadBrowser.dmg/release.DS_Store
- + projects/browser/Bundle-Data/TorBrowser.dmg/alpha.DS_Store
- + projects/browser/Bundle-Data/TorBrowser.dmg/nightly.DS_Store
- projects/browser/Bundle-Data/TorBrowser.dmg/.DS_Store → projects/browser/Bundle-Data/TorBrowser.dmg/release.DS_Store
- projects/browser/RelativeLink/start-browser.desktop
- projects/browser/build
- projects/browser/ddmg.sh
- projects/firefox/build
- projects/firefox/mozconfig
- rbm.conf
- tools/signing/functions
- tools/signing/gatekeeper-bundling.sh


Changes:

=====================================
projects/browser/Bundle-Data/BaseBrowser.dmg/alpha.DS_Store
=====================================
Binary files /dev/null and b/projects/browser/Bundle-Data/BaseBrowser.dmg/alpha.DS_Store differ


=====================================
projects/browser/Bundle-Data/BaseBrowser.dmg/nightly.DS_Store
=====================================
Binary files /dev/null and b/projects/browser/Bundle-Data/BaseBrowser.dmg/nightly.DS_Store differ


=====================================
projects/browser/Bundle-Data/BaseBrowser.dmg/.DS_Store → projects/browser/Bundle-Data/BaseBrowser.dmg/release.DS_Store
=====================================


=====================================
projects/browser/Bundle-Data/MullvadBrowser.dmg/alpha.DS_Store
=====================================
Binary files /dev/null and b/projects/browser/Bundle-Data/MullvadBrowser.dmg/alpha.DS_Store differ


=====================================
projects/browser/Bundle-Data/MullvadBrowser.dmg/nightly.DS_Store
=====================================
Binary files /dev/null and b/projects/browser/Bundle-Data/MullvadBrowser.dmg/nightly.DS_Store differ


=====================================
projects/browser/Bundle-Data/MullvadBrowser.dmg/.DS_Store → projects/browser/Bundle-Data/MullvadBrowser.dmg/release.DS_Store
=====================================


=====================================
projects/browser/Bundle-Data/TorBrowser.dmg/alpha.DS_Store
=====================================
Binary files /dev/null and b/projects/browser/Bundle-Data/TorBrowser.dmg/alpha.DS_Store differ


=====================================
projects/browser/Bundle-Data/TorBrowser.dmg/nightly.DS_Store
=====================================
Binary files /dev/null and b/projects/browser/Bundle-Data/TorBrowser.dmg/nightly.DS_Store differ


=====================================
projects/browser/Bundle-Data/TorBrowser.dmg/.DS_Store → projects/browser/Bundle-Data/TorBrowser.dmg/release.DS_Store
=====================================


=====================================
projects/browser/RelativeLink/start-browser.desktop
=====================================
@@ -31,4 +31,4 @@ Categories=Network;WebBrowser;Security;
 Exec=sh -c '"$(dirname "$*")"/Browser/start-[% c("var/project-name") %]  --detach || ([ ! -x "$(dirname "$*")"/Browser/start-[% c("var/project-name") %] ] && "$(dirname "$*")"/start-[% c("var/project-name") %] --detach)' dummy %k
 X-[% c("var/ProjectName") %]-ExecShell=./Browser/start-[% c("var/project-name") %] --detach
 Icon=web-browser
-StartupWMClass=[% c("var/Project_Name_Channel") %]
+StartupWMClass=[% c("var/display_name") %]


=====================================
projects/browser/build
=====================================
@@ -20,9 +20,9 @@ GENERATEDPREFSPATH=$rootdir/Bundle-Data/generated-prefs.js
 touch "$GENERATEDPREFSPATH"
 
 [% IF c("var/macos") %]
-  TBDIR="$TB_STAGE_DIR/[% c("var/Project_Name") %].app"
+  TBDIR="$TB_STAGE_DIR/[% c('var/display_name') %].app"
   [% IF c("var/macos_universal") %]
-    TBDIR_AARCH64="$TB_STAGE_DIR/[% c("var/Project_Name") %]-aarch64.app"
+    TBDIR_AARCH64="$TB_STAGE_DIR/[% c('var/display_name') %]-aarch64.app"
     TBDIRS=("$TBDIR" "$TBDIR_AARCH64")
   [% ELSE -%]
     TBDIRS=("$TBDIR")
@@ -175,7 +175,7 @@ tar -C ${TB_STAGE_DIR} -xf [% c('input_files_by_name/firefox') %]/browser.tar.[%
 [% IF c("var/macos_universal") -%]
   # Use symlink in tmp dir to extract "Tor Browser.app" to "Tor Browser-aarch64.app"
   ff_aarch64=$(mktemp -d)
-  ln -s "$TBDIR_AARCH64" "$ff_aarch64/[% c("var/Project_Name") %].app"
+  ln -s "$TBDIR_AARCH64" "$ff_aarch64/[% c('var/display_name') %].app"
   tar -C $ff_aarch64 -xf [% c('input_files_by_name/firefox-aarch64') %]/browser.tar.[% c("compress_tar") %]
 [% END %]
 
@@ -216,6 +216,10 @@ tar -C ${TB_STAGE_DIR} -xf [% c('input_files_by_name/firefox') %]/browser.tar.[%
 
 [% IF c("var/macos") %]
   tar -C "Bundle-Data/[% c('var/ProjectName') %].dmg" -c . | tar -C $TB_STAGE_DIR -x
+  pushd $TB_STAGE_DIR
+  cp [% c('var/channel') %].DS_Store .DS_Store
+  rm *.DS_Store
+  popd
 [% END %]
 
 for tbdir in "${TBDIRS[@]}"
@@ -353,7 +357,7 @@ done
 [% IF c("var/windows") %]
   TBDIR="$distdir/$PKG_DIR/[% c("var/Project_Name") %]/Browser"
 [% ELSIF c("var/macos") %]
-  TBDIR="$distdir/$PKG_DIR/[% c("var/Project_Name") %].app"
+  TBDIR="$distdir/$PKG_DIR/[% c('var/display_name') %].app"
 [% ELSE %]
   TBDIR="$distdir/$PKG_DIR/Browser"
 [% END %]


=====================================
projects/browser/ddmg.sh
=====================================
@@ -21,7 +21,7 @@ directories=\$(find "\$src_dir" -type d | wc -l)
 # Give some room to breathe
 size=\$(echo \$((\$fileblocks + \$directories)) | awk '{print int(\$1 * 1.1)}')
 dd if=/dev/zero of="\$hfsfile" bs=4096 count=\$size
-newfs_hfs -v "[% c("var/Project_Name") %]" "\$hfsfile"
+newfs_hfs -v "[% c('var/display_name') %]" "\$hfsfile"
 
 pushd [% src %]
 


=====================================
projects/firefox/build
=====================================
@@ -185,13 +185,14 @@ echo "Starting ./mach build $(date)"
 [% IF c("var/macos") -%]
   cp -a obj-*/dist/[% c('var/exe_name') %]/* $distdir
   [% IF c("var/base-browser") -%]
-    mv "$distdir/Firefox.app" "$distdir/[% c('var/Project_Name') %].app"
+    mv "$distdir/Firefox.app" "$distdir/[% c('var/display_name') %].app"
   [% END -%]
+  app_bundle="[% c('var/display_name') %]"
   # Remove firefox-bin (we don't use it, see ticket #10126)
-  rm -f "$distdir/[% c('var/Project_Name') %].app/Contents/MacOS/[% c('var/exe_name') %]-bin"
+  rm -f "$distdir/$app_bundle/Contents/MacOS/[% c('var/exe_name') %]-bin"
 
   # Adjust the Info.plist file
-  INFO_PLIST="$distdir/[% c('var/Project_Name') %].app/Contents/Info.plist"
+  INFO_PLIST="$distdir/$app_bundle/Contents/Info.plist"
   python3 $rootdir/fix-info-plist.py \
     "$INFO_PLIST" \
     '[% c("var/Project_Name") %]' \
@@ -297,13 +298,13 @@ cd $distdir
   [% c("var/rezip", { rezip_file => 'Browser/omni.ja' }) %]
   [% c("var/rezip", { rezip_file => 'Browser/browser/omni.ja' }) %]
 [% ELSIF c("var/macos") -%]
-  [% c("var/rezip", { rezip_file => '"' _ c("var/Project_Name") _ '.app/Contents/Resources/omni.ja"' }) %]
-  [% c("var/rezip", { rezip_file => '"' _ c("var/Project_Name") _ '.app/Contents/Resources/browser/omni.ja"' }) %]
+  [% c("var/rezip", { rezip_file => '"$app_bundle/Contents/Resources/omni.ja"' }) %]
+  [% c("var/rezip", { rezip_file => '"$app_bundle/Contents/Resources/browser/omni.ja"' }) %]
 [% END -%]
 
 [%
 IF c("var/macos");
-  SET browserdir='"' _ c("var/Project_Name") _ '.app/Contents"';
+  SET browserdir='"$app_bundle/Contents"';
 ELSE;
   SET browserdir='Browser';
 END;


=====================================
projects/firefox/mozconfig
=====================================
@@ -79,7 +79,7 @@ ac_add_options --[% IF c("var/updater_enabled") %]enable[% ELSE %]disable[% END
 
 mk_add_options MOZ_PARALLEL_BUILD=[% c("num_procs") %]
 
-export MOZ_APP_REMOTINGNAME="[% c('var/Project_Name_Channel') %]"
+export MOZ_APP_REMOTINGNAME="[% c('var/display_name') %]"
 
 export MOZ_INCLUDE_SOURCE_INFO=1
 export MOZ_SOURCE_REPO="[% c('var/gitlab_project') %]"


=====================================
rbm.conf
=====================================
@@ -110,6 +110,7 @@ var:
     [% c(step, { filename => 'f', output_dir => '/out', norec => {} }) %]
 
   Project_Name_Channel: '[% c("var/Project_Name") %] [% c("var/channel") FILTER ucfirst %]'
+  display_name: '[% c("var/Project_Name_Channel") %]'
   exe_name: firefox
   locale_ja: ja
   # When adding new languages, add the equivalent NSIS name to
@@ -235,7 +236,7 @@ targets:
     var:
       release: 1
       channel: release
-      Project_Name_Channel: '[% c("var/Project_Name") %]'
+      display_name: '[% c("var/Project_Name") %]'
   alpha:
     var:
       alpha: 1


=====================================
tools/signing/functions
=====================================
@@ -39,8 +39,9 @@ function generate_config {
   p1=$("$rbm" showconf browser var/project-name --target "$SIGNING_PROJECTNAME")
   p2=$("$rbm" showconf browser var/Project_Name --target "$SIGNING_PROJECTNAME")
   p3=$("$rbm" showconf browser var/ProjectName --target "$SIGNING_PROJECTNAME")
+  p4=$("$rbm" showconf browser var/display_name --target "$SIGNING_PROJECTNAME")
   echo 'rbm_not_available=1' > "$script_dir/set-config.generated-config"
-  echo "SIGNING_PROJECTNAMES=(\"$p1\" \"$p2\" \"$p3\")" >> "$script_dir/set-config.generated-config"
+  echo "SIGNING_PROJECTNAMES=(\"$p1\" \"$p2\" \"$p3\" \"$p4\")" >> "$script_dir/set-config.generated-config"
 }
 
 function project-name {
@@ -67,4 +68,13 @@ function ProjectName {
    fi
 }
 
+function display_name {
+   if test -n "${rbm_not_available+x}"; then
+     echo "${SIGNING_PROJECTNAMES[3]}"
+   else
+     "$rbm" showconf browser var/display_name --target "$SIGNING_PROJECTNAME"
+   fi
+}
+
+
 . "$script_dir/set-config"


=====================================
tools/signing/gatekeeper-bundling.sh
=====================================
@@ -55,6 +55,7 @@ test -f "$hfstools_file" || \
 ProjName=$(ProjectName)
 Proj_Name=$(Project_Name)
 proj_name=$(project-name)
+disp_name=$(display_name)
 
 test -d "$macos_signed_dir" || mkdir "$macos_signed_dir"
 tmpdir="$macos_stapled_dir/tmp"
@@ -71,8 +72,8 @@ cd $tmpdir/dmg
 tar -xf $macos_stapled_dir/"${proj_name}-${tbb_version}-notarized+stapled.tar.zst"
 
 cd ..
-$script_dir/ddmg.sh $macos_signed_dir/${proj_name}-macos-${tbb_version}.dmg $tmpdir/dmg/ "$Proj_Name"
-rm -rf "dmg/$Proj_Name.app"
+$script_dir/ddmg.sh $macos_signed_dir/${proj_name}-macos-${tbb_version}.dmg $tmpdir/dmg/ "$disp_name"
+rm -rf "dmg/$disp_name.app"
 rm -Rf "$tmpdir"
 
 # move the signed+stapled dmgs to expected output directory for publishing and mar generation



View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/4e2b66e977873c46b3678c93ae9173f53503f81a

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/4e2b66e977873c46b3678c93ae9173f53503f81a
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tbb-commits/attachments/20240214/2d593c07/attachment-0001.htm>


More information about the tbb-commits mailing list