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

Commits:

1 changed file:

Changes:

  • projects/firefox/build
    ... ... @@ -57,15 +57,6 @@ tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
    57 57
     
    
    58 58
     mkdir -p $distdir/[% IF ! c("var/macos") %]Browser[% END %]
    
    59 59
     
    
    60
    -[% IF !c("var/testbuild") -%]
    
    61
    -  tar -xf $rootdir/[% c('input_files_by_name/translation-base-browser') %]
    
    62
    -  transl_base_browser=$rootdir/translation-base-browser
    
    63
    -  [% IF c("var/tor-browser") -%]
    
    64
    -    tar -xf $rootdir/[% c('input_files_by_name/translation-tor-browser') %]
    
    65
    -    transl_tor_browser=$rootdir/translation-tor-browser
    
    66
    -  [% END -%]
    
    67
    -[% END -%]
    
    68
    -
    
    69 60
     cd /var/tmp/build/[% project %]-[% c("version") %]
    
    70 61
     cat > .mozconfig << 'MOZCONFIG_EOF'
    
    71 62
     [% INCLUDE mozconfig %]
    
    ... ... @@ -106,43 +97,6 @@ fi
    106 97
       sed -i 's|^URL=https://aus1\.torproject\.org/.*|URL=https://nightlies.tbb.torproject.org/nightly-updates/updates/nightly-[% c("var/nightly_updates_osname") %]/%CHANNEL%/%BUILD_TARGET%/%VERSION%/ALL|' build/application.ini.in
    
    107 98
     [% END -%]
    
    108 99
     
    
    109
    -add_translation () {
    
    110
    -  transl_dir=$1
    
    111
    -  component=$2
    
    112
    -  lang=$3
    
    113
    -  filename=$4
    
    114
    -
    
    115
    -  mkdir "browser/components/$component/locale/$lang"
    
    116
    -  cp "$transl_dir/$lang/$filename" "browser/components/$component/locale/$lang/"
    
    117
    -  echo "% locale $component $lang %locale/$lang/" >> "browser/components/$component/jar.mn"
    
    118
    -  echo "    locale/$lang/$filename (locale/$lang/$filename)" >> "browser/components/$component/jar.mn"
    
    119
    -}
    
    120
    -
    
    121
    -[% IF c("var/testbuild") -%]
    
    122
    -  supported_locales=""
    
    123
    -[% ELSE -%]
    
    124
    -  supported_locales="[% tmpl(c('var/locales').join(' ')) %]"
    
    125
    -[% END -%]
    
    126
    -[% IF c("var/tor-browser") -%]
    
    127
    -  torbutton_locales="toolkit/torbutton/chrome/locale/"
    
    128
    -  torbutton_jar="toolkit/torbutton/jar.mn"
    
    129
    -[% END -%]
    
    130
    -for lang in $supported_locales; do
    
    131
    -  [% IF c("var/macos") -%]
    
    132
    -    if [ "$lang" == "ja-JP-mac" ]; then
    
    133
    -      lang="ja"
    
    134
    -    fi
    
    135
    -  [% END-%]
    
    136
    -
    
    137
    -  add_translation $transl_base_browser newidentity $lang newIdentity.properties
    
    138
    -  add_translation $transl_base_browser securitylevel $lang securityLevel.properties
    
    139
    -
    
    140
    -  [% IF c("var/tor-browser") -%]
    
    141
    -    mv "$transl_tor_browser/$lang" "$torbutton_locales/"
    
    142
    -    echo "% locale torbutton $lang %locale/$lang/" >> "$torbutton_jar"
    
    143
    -    echo "    locale/$lang (chrome/locale/$lang/*)" >> "$torbutton_jar"
    
    144
    -  [% END -%]
    
    145
    -done
    
    146 100
     
    
    147 101
     rm -f configure
    
    148 102
     rm -f js/src/configure
    
    ... ... @@ -153,24 +107,60 @@ export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system
    153 107
     mkdir "$HOME/.mozbuild"
    
    154 108
     
    
    155 109
     [% IF !c("var/testbuild") -%]
    
    110
    +  supported_locales="[% tmpl(c('var/locales').join(' ')) %]"
    
    111
    +
    
    156 112
       l10ncentral="$HOME/.mozbuild/l10n-central"
    
    157 113
       mkdir "$l10ncentral"
    
    158 114
       for tarball in $rootdir/[% c('input_files_by_name/firefox-l10n') %]/*; do
    
    159 115
         tar -C "$l10ncentral" -xf "$tarball"
    
    160 116
       done
    
    161 117
     
    
    162
    -  tar -C $rootdir -xf $rootdir/[% c('input_files_by_name/translation-base-browser-fluent') %]
    
    163
    -  base_browser_fluent=$rootdir/translation-base-browser-fluent
    
    118
    +  tar -C "$rootdir" -xf "$rootdir/[% c('input_files_by_name/translation-base-browser') %]"
    
    119
    +  pushd "$rootdir/translation-base-browser"
    
    120
    +  ln -s ja ja-JP-mac
    
    164 121
       for lang in $supported_locales; do
    
    165
    -    source_lang="$lang"
    
    166
    -    if [ $lang = "ja-JP-mac" ]; then
    
    167
    -      source_lang="ja"
    
    168
    -    elif [ $lang = "es-ES" ]; then
    
    169
    -      source_lang="es"
    
    170
    -    fi
    
    171
    -    cp "$base_browser_fluent/$source_lang/languageNotification.ftl" "$l10ncentral/$lang/browser/browser/"
    
    122
    +    # Please notice that Fluent and DTDs use different directories in
    
    123
    +    # l10n-central! This is something we have to keep in mind when we will join
    
    124
    +    # the two branches!
    
    125
    +    mv $lang/* "$l10ncentral/$lang/browser/chrome/browser/"
    
    172 126
       done
    
    173
    -[% END %]
    
    127
    +  popd
    
    128
    +
    
    129
    +  tar -C "$rootdir" -xf "$rootdir/[% c('input_files_by_name/translation-base-browser-fluent') %]"
    
    130
    +  pushd "$rootdir/translation-base-browser-fluent"
    
    131
    +  ln -s ja ja-JP-mac
    
    132
    +  # TODO: These two sources will be unified eventually; at that point, this link
    
    133
    +  # will go away, too.
    
    134
    +  ln -s es es-ES
    
    135
    +  for lang in $supported_locales; do
    
    136
    +    mv $lang/languageNotification.ftl "$l10ncentral/$lang/browser/browser/"
    
    137
    +  done
    
    138
    +  popd
    
    139
    +
    
    140
    +  [% IF c("var/tor-browser") -%]
    
    141
    +    # We will have to keep the torbutton.jar until we stop using dtds, because
    
    142
    +    # if we move them to the browser locale directory, browser.xhtml is not
    
    143
    +    # loaded.
    
    144
    +    tar -C "$rootdir" -xf "$rootdir/[% c('input_files_by_name/translation-tor-browser') %]"
    
    145
    +    transl_tor_browser="$rootdir/translation-tor-browser"
    
    146
    +    torbutton_locales="toolkit/torbutton/chrome/locale/"
    
    147
    +    torbutton_jar="toolkit/torbutton/jar.mn"
    
    148
    +    for lang in $supported_locales; do
    
    149
    +      central_lang=$lang
    
    150
    +      [% IF c("var/macos") -%]
    
    151
    +        if [ "$lang" == "ja-JP-mac" ]; then
    
    152
    +          lang="ja"
    
    153
    +        fi
    
    154
    +      [% END -%]
    
    155
    +      mv "$transl_tor_browser/$lang/cryptoSafetyPrompt.properties" "$l10ncentral/$central_lang/browser/chrome/browser/"
    
    156
    +      mv "$transl_tor_browser/$lang" "$torbutton_locales/"
    
    157
    +      echo "% locale torbutton $lang %locale/$lang/" >> "$torbutton_jar"
    
    158
    +      echo "    locale/$lang (chrome/locale/$lang/*)" >> "$torbutton_jar"
    
    159
    +    done
    
    160
    +  [% END -%]
    
    161
    +[% ELSE -%]
    
    162
    +  supported_locales=""
    
    163
    +[% END -%]
    
    174 164
     
    
    175 165
     # PyYAML tries to read files as ASCII, otherwise
    
    176 166
     export LC_ALL=C.UTF-8