tor-browser

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

build-custom-v8.sh (1088B)


      1 #!/bin/bash
      2 set -x -e -v
      3 
      4 # This script is for building a custom version of V8
      5 ARTIFACT_NAME='d8.tar.zst'
      6 CONFIG='is_debug=false target_cpu="x64"'
      7 if [[ $# -eq 0 ]]; then
      8    echo "Using default configuration for v8 build."
      9    CONFIG=$(echo $CONFIG | tr -d "'")
     10 else
     11 # First argument must be the artifact name
     12 ARTIFACT_NAME="$1"
     13 shift
     14 
     15 # Use the rest of the arguments as the build config
     16 CONFIG=$(echo $* | tr -d "'")
     17 fi
     18 
     19 echo "Config: $CONFIG"
     20 echo "Artifact name: $ARTIFACT_NAME"
     21 
     22 cd $GECKO_PATH
     23 
     24 # Setup depot_tools
     25 git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
     26 export PATH=$PATH:$GECKO_PATH/depot_tools
     27 # Bug 1901936 changes to config upstream for depot tools path
     28 export XDG_CONFIG_HOME=$GECKO_PATH
     29 
     30 # Get v8 source code and dependencies
     31 fetch --force v8
     32 cd v8
     33 
     34 # Build v8
     35 gn gen out/release --args="$CONFIG"
     36 ninja -C out/release d8
     37 
     38 # Gather binary and related files into a zip, and upload it
     39 cd ..
     40 mkdir d8
     41 
     42 cp -R v8/out/release d8
     43 cp -R v8/include d8
     44 chmod -R +x d8
     45 
     46 tar caf $ARTIFACT_NAME d8
     47 
     48 mkdir -p $UPLOAD_DIR
     49 cp $ARTIFACT_NAME $UPLOAD_DIR