build_gyp.sh (1239B)
1 #!/usr/bin/env bash 2 3 set -v -e -x 4 5 # Parse for the -t option. 6 m=x64 7 for i in "$@"; do 8 case "$i" in 9 -t|--target) m= ;; 10 --target=*) m="${i#*=}" ;; 11 *) [[ -z "$m" ]] && m="$i" ;; 12 esac 13 done 14 [[ "$m" == "ia32" ]] && m=x86 15 source "$(dirname "$0")/setup.sh" 16 17 git clone https://chromium.googlesource.com/external/gyp 18 19 # Install GYP. 20 pushd gyp 21 python3 -m venv ./test-env 22 test-env/Scripts/python3 setup.py install 23 test-env/Scripts/python3 -m pip install --upgrade pip 24 test-env/Scripts/pip install --upgrade 'setuptools<45.0.0' six 25 # Fool GYP. 26 touch "${VSPATH}/VC/vcvarsall.bat" 27 export GYP_MSVS_OVERRIDE_PATH="${VSPATH}" 28 export GYP_MSVS_VERSION=2015 29 popd 30 31 export PATH="${PATH}:${PWD}/ninja/bin:${PWD}/gyp/test-env/Scripts" 32 33 test -v VCS_PATH 34 35 # builds write to the source dir (and its parent), so move the source trees to 36 # our workspace from the (cached) checkout dir 37 cp -a "${VCS_PATH}/nspr" "${VCS_PATH}/nss" . 38 39 pushd nspr 40 hg revert --all 41 if [[ -f ../nss/nspr.patch && "$ALLOW_NSPR_PATCH" == "1" ]]; then 42 cat ../nss/nspr.patch | patch -p1 43 fi 44 popd 45 46 make () { 47 mozmake "$@" 48 } 49 export -f make 50 51 # Build with gyp. 52 ./nss/build.sh -g -v --enable-libpkix -Denable_draft_hpke=1 "$@" 53 54 # Package. 55 7z a public/build/dist.7z dist