... |
... |
@@ -14,7 +14,8 @@ mkdir -p $OUTDIR |
14
|
14
|
# When we build with MULTI_LINGUAL=1, the browser will be packaged inside a
|
15
|
15
|
# directory named tor-browser (instead of tor-browser_en-US). Therefore we
|
16
|
16
|
# stage everything under tor-browser-stage to avoid a conflict.
|
17
|
|
-TB_STAGE_DIR=$distdir/tor-browser-stage
|
|
17
|
+PKG_DIR='[% c("var/project-name") %]'
|
|
18
|
+TB_STAGE_DIR="$distdir/$PKG_DIR[% IF c('var/windows') %]/[% c('var/Project_Name') %][% END %]"
|
18
|
19
|
GENERATEDPREFSPATH=$rootdir/Bundle-Data/generated-prefs.js
|
19
|
20
|
# Create initially empty prefs file where we can dump our conditionally included/genetered prefs
|
20
|
21
|
touch "$GENERATEDPREFSPATH"
|
... |
... |
@@ -37,7 +38,7 @@ touch "$GENERATEDPREFSPATH" |
37
|
38
|
tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/libdmg') %]
|
38
|
39
|
export PATH=/var/tmp/dist/hfsplus-tools:/var/tmp/dist/libdmg-hfsplus:$PATH
|
39
|
40
|
[% ELSE %]
|
40
|
|
- TBDIR=$TB_STAGE_DIR/Browser
|
|
41
|
+ TBDIR="$TB_STAGE_DIR/Browser"
|
41
|
42
|
TBDIRS=("$TBDIR")
|
42
|
43
|
|
43
|
44
|
DOCSPATH=[% c('var/ProjectName') %]/Docs
|
... |
... |
@@ -124,7 +125,6 @@ mv [% c('input_files_by_name/noscript') %] "$TBDIR/$EXTSPATH/{73a6fe31-595d-460b |
124
|
125
|
|
125
|
126
|
# on linux, libstdc++ lives in it's own directory
|
126
|
127
|
[% IF c("var/linux") %]
|
127
|
|
- find $TBDIR/$TORBINPATH
|
128
|
128
|
mkdir -p "$TBDIR/$TORBINPATH/libstdc++"
|
129
|
129
|
mv "$TBDIR/$TORBINPATH"/libstdc++.so.* "$TBDIR/$TORBINPATH/libstdc++"
|
130
|
130
|
[% END %]
|
... |
... |
@@ -145,32 +145,32 @@ do |
145
|
145
|
done
|
146
|
146
|
|
147
|
147
|
[% IF c("var/linux") %]
|
148
|
|
- cat > ${TB_STAGE_DIR}/start-[% c("var/project-name") %].desktop << 'RBM_TB_EOF'
|
|
148
|
+ cat > "${TB_STAGE_DIR}/start-[% c('var/project-name') %].desktop" << 'RBM_TB_EOF'
|
149
|
149
|
[% INCLUDE 'RelativeLink/start-browser.desktop' -%]
|
150
|
150
|
RBM_TB_EOF
|
151
|
|
- cat > ${TB_STAGE_DIR}/Browser/start-[% c("var/project-name") %] << 'RBM_TB_EOF'
|
|
151
|
+ cat > "${TB_STAGE_DIR}/Browser/start-[% c('var/project-name') %]" << 'RBM_TB_EOF'
|
152
|
152
|
[% INCLUDE 'RelativeLink/start-browser' -%]
|
153
|
153
|
RBM_TB_EOF
|
154
|
|
- cat > ${TB_STAGE_DIR}/Browser/execdesktop << 'RBM_TB_EOF'
|
|
154
|
+ cat > "${TB_STAGE_DIR}/Browser/execdesktop" << 'RBM_TB_EOF'
|
155
|
155
|
[% INCLUDE 'RelativeLink/execdesktop' -%]
|
156
|
156
|
RBM_TB_EOF
|
157
|
|
- chmod +x ${TB_STAGE_DIR}/start-[% c("var/project-name") %].desktop \
|
158
|
|
- ${TB_STAGE_DIR}/Browser/start-[% c("var/project-name") %] \
|
159
|
|
- ${TB_STAGE_DIR}/Browser/execdesktop
|
160
|
|
- cp ${TB_STAGE_DIR}/start-[% c("var/project-name") %].desktop \
|
161
|
|
- ${TB_STAGE_DIR}/Browser
|
|
157
|
+ chmod +x "${TB_STAGE_DIR}/start-[% c('var/project-name') %].desktop" \
|
|
158
|
+ "${TB_STAGE_DIR}/Browser/start-[% c('var/project-name') %]" \
|
|
159
|
+ "${TB_STAGE_DIR}/Browser/execdesktop"
|
|
160
|
+ cp "${TB_STAGE_DIR}/start-[% c('var/project-name') %].desktop" \
|
|
161
|
+ "${TB_STAGE_DIR}/Browser"
|
162
|
162
|
[% IF c("var/namecoin") %]
|
163
|
|
- pushd ${TB_STAGE_DIR}/Browser/
|
|
163
|
+ pushd "${TB_STAGE_DIR}/Browser/"
|
164
|
164
|
patch -p1 < $rootdir/namecoin.patch
|
165
|
165
|
popd
|
166
|
166
|
[% END %]
|
167
|
167
|
# Make sure we get the desired scrollbar behavior with Gtk3, see bug 27546.
|
168
|
|
- GTK_SETTINGS_DIR=${TB_STAGE_DIR}/Browser/.config/gtk-3.0
|
|
168
|
+ GTK_SETTINGS_DIR="${TB_STAGE_DIR}/Browser/.config/gtk-3.0"
|
169
|
169
|
mkdir -p $GTK_SETTINGS_DIR
|
170
|
170
|
cp $rootdir/gtk3-settings.ini $GTK_SETTINGS_DIR/settings.ini
|
171
|
171
|
[% END %]
|
172
|
172
|
|
173
|
|
-tar -C ${TB_STAGE_DIR} -xf [% c('input_files_by_name/firefox') %]/browser.tar.[% c("compress_tar") %]
|
|
173
|
+tar -C "${TB_STAGE_DIR}" -xf [% c('input_files_by_name/firefox') %]/browser.tar.[% c("compress_tar") %]
|
174
|
174
|
|
175
|
175
|
[% IF c("var/macos_universal") -%]
|
176
|
176
|
# Use symlink in tmp dir to extract "Tor Browser.app" to "Tor Browser-aarch64.app"
|
... |
... |
@@ -215,8 +215,8 @@ tar -C ${TB_STAGE_DIR} -xf [% c('input_files_by_name/firefox') %]/browser.tar.[% |
215
|
215
|
END; %]
|
216
|
216
|
|
217
|
217
|
[% IF c("var/macos") %]
|
218
|
|
- tar -C "Bundle-Data/[% c('var/ProjectName') %].dmg" -c . | tar -C $TB_STAGE_DIR -x
|
219
|
|
- pushd $TB_STAGE_DIR
|
|
218
|
+ tar -C "Bundle-Data/[% c('var/ProjectName') %].dmg" -c . | tar -C "$TB_STAGE_DIR" -x
|
|
219
|
+ pushd "$TB_STAGE_DIR"
|
220
|
220
|
cp [% c('var/channel') %].DS_Store .DS_Store
|
221
|
221
|
rm *.DS_Store
|
222
|
222
|
popd
|
... |
... |
@@ -264,17 +264,10 @@ done |
264
|
264
|
[% END -%]
|
265
|
265
|
|
266
|
266
|
[% IF c("var/linux") && c("var/tor-browser") %]
|
267
|
|
- chmod 700 ${TB_STAGE_DIR}/Browser/[% c('var/ProjectName') %]/Data/Browser
|
268
|
|
- chmod 700 ${TB_STAGE_DIR}/Browser/TorBrowser/Data/Tor
|
|
267
|
+ chmod 700 "${TB_STAGE_DIR}/Browser/[% c('var/ProjectName') %]/Data/Browser"
|
|
268
|
+ chmod 700 "${TB_STAGE_DIR}/Browser/TorBrowser/Data/Tor"
|
269
|
269
|
[% END %]
|
270
|
270
|
|
271
|
|
-# With multi-lingual builds, we use "ALL" in the package name as the locale for
|
272
|
|
-# update purposes. But we do not include "ALL" in the name of the directory that
|
273
|
|
-# is inside the package (in other words, users will not see tor-browser_ALL
|
274
|
|
-# after they install Tor Browser).
|
275
|
|
-PKG_LOCALE="ALL"
|
276
|
|
-PKG_DIR='[% c("var/project-name") %]'
|
277
|
|
-
|
278
|
271
|
for tbdir in "${TBDIRS[@]}"
|
279
|
272
|
do
|
280
|
273
|
tbdir="$tbdir[% IF c('var/macos') %]/Contents/Resources[% END %]/"
|
... |
... |
@@ -325,12 +318,13 @@ done |
325
|
318
|
# we write the uninstaller from the installer.
|
326
|
319
|
# Instead, we need to write an updated postupdate.exe also when updating.
|
327
|
320
|
makensis postupdate.nsi
|
328
|
|
- mv postupdate.exe ${TB_STAGE_DIR}/Browser/
|
|
321
|
+ mv postupdate.exe "${TB_STAGE_DIR}/Browser/"
|
329
|
322
|
popd
|
330
|
323
|
[% END -%]
|
331
|
324
|
|
332
|
|
- mv ${TB_STAGE_DIR} $distdir/windows-installer/"[% c('var/Project_Name') %]"
|
333
|
|
- mv $distdir/windows-installer ${TB_STAGE_DIR}
|
|
325
|
+ mv "${TB_STAGE_DIR}" "$distdir/windows-installer/[% c('var/Project_Name') %]"
|
|
326
|
+ rmdir "$distdir/$PKG_DIR"
|
|
327
|
+ mv $distdir/windows-installer "$distdir/$PKG_DIR"
|
334
|
328
|
[% END %]
|
335
|
329
|
|
336
|
330
|
[% IF c("var/macos_universal") -%]
|
... |
... |
@@ -355,18 +349,47 @@ done |
355
|
349
|
rm -Rf "$TBDIR_AARCH64"
|
356
|
350
|
[% END -%]
|
357
|
351
|
|
358
|
|
-[% IF c("var/windows") %]
|
359
|
|
- TBDIR="$distdir/$PKG_DIR/[% c("var/Project_Name") %]/Browser"
|
360
|
|
-[% ELSIF c("var/macos") %]
|
361
|
|
- TBDIR="$distdir/$PKG_DIR/[% c('var/display_name') %].app"
|
362
|
|
-[% ELSE %]
|
363
|
|
- TBDIR="$distdir/$PKG_DIR/Browser"
|
364
|
|
-[% END %]
|
|
352
|
+[% IF c("var/updater_enabled") -%]
|
|
353
|
+ cp $rootdir/[% c('input_files_by_name/firefox') %]/mar-tools-*.zip "$OUTDIR"/
|
|
354
|
+[% END -%]
|
365
|
355
|
|
366
|
|
-cat > "$scripts_dir/create-$PKG_DIR" << SCRIPT_EOF
|
367
|
|
-#!/bin/bash
|
368
|
|
-set -e
|
369
|
|
-cp -a ${TB_STAGE_DIR} $distdir/$PKG_DIR
|
|
356
|
+[% IF c("var/windows") -%]
|
|
357
|
+ archive_ext=zip
|
|
358
|
+[% ELSE -%]
|
|
359
|
+ archive_ext=tar.xz
|
|
360
|
+[% END -%]
|
|
361
|
+
|
|
362
|
+debug_symbols="$rootdir/[% c('input_files_by_name/firefox') %]/browser-debug-symbols.$archive_ext"
|
|
363
|
+if [[ -f "$debug_symbols" ]]; then
|
|
364
|
+ cp "$debug_symbols" "$OUTDIR/[% c('var/project-name') %]-debug-symbols-[% c('var/mar_osname') %]-[% c('var/torbrowser_version') %].$archive_ext"
|
|
365
|
+fi
|
|
366
|
+
|
|
367
|
+geckodriver="$rootdir/[% c('input_files_by_name/firefox') %]/geckodriver.$archive_ext"
|
|
368
|
+if [[ -f "$geckodriver" ]]; then
|
|
369
|
+ cp "$geckodriver" "$OUTDIR/geckodriver-[% c('var/osname') %]-[% c('var/torbrowser_version') %].$archive_ext"
|
|
370
|
+fi
|
|
371
|
+[% IF c("var/macos_universal") -%]
|
|
372
|
+ geckodriver="$rootdir/[% c('input_files_by_name/firefox-aarch64') %]/geckodriver.$archive_ext"
|
|
373
|
+ if [[ -f "$geckodriver" ]]; then
|
|
374
|
+ cp "$geckodriver" "$OUTDIR/geckodriver-macos-aarch64-[% c('var/torbrowser_version') %].$archive_ext"
|
|
375
|
+ fi
|
|
376
|
+[% END -%]
|
|
377
|
+
|
|
378
|
+[%IF c("var/tor-browser") -%]
|
|
379
|
+ tor_expert_bundle_src="[% c("input_files_by_name/tor-expert-bundle") %]"
|
|
380
|
+ # strip off trailing "$buildid.tar.gz"
|
|
381
|
+ tor_expert_bundle_dest=${tor_expert_bundle_src:0:-7}.tar.gz
|
|
382
|
+ cp $rootdir/[% c("input_files_by_name/tor-expert-bundle") %]/tor-expert-bundle.tar.gz "$OUTDIR"/$tor_expert_bundle_dest
|
|
383
|
+ [% IF c("var/macos_universal") %]
|
|
384
|
+ tor_expert_bundle_src="[% c('input_files_by_name/tor-expert-bundle-aarch64') %]"
|
|
385
|
+ # strip off trailing "$buildid.tar.gz"
|
|
386
|
+ tor_expert_bundle_dest=${tor_expert_bundle_src:0:-7}.tar.gz
|
|
387
|
+ cp $rootdir/[% c('input_files_by_name/tor-expert-bundle-aarch64') %]/tor-expert-bundle.tar.gz "$OUTDIR"/$tor_expert_bundle_dest
|
|
388
|
+ [% END -%]
|
|
389
|
+[% END -%]
|
|
390
|
+[% IF c("var/build_infos_json") -%]
|
|
391
|
+ cp $rootdir/[% c('input_files_by_name/firefox') %]/build-infos.json "$OUTDIR"/build-infos-[% c("var/mar_osname") %].json
|
|
392
|
+[% END -%]
|
370
|
393
|
|
371
|
394
|
[% IF c("var/updater_enabled") -%]
|
372
|
395
|
pushd "$TBDIR[% IF c("var/macos") %]/Contents/Resources/[% END %]"
|
... |
... |
@@ -378,7 +401,7 @@ cd $distdir |
378
|
401
|
|
379
|
402
|
[% IF c("var/build_mar") && c("var/updater_enabled") -%]
|
380
|
403
|
# Create full MAR file and compressed package.
|
381
|
|
- [% SET mar_file = c("var/project-name") _ '-' _ c("var/mar_osname") _ '-' _ c("var/torbrowser_version") _ '_${PKG_LOCALE}.mar' %]
|
|
404
|
+ [% SET mar_file = c("var/project-name") _ '-' _ c("var/mar_osname") _ '-' _ c("var/torbrowser_version") _ '_ALL.mar' %]
|
382
|
405
|
MAR=$MARTOOLS/mar \
|
383
|
406
|
MOZ_PRODUCT_VERSION=[% c("var/torbrowser_version") %] \
|
384
|
407
|
MAR_CHANNEL_ID=[% c("var/mar_channel_id") %] \
|
... |
... |
@@ -415,55 +438,3 @@ cd $distdir |
415
|
438
|
[% END -%]
|
416
|
439
|
popd
|
417
|
440
|
[% END %] |
418
|
|
-rm -rf $distdir/${PKG_DIR}
|
419
|
|
-SCRIPT_EOF
|
420
|
|
-
|
421
|
|
-[% IF c("var/updater_enabled") -%]
|
422
|
|
- cp $rootdir/[% c('input_files_by_name/firefox') %]/mar-tools-*.zip "$OUTDIR"/
|
423
|
|
-[% END -%]
|
424
|
|
-
|
425
|
|
-[% IF c("var/windows") -%]
|
426
|
|
- archive_ext=zip
|
427
|
|
-[% ELSE -%]
|
428
|
|
- archive_ext=tar.xz
|
429
|
|
-[% END -%]
|
430
|
|
-
|
431
|
|
-debug_symbols="$rootdir/[% c('input_files_by_name/firefox') %]/browser-debug-symbols.$archive_ext"
|
432
|
|
-if [[ -f "$debug_symbols" ]]; then
|
433
|
|
- cp "$debug_symbols" "$OUTDIR/[% c('var/project-name') %]-debug-symbols-[% c('var/mar_osname') %]-[% c('var/torbrowser_version') %].$archive_ext"
|
434
|
|
-fi
|
435
|
|
-
|
436
|
|
-[% IF c("var/macos_universal") -%]
|
437
|
|
- geckodriver="$rootdir/[% c('input_files_by_name/firefox') %]/geckodriver.$archive_ext"
|
438
|
|
- if [[ -f "$geckodriver" ]]; then
|
439
|
|
- cp "$geckodriver" "$OUTDIR/geckodriver-[% c('var/osname') %]-[% c('var/torbrowser_version') %].$archive_ext"
|
440
|
|
- fi
|
441
|
|
- geckodriver="$rootdir/[% c('input_files_by_name/firefox-aarch64') %]/geckodriver.$archive_ext"
|
442
|
|
- if [[ -f "$geckodriver" ]]; then
|
443
|
|
- cp "$geckodriver" "$OUTDIR/geckodriver-macos-aarch64-[% c('var/torbrowser_version') %].$archive_ext"
|
444
|
|
- fi
|
445
|
|
-[% ELSE -%]
|
446
|
|
- geckodriver="$rootdir/[% c('input_files_by_name/firefox') %]/geckodriver.$archive_ext"
|
447
|
|
- if [[ -f "$geckodriver" ]]; then
|
448
|
|
- cp "$geckodriver" "$OUTDIR/geckodriver-[% c('var/osname') %]-[% c('var/torbrowser_version') %].$archive_ext"
|
449
|
|
- fi
|
450
|
|
-[% END -%]
|
451
|
|
-
|
452
|
|
-[%IF c("var/tor-browser") -%]
|
453
|
|
- tor_expert_bundle_src="[% c("input_files_by_name/tor-expert-bundle") %]"
|
454
|
|
- # strip off trailing "$buildid.tar.gz"
|
455
|
|
- tor_expert_bundle_dest=${tor_expert_bundle_src:0:-7}.tar.gz
|
456
|
|
- cp $rootdir/[% c("input_files_by_name/tor-expert-bundle") %]/tor-expert-bundle.tar.gz "$OUTDIR"/$tor_expert_bundle_dest
|
457
|
|
- [% IF c("var/macos_universal") %]
|
458
|
|
- tor_expert_bundle_src="[% c('input_files_by_name/tor-expert-bundle-aarch64') %]"
|
459
|
|
- # strip off trailing "$buildid.tar.gz"
|
460
|
|
- tor_expert_bundle_dest=${tor_expert_bundle_src:0:-7}.tar.gz
|
461
|
|
- cp $rootdir/[% c('input_files_by_name/tor-expert-bundle-aarch64') %]/tor-expert-bundle.tar.gz "$OUTDIR"/$tor_expert_bundle_dest
|
462
|
|
- [% END -%]
|
463
|
|
-[% END -%]
|
464
|
|
-[% IF c("var/build_infos_json") -%]
|
465
|
|
- cp $rootdir/[% c('input_files_by_name/firefox') %]/build-infos.json "$OUTDIR"/build-infos-[% c("var/mar_osname") %].json
|
466
|
|
-[% END -%]
|
467
|
|
-
|
468
|
|
-chmod 775 $rootdir/run_scripts "$scripts_dir"/*
|
469
|
|
-$rootdir/run_scripts [% c("num_procs") %] "$scripts_dir" |