Pier Angelo Vendrame pushed to branch main at The Tor Project / Applications / tor-browser-build
Commits:
-
84219469
by Pier Angelo Vendrame at 2024-05-15T10:19:02+02:00
3 changed files:
Changes:
| ... | ... | @@ -21,11 +21,17 @@ steps: |
| 21 | 21 | input_files => sub {
|
| 22 | 22 | my ($project, $options) = @_;
|
| 23 | 23 | my @input_files;
|
| 24 | - my $changesets_json = project_config('firefox', 'var/l10n-changesets', { %$options, origin_project => $project });
|
|
| 24 | + my $is_android = project_config($project, 'var/android', $options);
|
|
| 25 | + my $source_project = $is_android ? 'geckoview' : 'firefox';
|
|
| 26 | + my $locales_key = $is_android ? 'var/locales_mobile' : 'var/locales';
|
|
| 27 | + my $changesets_json = project_config($source_project, 'var/l10n-changesets', { %$options, origin_project => $project });
|
|
| 25 | 28 | my $d = decode_json $changesets_json;
|
| 26 | - my $locales = project_config($project, 'var/locales', $options);
|
|
| 29 | + my $locales = project_config($project, $locales_key, $options);
|
|
| 27 | 30 | foreach my $loc (@$locales) {
|
| 28 | 31 | my $locale = process_template($project, $loc, '.');
|
| 32 | + $locale =~ s/-r/-/;
|
|
| 33 | + $locale = "id" if ($is_android && $locale eq "in");
|
|
| 34 | + $locale = "he" if ($is_android && $locale eq "iw");
|
|
| 29 | 35 | next unless my $revision = $d->{$locale}{revision};
|
| 30 | 36 | my $input_file = {
|
| 31 | 37 | name => $locale,
|
| ... | ... | @@ -33,6 +33,8 @@ var: |
| 33 | 33 | gradle_dependencies_version: 12
|
| 34 | 34 | gradle_version: 7.5.1
|
| 35 | 35 | variant: beta
|
| 36 | + has_l10n: '[% !c("var/testbuild") && !c("var/locales").empty %]'
|
|
| 37 | + l10n-changesets: '[% exec("cat browser/locales/l10n-changesets.json") %]'
|
|
| 36 | 38 | |
| 37 | 39 | targets:
|
| 38 | 40 | release:
|
| ... | ... | @@ -84,6 +86,12 @@ steps: |
| 84 | 86 | pkg_type: build
|
| 85 | 87 | target_prepend:
|
| 86 | 88 | - torbrowser-android-x86_64
|
| 89 | + - project: firefox-l10n
|
|
| 90 | + name: firefox-l10n
|
|
| 91 | + enable: '[% c("var/has_l10n") %]'
|
|
| 92 | + pkg_type: build
|
|
| 93 | + target_prepend:
|
|
| 94 | + - torbrowser-android-armv7
|
|
| 87 | 95 | |
| 88 | 96 | list_toolchain_updates:
|
| 89 | 97 | git_url: https://github.com/mozilla/gecko-dev.git
|
| ... | ... | @@ -49,6 +49,19 @@ cp -rl $gradle_repo/maven2/* $gradle_repo || true |
| 49 | 49 | export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system
|
| 50 | 50 | # Create .mozbuild to avoid interactive prompt in configure
|
| 51 | 51 | mkdir "$HOME/.mozbuild"
|
| 52 | + |
|
| 53 | +[% IF c("var/has_l10n") -%]
|
|
| 54 | + supported_locales="[% tmpl(c('var/locales_mobile').join(' ')).replace('-r', '-').replace('in', 'id').replace('iw', 'he') %]"
|
|
| 55 | + l10ncentral="$HOME/.mozbuild/l10n-central"
|
|
| 56 | + mkdir "$l10ncentral"
|
|
| 57 | + for tarball in $rootdir/[% c('input_files_by_name/firefox-l10n') %]/*; do
|
|
| 58 | + tar -C "$l10ncentral" -xf "$tarball"
|
|
| 59 | + done
|
|
| 60 | + |
|
| 61 | + # Do not setup our localization files, as we do not provide any frontend
|
|
| 62 | + # through GeckoView.
|
|
| 63 | +[% END -%]
|
|
| 64 | + |
|
| 52 | 65 | # We still need to specify --tor-browser-version due to bug 34005.
|
| 53 | 66 | ./mach configure \
|
| 54 | 67 | --with-base-browser-version=[% c("var/torbrowser_version") %] \
|
| ... | ... | @@ -56,6 +69,12 @@ mkdir "$HOME/.mozbuild" |
| 56 | 69 | [% IF !c("var/rlbox") -%]--without-wasm-sandboxed-libraries[% END %]
|
| 57 | 70 | |
| 58 | 71 | ./mach build --verbose
|
| 72 | + |
|
| 73 | +[% IF c('var/has_l10n') -%]
|
|
| 74 | + # No quotes on purpose, to pass each locale as an additional argument.
|
|
| 75 | + ./mach package-multi-locale --locales en-US $supported_locales
|
|
| 76 | +[% END -%]
|
|
| 77 | + |
|
| 59 | 78 | # We prepare an archive to then extract it as we were using a local Maven
|
| 60 | 79 | # repository.
|
| 61 | 80 | # See also https://github.com/mozilla-mobile/firefox-android/blob/main/fenix/docs/substituting-local-gv.md
|