tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

build-zucchini.sh (1254B)


      1 #!/bin/bash
      2 # This Source Code Form is subject to the terms of the Mozilla Public
      3 # License, v. 2.0. If a copy of the MPL was not distributed with this
      4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
      5 
      6 set -x -e -v
      7 
      8 # This script builds the standalone zucchini binary used for generating
      9 # zucchini patches for partial updates.
     10 
     11 # Variables
     12 WORKSPACE="$HOME/workspace"
     13 UPLOAD_DIR="${UPLOAD_DIR:-$WORKSPACE/upload}"
     14 
     15 # Note that tar will choose type of compression based on provided filename (ie: xz/zst/gz)
     16 TOOLCHAIN_ARTIFACT_PATH="${TOOLCHAIN_ARTIFACT:-public/build/zucchini.tar.xz}"
     17 ARTIFACT_FILENAME=$(basename "$TOOLCHAIN_ARTIFACT_PATH")
     18 
     19 cd $GECKO_PATH
     20 
     21 export MOZ_OBJDIR=obj-zucchini
     22 BUILD_OUTPUT_DIR=$MOZ_OBJDIR/dist/bin
     23 
     24 cat > .mozconfig <<'EOF'
     25 ac_add_options --enable-project=tools/zucchini
     26 ac_add_options --enable-zucchini
     27 EOF
     28 
     29 TOOLCHAINS="clang"
     30 
     31 for t in $TOOLCHAINS; do
     32    PATH="$MOZ_FETCHES_DIR/$t/bin:$PATH"
     33 done
     34 
     35 ./mach build -v
     36 
     37 # Package the Zucchini binary
     38 cd "$BUILD_OUTPUT_DIR"
     39 tar --create --auto-compress --file "$ARTIFACT_FILENAME" zucchini
     40 
     41 # Move the artifact to the upload directory
     42 mkdir -p "$UPLOAD_DIR"
     43 mv "$ARTIFACT_FILENAME" "$UPLOAD_DIR/$ARTIFACT_FILENAME"
     44 
     45 echo "Build and packaging completed successfully."