Pier Angelo Vendrame pushed to branch maint-12.0 at The Tor Project / Applications / tor-browser-build
Commits:
-
9b54da11
by Pier Angelo Vendrame at 2023-02-01T10:53:27+01:00
-
3eb81812
by Pier Angelo Vendrame at 2023-02-01T10:53:34+01:00
-
6f5d0bed
by Pier Angelo Vendrame at 2023-02-01T10:53:34+01:00
-
70ffd274
by Pier Angelo Vendrame at 2023-02-01T10:53:47+01:00
-
1dc2335c
by Nicolas Vigier at 2023-02-01T10:55:27+01:00
-
1ec878d6
by Nicolas Vigier at 2023-02-01T10:55:34+01:00
14 changed files:
- projects/browser/Bundle-Data/mac-applications.dmg/.VolumeIcon.icns
- − projects/browser/Bundle-Data/mac-applications.dmg/Applications
- projects/browser/build
- projects/browser/config
- projects/browser/ddmg.sh
- + projects/hfsplus-tools/build
- + projects/hfsplus-tools/config
- + projects/hfsplus-tools/newfs_hfs.diff
- projects/libdmg-hfsplus/build
- projects/libdmg-hfsplus/config
- + projects/openssl-1.0.2/build
- + projects/openssl-1.0.2/config
- tools/signing/ddmg.sh
- tools/signing/gatekeeper-bundling.sh
Changes:
1 | -/Applications |
|
\ No newline at end of file |
... | ... | @@ -33,8 +33,9 @@ touch "$GENERATEDPREFSPATH" |
33 | 33 | TORBINPATH=Contents/MacOS/Tor
|
34 | 34 | TORCONFIGPATH=Contents/Resources/TorBrowser/Tor
|
35 | 35 | |
36 | + tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/hfsplus-tools') %]
|
|
36 | 37 | tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/libdmg') %]
|
37 | - export PATH=/var/tmp/dist/libdmg-hfsplus:$PATH
|
|
38 | + export PATH=/var/tmp/dist/hfsplus-tools:/var/tmp/dist/libdmg-hfsplus:$PATH
|
|
38 | 39 | [% ELSE %]
|
39 | 40 | TBDIR=$TB_STAGE_DIR/Browser
|
40 | 41 | TBDIRS=("$TBDIR")
|
... | ... | @@ -33,7 +33,6 @@ targets: |
33 | 33 | macos:
|
34 | 34 | var:
|
35 | 35 | arch_deps:
|
36 | - - genisoimage
|
|
37 | 36 | - faketime
|
38 | 37 | - python3-dev
|
39 | 38 | - python3-pip
|
... | ... | @@ -106,6 +105,9 @@ input_files: |
106 | 105 | sha256sum: 14af6a3cbc269c045f2d950e1e4f7c29981b35a7abc61d2413f5bb8bd7311857
|
107 | 106 | - filename: 'gtk3-settings.ini'
|
108 | 107 | enable: '[% c("var/linux") %]'
|
108 | + - project: hfsplus-tools
|
|
109 | + name: hfsplus-tools
|
|
110 | + enable: '[% c("var/macos") %]'
|
|
109 | 111 | - project: libdmg-hfsplus
|
110 | 112 | name: libdmg
|
111 | 113 | enable: '[% c("var/macos") %]'
|
1 | +#!/bin/bash
|
|
2 | +set -e
|
|
3 | + |
|
1 | 4 | [% SET src = c('dmg_src', { error_if_undef => 1 }) -%]
|
2 | 5 | find [% src %] -executable -exec chmod 0755 {} \;
|
3 | 6 | find [% src %] ! -executable -exec chmod 0644 {} \;
|
... | ... | @@ -5,17 +8,33 @@ find [% src %] ! -executable -exec chmod 0644 {} \; |
5 | 8 | find [% src %] -exec [% c("touch") %] {} \;
|
6 | 9 | |
7 | 10 | dmg_tmpdir=\$(mktemp -d)
|
8 | -[% SET filelist = '"\$dmg_tmpdir/filelist.txt"' %]
|
|
9 | -pushd [% src %]
|
|
10 | -find . -type f | sed -e 's/^\.\///' | sort | xargs -i echo "{}={}" > [% filelist %]
|
|
11 | -find . -type l | sed -e 's/^\.\///' | sort | xargs -i echo "{}={}" >> [% filelist %]
|
|
11 | +hfsfile="\$dmg_tmpdir/tbb-uncompressed.dmg"
|
|
12 | 12 | |
13 | +# hfsplus sets all the times to time(NULL)
|
|
13 | 14 | export LD_PRELOAD=[% c("var/faketime_path") %]
|
14 | 15 | export FAKETIME="[% USE date; GET date.format(c('timestamp'), format = '%Y-%m-%d %H:%M:%S') %]"
|
15 | 16 | |
16 | -genisoimage -D -V "Tor Browser" -no-pad -R -apple -o "\$dmg_tmpdir/tbb-uncompressed.dmg" -path-list [% filelist %] -graft-points -gid 20 -dir-mode 0755 -new-dir-mode 0755
|
|
17 | +# Use a similar strategy to Mozilla (they have 1.02, we have 1.1)
|
|
18 | +size=\$(du -ms [% src %] | awk '{ print int( \$1 * 1.1 ) }')
|
|
19 | +dd if=/dev/zero of="\$hfsfile" bs=1M count=\$size
|
|
20 | +newfs_hfs -v "[% c("var/Project_Name") %]" "\$hfsfile"
|
|
21 | + |
|
22 | +pushd [% src %]
|
|
23 | + |
|
24 | +find -type d -mindepth 1 | sed -e 's/^\.\///' | sort | while read dirname; do
|
|
25 | + hfsplus "\$hfsfile" mkdir "/\$dirname"
|
|
26 | + hfsplus "\$hfsfile" chmod 0755 "/\$dirname"
|
|
27 | +done
|
|
28 | +find -type f | sed -e 's/^\.\///' | sort | while read filename; do
|
|
29 | + hfsplus "\$hfsfile" add "\$filename" "/\$filename"
|
|
30 | + hfsplus "\$hfsfile" chmod \$(stat --format '0%a' "\$filename") "/\$filename"
|
|
31 | +done
|
|
32 | +# hfsplus does not play well with dangling links
|
|
33 | +hfsplus "\$hfsfile" symlink /Applications /Applications
|
|
34 | +# Show the volume icon
|
|
35 | +hfsplus "\$hfsfile" attr / C
|
|
17 | 36 | |
18 | -dmg dmg "\$dmg_tmpdir/tbb-uncompressed.dmg" [% c('dmg_out', { error_if_undef => 1 }) %]
|
|
37 | +dmg dmg "\$hfsfile" [% c('dmg_out', { error_if_undef => 1 }) %]
|
|
19 | 38 | popd
|
20 | 39 | |
21 | 40 | rm -Rf "\$dmg_tmpdir" |
1 | +#!/bin/bash
|
|
2 | +[% c("var/set_default_env") -%]
|
|
3 | +distdir=/var/tmp/dist/[% project %]
|
|
4 | +mkdir /var/tmp/dist
|
|
5 | +[% IF ! c("container/global_disable") -%]
|
|
6 | + tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/clang') %]
|
|
7 | + export PATH="/var/tmp/dist/clang/bin:$PATH"
|
|
8 | +[% END -%]
|
|
9 | + |
|
10 | +tar -xf diskdev_cmds-[% c("version") %].tar.gz
|
|
11 | +cd diskdev_cmds-[% c("version") %]
|
|
12 | + |
|
13 | +patch -p1 < $rootdir/newfs_hfs.diff
|
|
14 | + |
|
15 | +make -j[% c("num_procs") %]
|
|
16 | + |
|
17 | +mkdir -p "$distdir"
|
|
18 | +cp newfs_hfs.tproj/newfs_hfs "$distdir/"
|
|
19 | + |
|
20 | +cd /var/tmp/dist
|
|
21 | +[% c('tar', {
|
|
22 | + tar_src => [ project ],
|
|
23 | + tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
|
|
24 | + }) %] |
1 | +# vim: filetype=yaml sw=2
|
|
2 | +version: 540.1.linux3
|
|
3 | +filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz'
|
|
4 | +container:
|
|
5 | + use_container: 1
|
|
6 | +var:
|
|
7 | + deps:
|
|
8 | + - build-essential
|
|
9 | + - libssl-dev
|
|
10 | + - uuid-dev
|
|
11 | +input_files:
|
|
12 | + # See hfsplus-tools in taskcluster/ci/fetch/toolchains.yml
|
|
13 | + - URL: https://src.fedoraproject.org/repo/pkgs/hfsplus-tools/diskdev_cmds-540.1.linux3.tar.gz/0435afc389b919027b69616ad1b05709/diskdev_cmds-[% c("version") %].tar.gz
|
|
14 | + sha256: b01b203a97f9a3bf36a027c13ddfc59292730552e62722d690d33bd5c24f5497
|
|
15 | + - project: container-image
|
|
16 | + # The project uses a flag that is not supported by GCC
|
|
17 | + - name: clang
|
|
18 | + project: clang
|
|
19 | + enable: '[% ! c("container/global_disable") %]'
|
|
20 | + # Build only newfs (we do not care of fsck), remove a header that does not
|
|
21 | + # exist on Linux (at that path) and is not required on Linux either, and make
|
|
22 | + # the UUID deterministic.
|
|
23 | + - filename: newfs_hfs.diff |
1 | +diff '--color=auto' -Naur diskdev_cmds-540.1.linux3_orig/Makefile diskdev_cmds-540.1.linux3/Makefile
|
|
2 | +--- diskdev_cmds-540.1.linux3_orig/Makefile 2023-01-17 11:36:56.341279443 +0100
|
|
3 | ++++ diskdev_cmds-540.1.linux3/Makefile 2023-01-17 11:44:12.496479981 +0100
|
|
4 | +@@ -3,7 +3,7 @@
|
|
5 | + CC := clang
|
|
6 | + CFLAGS := -g3 -Wall -fblocks -I$(PWD)/BlocksRunTime -I$(PWD)/include -DDEBUG_BUILD=0 -D_FILE_OFFSET_BITS=64 -D LINUX=1 -D BSD=1 -D VERSION=\"$(VERSION)\"
|
|
7 | + LDFLAGS := -Wl,--build-id -L$(PWD)/BlocksRunTime
|
|
8 | +-SUBDIRS := BlocksRunTime newfs_hfs.tproj fsck_hfs.tproj
|
|
9 | ++SUBDIRS := newfs_hfs.tproj
|
|
10 | +
|
|
11 | + all clean:
|
|
12 | + for d in $(SUBDIRS); do $(MAKE) -C $$d -f Makefile.lnx $@; done
|
|
13 | +diff '--color=auto' -Naur diskdev_cmds-540.1.linux3_orig/newfs_hfs.tproj/makehfs.c diskdev_cmds-540.1.linux3/newfs_hfs.tproj/makehfs.c
|
|
14 | +--- diskdev_cmds-540.1.linux3_orig/newfs_hfs.tproj/makehfs.c 2023-01-17 11:36:56.341279443 +0100
|
|
15 | ++++ diskdev_cmds-540.1.linux3/newfs_hfs.tproj/makehfs.c 2023-01-17 11:58:15.972059719 +0100
|
|
16 | +@@ -38,8 +38,8 @@
|
|
17 | + #endif
|
|
18 | + #include <sys/errno.h>
|
|
19 | + #include <sys/stat.h>
|
|
20 | +-#include <sys/sysctl.h>
|
|
21 | + #if !LINUX
|
|
22 | ++#include <sys/sysctl.h>
|
|
23 | + #include <sys/vmmeter.h>
|
|
24 | + #endif
|
|
25 | +
|
|
26 | +@@ -571,8 +571,10 @@
|
|
27 | + /* Adjust free blocks to reflect everything we have allocated. */
|
|
28 | + hp->freeBlocks -= blocksUsed;
|
|
29 | +
|
|
30 | +- /* Generate and write UUID for the HFS+ disk */
|
|
31 | +- GenerateVolumeUUID(&newVolumeUUID);
|
|
32 | ++ /* Use a deterministic UUID for reproducibility */
|
|
33 | ++ memset(&newVolumeUUID, 0, sizeof(newVolumeUUID));
|
|
34 | ++ strncpy(&newVolumeUUID, defaults->volumeName, sizeof(newVolumeUUID));
|
|
35 | ++
|
|
36 | + finderInfoUUIDPtr = (VolumeUUID *)(&hp->finderInfo[24]);
|
|
37 | + finderInfoUUIDPtr->v.high = OSSwapHostToBigInt32(newVolumeUUID.v.high);
|
|
38 | + finderInfoUUIDPtr->v.low = OSSwapHostToBigInt32(newVolumeUUID.v.low); |
1 | 1 | #!/bin/bash
|
2 | 2 | [% c("var/set_default_env") -%]
|
3 | -distdir=$(pwd)/dist
|
|
4 | -mkdir -p $distdir/[% project %]
|
|
5 | -tar xf [% project %]-[% c('version') %].tar.gz
|
|
6 | -cd [% project %]-[% c('version') %]
|
|
7 | -patch -p1 < ../libdmg.patch
|
|
8 | -cmake -DCMAKE_INSTALL_PREFIX:PATH=$distdir/[% project %] CMakeLists.txt
|
|
9 | -cd dmg
|
|
10 | -make -j[% c("num_procs") %]
|
|
11 | -make install
|
|
12 | -cd $distdir
|
|
3 | +distdir=/var/tmp/dist/[% project %]
|
|
4 | +mkdir -p /var/tmp/dist
|
|
5 | +tar -C /var/tmp/dist -xf [% c('input_files_by_name/cmake') %]
|
|
6 | +tar -C /var/tmp/dist -xf [% c('input_files_by_name/ninja') %]
|
|
7 | +[% IF c("container/global_disable") -%]
|
|
8 | + tar -C /var/tmp/dist -xf [% c('input_files_by_name/openssl-1.0.2') %]
|
|
9 | +[% END -%]
|
|
10 | +export PATH="/var/tmp/dist/ninja:/var/tmp/dist/cmake/bin:$PATH"
|
|
11 | + |
|
12 | +mkdir /var/tmp/build
|
|
13 | +tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
|
|
14 | +cd /var/tmp/build/[% project %]-[% c('version') %]
|
|
15 | +patch -p1 < "$rootdir/libdmg.patch"
|
|
16 | +cmake . -GNinja -DCMAKE_BUILD_TYPE=Release [% c("var/cmake_opts") %]
|
|
17 | +ninja -j[% c("num_procs") %] -v
|
|
18 | + |
|
19 | +mkdir $distdir
|
|
20 | +# We take only dmg and hfsplus like Mozilla does
|
|
21 | +cp dmg/dmg hfs/hfsplus $distdir/
|
|
22 | +cd /var/tmp/dist
|
|
13 | 23 | [% c('tar', {
|
14 | 24 | tar_src => [ project ],
|
15 | 25 | tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
|
16 | - }) %] |
|
26 | + }) %] |
1 | 1 | # vim: filetype=yaml sw=2
|
2 | 2 | version: '[% c("abbrev") %]'
|
3 | -git_url: https://github.com/vasi/libdmg-hfsplus
|
|
4 | -git_hash: dfd5e5cc3dc1191e37d3c3a6118975afdd1d7014
|
|
3 | +git_url: https://github.com/mozilla/libdmg-hfsplus
|
|
4 | +git_hash: 2ee327795680101d36f9700bd0fb618362237718
|
|
5 | 5 | filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz'
|
6 | 6 | container:
|
7 | 7 | use_container: 1
|
8 | 8 | var:
|
9 | 9 | deps:
|
10 | 10 | - build-essential
|
11 | - - cmake
|
|
12 | 11 | - zlib1g-dev
|
13 | 12 | - libbz2-dev
|
13 | +targets:
|
|
14 | + no_containers:
|
|
15 | + var:
|
|
16 | + cmake_opts: |
|
|
17 | + -DOPENSSL_USE_STATIC_LIBS=1 \
|
|
18 | + -DOPENSSL_ROOT_DIR=/var/tmp/dist/openssl
|
|
14 | 19 | input_files:
|
15 | 20 | - project: container-image
|
21 | + - name: cmake
|
|
22 | + project: cmake
|
|
23 | + - name: ninja
|
|
24 | + project: ninja
|
|
16 | 25 | - filename: libdmg.patch
|
26 | + - name: openssl-1.0.2
|
|
27 | + project: openssl-1.0.2
|
|
28 | + enable: '[% c("container/global_disable") %]' |
1 | +#!/bin/bash
|
|
2 | +[% c("var/set_default_env") -%]
|
|
3 | +distdir=/var/tmp/dist/openssl
|
|
4 | +mkdir -p /var/tmp/build
|
|
5 | +tar -C /var/tmp/build -xf openssl-[% c('version') %].tar.gz
|
|
6 | +cd /var/tmp/build/openssl-[% c('version') %]
|
|
7 | +export SOURCE_DATE_EPOCH='[% c("timestamp") %]'
|
|
8 | +./Configure --prefix="$distdir" -shared enable-ec_nistp_64_gcc_128 linux-x86_64
|
|
9 | +make -j[% c("num_procs") %]
|
|
10 | +make -j[% c("num_procs") %] install
|
|
11 | +cd /var/tmp/dist
|
|
12 | +[% c('tar', {
|
|
13 | + tar_src => [ 'openssl' ],
|
|
14 | + tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
|
|
15 | + }) %] |
1 | +# vim: filetype=yaml sw=2
|
|
2 | +#
|
|
3 | +# We need openssl-1.0.2 for building libdmg-hfsplus:
|
|
4 | +# https://github.com/planetbeing/libdmg-hfsplus/issues/14
|
|
5 | +#
|
|
6 | +version: 1.0.2u
|
|
7 | +filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz'
|
|
8 | + |
|
9 | +input_files:
|
|
10 | + - URL: 'https://www.openssl.org/source/openssl-[% c("version") %].tar.gz'
|
|
11 | + sha256sum: ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16 |
... | ... | @@ -21,20 +21,40 @@ find $src_dir ! -executable -exec chmod 0644 {} \; 2> /dev/null |
21 | 21 | find $src_dir -exec touch -m -t 200001010101 {} \; 2> /dev/null
|
22 | 22 | set -e
|
23 | 23 | |
24 | +VOLUME_LABEL="${VOLUME_LABEL:-Tor Browser}"
|
|
25 | + |
|
24 | 26 | dmg_tmpdir=$(mktemp -d)
|
25 | -filelist="$dmg_tmpdir/filelist.txt"
|
|
26 | -cd $src_dir
|
|
27 | -find . -type f | sed -e 's/^\.\///' | sort | xargs -i echo "{}={}" > $filelist
|
|
28 | -find . -type l | sed -e 's/^\.\///' | sort | xargs -i echo "{}={}" >> $filelist
|
|
27 | +hfsfile="$dmg_tmpdir/tbb-uncompressed.dmg"
|
|
29 | 28 | |
30 | 29 | export LD_PRELOAD=$faketime_path
|
31 | 30 | export FAKETIME="2000-01-01 01:01:01"
|
32 | 31 | |
33 | 32 | echo "Starting: " $(basename $dest_file)
|
34 | 33 | |
35 | -genisoimage -D -V "Tor Browser" -no-pad -R -apple -o "$dmg_tmpdir/tbb-uncompressed.dmg" -path-list $filelist -graft-points -gid 20 -dir-mode 0755 -new-dir-mode 0755
|
|
34 | +# Use a similar strategy to Mozilla (they have 1.02, we have 1.1)
|
|
35 | +size=$(du -ms "$src_dir" | awk '{ print int( $1 * 1.1 ) }')
|
|
36 | +dd if=/dev/zero of="$hfsfile" bs=1M count=$size
|
|
37 | +newfs_hfs -v "$VOLUME_LABEL" "$hfsfile"
|
|
38 | + |
|
39 | +cd $src_dir
|
|
36 | 40 | |
37 | -dmg dmg "$dmg_tmpdir/tbb-uncompressed.dmg" "$dest_file"
|
|
41 | +# hfsplus does not play well with dangling links, so remove /Applications, and
|
|
42 | +# add it back again with the special command to do so.
|
|
43 | +rm -f Applications
|
|
44 | + |
|
45 | +find -type d -mindepth 1 | sed -e 's/^\.\///' | sort | while read dirname; do
|
|
46 | + hfsplus "$hfsfile" mkdir "/$dirname"
|
|
47 | + hfsplus "$hfsfile" chmod 0755 "/$dirname"
|
|
48 | +done
|
|
49 | +find -type f | sed -e 's/^\.\///' | sort | while read filename; do
|
|
50 | + hfsplus "$hfsfile" add "$filename" "/$filename"
|
|
51 | + hfsplus "$hfsfile" chmod $(stat --format '0%a' "$filename") "/$filename"
|
|
52 | +done
|
|
53 | +hfsplus "$hfsfile" symlink /Applications /Applications
|
|
54 | +# Show the volume icon
|
|
55 | +hfsplus "$hfsfile" attr / C
|
|
56 | + |
|
57 | +dmg dmg "$hfsfile" "$dest_file"
|
|
38 | 58 | |
39 | 59 | echo "Finished: " $(basename $dest_file)
|
40 | 60 |
... | ... | @@ -35,18 +35,22 @@ set -e |
35 | 35 | script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
36 | 36 | source "$script_dir/functions"
|
37 | 37 | |
38 | -which genisoimage > /dev/null || \
|
|
39 | - exit_error 'genisoimage is missing. You should install the genisoimage package.'
|
|
40 | 38 | test -f $faketime_path || \
|
41 | 39 | exit_error "$faketime_path is missing"
|
42 | 40 | test -d $macos_stapled_dir || \
|
43 | 41 | exit_error "The stapled macos zip files should be placed in directory $macos_stapled_dir"
|
44 | -libdmg_file="$script_dir/../../out/libdmg-hfsplus/libdmg-hfsplus-dfd5e5cc3dc1-c9296e.tar.gz"
|
|
42 | +libdmg_file="$script_dir/../../out/libdmg-hfsplus/libdmg-hfsplus-2ee327795680-555a7e.tar.gz"
|
|
45 | 43 | test -f "$libdmg_file" || \
|
46 | 44 | exit_error "$libdmg_file is missing." \
|
47 | 45 | "You can build it with:" \
|
48 | 46 | " ./rbm/rbm build --target no_containers libdmg-hfsplus" \
|
49 | 47 | "See var/deps in projects/libdmg-hfsplus/config for the list of build dependencies"
|
48 | +hfstools_file="$script_dir/../../out/hfsplus-tools/hfsplus-tools-540.1.linux3-66de66.tar.gz"
|
|
49 | +test -f "$hfstools_file" || \
|
|
50 | + exit_error "$hfstools_file is missing." \
|
|
51 | + "You can build it with:" \
|
|
52 | + " ./rbm/rbm build --target no_containers hfsplus-tools" \
|
|
53 | + "You will need the clang and uuid-dev packages installed"
|
|
50 | 54 | |
51 | 55 | test -d "$macos_signed_dir" || mkdir "$macos_signed_dir"
|
52 | 56 | tmpdir="$macos_stapled_dir/tmp"
|
... | ... | @@ -55,7 +59,8 @@ mkdir "$tmpdir" |
55 | 59 | cp -rT "$script_dir/../../projects/browser/Bundle-Data/mac-applications.dmg" "$tmpdir/dmg"
|
56 | 60 | |
57 | 61 | tar -C "$tmpdir" -xf "$libdmg_file"
|
58 | -export PATH="$PATH:$tmpdir/libdmg-hfsplus"
|
|
62 | +tar -C "$tmpdir" -xf "$hfstools_file"
|
|
63 | +export PATH="$PATH:$tmpdir/libdmg-hfsplus:$tmpdir/hfsplus-tools"
|
|
59 | 64 | |
60 | 65 | for lang in $bundle_locales
|
61 | 66 | do
|