tor-browser

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

update_highway.sh (1297B)


      1 #!/bin/bash
      2 
      3 # Update third_party/highway to the latest version.
      4 
      5 # Usage: (under libaom root directory)
      6 # ./tools/update_highway.sh
      7 
      8 set -e
      9 
     10 highway_dir="$(pwd)/third_party/highway"
     11 repo_url="https://github.com/google/highway"
     12 
     13 git clone --depth 1 "$repo_url" "$highway_dir"
     14 
     15 cd "${highway_dir}"
     16 
     17 commit_hash=$(git rev-parse HEAD)
     18 
     19 # Remove everything except ./hwy
     20 find . -mindepth 1 \
     21  -not -path "./hwy" \
     22  -not -path "./hwy/*" \
     23  -not -name "LICENSE-BSD3" \
     24  -delete
     25 
     26 # Remove tests/ directory
     27 rm -rf hwy/tests/
     28 
     29 # Remove markdown files
     30 find . -name "*.md" -delete
     31 
     32 # Remove cc files since we build highway header-only
     33 find . -name "*.cc" -delete
     34 
     35 # Update the include path
     36 find ./hwy \( -name "*.c" -o -name "*.cc" -o -name "*.h" \) -print0 | \
     37  xargs -0 sed -i 's/#include "hwy\//#include "third_party\/highway\/hwy\//g'
     38 
     39 find ./hwy \( -name "*.c" -o -name "*.cc" -o -name "*.h" \) -print0 | \
     40  xargs -0 sed -i \
     41  's/HWY_TARGET_INCLUDE "hwy\//HWY_TARGET_INCLUDE "third_party\/highway\/hwy\//g'
     42 
     43 cat > "${highway_dir}/README.libaom" <<EOF
     44 URL: $repo_url
     45 
     46 Version: $commit_hash
     47 License: BSD-3-clause clear
     48 License File: LICENSE-BSD3
     49 
     50 Description:
     51 Highway is a C++ library that provides portable SIMD/vector intrinsics.
     52 
     53 Local Changes:
     54 Remove everything except hwy/ and LICENSE-BSD3
     55 EOF